General DescriptionAzure Pipelines task facilitates an integration between Azure DevOps Pipeline (Build / Release) and Azure Data Explorer (ADX) databases. This extension includes 3 basic tasks:
The content and functionality of the tasks can be taken from either a git source control or build sources or build artifacts or inline the task. The tasks authenticates with AAD App details (ID / Key) either from variabes or an Azure DevOps Service endpoint. Official Azure Data Explorer - Azure DevOps integration DetailsAzure Data Explorer EndpointEnter your Cluster URL, AppID, AppKey and TenantID in the Service connection appropriate Fields (Authentication Token Field should be left empty) To create a new service connection go to project settings page (the gear icon in the lower lefthand side) *** if you have service endpoints created before version 1.7.1 you might need to recreate them for the server gate task to work properly *** Admin command taskAdd your endpoint information (Cluster and Database) to Endpoint URLs (optional: use values from build variables) Add your AppID, AppKey and TenantID (Use Variable Group or Secret Build Variable) the Resource URI is the service endpoint providing the jwt token requested for accesing your cluster should be the base URL for your cluster, Or you can Use an Azure Data Explorer Service Endpoint if you don't already have a Service connection configured, click the "Manage" link to create a new service connection Add the match pattern for your *.csl files from the Source Control (for running multiple commands in the same task) ***the single line option allows having multiple files, with one command per file *** Alternatively: switch to an inline script and write your command directly in the task (no empty lines - one command per task) OR: Add you file directly from a git repository path In case the command is a long running asynchronous operations you can check "Wait for long Async Admin commands to complete" checkbox to have the task run ".show operations " in the REST response, and the task will wait for the command to complete pass or fail based on the result (Task will fail if any command in the script is not async - Use only on async commands) Optional: Add the name of the output variable (Or Path to output file) you want to command response to be stored in (and use it in downstream tasks) if you run multiple commands only last query is saved, when "Save only last response is unchecked multiple variables will be created (one foreach command and endpoint - with ' prefix' for filenames or ' suffix' for variables)" Yaml Sample Usage
Query taskAdd your endpoint information (Cluster and Database) to Endpoint URLs (optional: use values from build variables) Add your AppID, AppKey and TenantID (Use Variable Group or Secret Build Variable) the Resource URI is the service endpoint providing the jwt token requested for accesing your cluster should be the base URL for your cluster, Or you can Use an Azure Data Explorer Service Endpoint if you don't already have a Service connection configured, click the "Manage" link to create a new service connection Add the match pattern for your *.csl files from the Source Control (for running multiple commands in the same task) ***the single line option allows having multiple files, with one command per file *** Alternatively: switch to an inline script and write your command directly in the task (no empty lines - one command per task) OR: Add you file directly from a git repository path Query Exit Criteria: you can choose to fail the task based on the response record (rows) count or based on the response (single) value (make sure the query only returns a single record (row and field)) Optional: Add the name of the output variable (Or Path to output file) you want to command response to be stored in (and use it in downstream tasks) if you run multiple commands only last query is saved, when "Save only last response is unchecked multiple variables will be created (one foreach command and endpoint - with ' prefix' for filenames or ' suffix' for variables)" Server GateOnce we go to Release Definition, by accessing pre/post approval setting we can enable Gates and add Azure Data Explorer Query as a Gate We can query ADX using Inline query We can query ADX using File path How to add an endpoint to be used by Azure Data Explorer Query Gate or TaskGetting ApplicationId and ApplicationKey How to add Query Kusto as a TaskInput parameters
How to adjust thresholdMax and min threshold are output rows expected from the Kusto query Yaml Sample Usage
Run the task in a CI pipeline and see the JSON results in the log, or, alternatively, get it in downstream tasks with the Output Variable $(OutputVariable) You can save it to file or parse it with JSON parsing tool ContributionsThis extension is maintained by Kusto Ops Team Publisher Page Microsoft docsOfficial Microsoft Documentation Site for Azure Data Explorer Github |