Skip to content

Run a Kusto script or inline query against your Kusto cluster in your GitHub Actions workflow

License

Notifications You must be signed in to change notification settings

philip-gai/kusto-script

Use this GitHub action with your project
Add this Action to an existing workflow or create a new one
View on Marketplace

Repository files navigation

kusto-script

Tests

Run a Kusto script or inline query against your Azure Data Explorer cluster in your GitHub Actions workflow.

Usage

First, authenticate with Azure using Azure/login and setup the Kusto CLI using philip-gai/setup-kusto. Then you can run an inline query or a a Kusto script using philip-gai/kusto-script. If you are running a script, make sure to run actions/checkout before philip-gai/kusto-script so your script is accessible by the action. You can also deploy functions and views by passing in kusto-script-folders.

    steps:
      - uses: actions/checkout@v3.5.2 # If running a Kusto script
      - uses: Azure/login@v1 # Use OIDC if possible
        with:
          client-id: ${{ env.AZURE_CLIENT_ID }} # Value from Azure AAD
          tenant-id: ${{ env.AZURE_TENANT_ID }} # Value from Azure AAD
          allow-no-subscriptions: true
      - uses: philip-gai/setup-kusto@v1
      - name: Run inline query
        uses: philip-gai/kusto-script@main # Replace @main with @tag
        with:
          kusto-uri: ${{ env.KUSTO_URI }} # Example: https://mycluster.kusto.windows.net or https://mycluster.kusto.windows.net/MyDatabase
          kusto-query: ".show databases"
      - name: Run a single Kusto script
        uses: philip-gai/kusto-script@main # Replace @main with @tag
        with:
          kusto-uri: ${{ env.KUSTO_URI }} # Example: https://mycluster.kusto.windows.net or https://mycluster.kusto.windows.net/MyDatabase
          kusto-script: "kusto-scripts/show-commands.kql" # Relative to the repository root
      - name: Deploy functions and views
        uses: philip-gai/kusto-script@main # Replace @main with @tag
        with:
          kusto-uri: ${{ env.KUSTO_URI }} # Example: https://mycluster.kusto.windows.net or https://mycluster.kusto.windows.net/MyDatabase
          kusto-script-folders: "kusto-scripts/functions kusto-scripts/views" # Relative to the repository root. Space separated list of folders.

About

Run a Kusto script or inline query against your Kusto cluster in your GitHub Actions workflow

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages