YAML migration for Azure-Kusto query

Abhay Punjabi 0 Reputation points Microsoft Employee
2024-08-29T18:01:49.9233333+00:00

I'm trying to trigger a gate check in YAML, this is what I have so far, with the sensitive bits removed. What is wrong with this snippet? I'm getting the following error -

Encountered error(s) while parsing pipeline YAML: /pipelines/Official/xl/officepy/mobr/output/officepysvc-release-pipeline-sdp-input_yaml.yml: (Line: 107, Col: 13, Idx: 3431) - (Line: 107, Col: 13, Idx: 3431): Mapping values are not allowed in this context.

- job: CustomJob
	pool:
	type: release
	steps:
	- task: Azure-Kusto.PublishToADX.PublishToADX.PublishToADX@4
inputs:
serviceConnection: 'svc connection name goes here'
targetType: 'inline'
script: |
let pst = datetime_utc_to_local(now(), 'US/Pacific');
| where not(isDeploymentAllowed)
|project ringType, startHour, endHour, businessDays, withinBusinessHours, isDeploymentAllowed, currentDayOfWeek                       waitForOperation: true
kustoUrls: 'URL goes here'
continueOnError: false
Azure Data Explorer
Azure Data Explorer
An Azure data analytics service for real-time analysis on large volumes of data streaming from sources including applications, websites, and internet of things devices.
531 questions
{count} votes

1 answer

Sort by: Most helpful
  1. phemanth 11,200 Reputation points Microsoft Vendor
    2024-08-30T11:17:14.1466667+00:00

    @Abhay Punjabi

    Welcome to the Microsoft Q&A and thank you for posting your questions here

    It looks like there are a few indentation issues in your YAML snippet. YAML is very sensitive to indentation, and it seems that the inputs block is not properly indented under the task. Here’s a corrected version:

    - job: CustomJob
      pool:
        type: release
      steps:
        - task: Azure-Kusto.PublishToADX.PublishToADX.PublishToADX@4
          inputs:
            serviceConnection: 'svc connection name goes here'
            targetType: 'inline'
            script: |
              let pst = datetime_utc_to_local(now(), 'US/Pacific');
              | where not(isDeploymentAllowed)
              | project ringType, startHour, endHour, businessDays, withinBusinessHours, isDeploymentAllowed, currentDayOfWeek
            waitForOperation: true
            kustoUrls: 'URL goes here'
            continueOnError: false
    

    Make sure that each level of indentation is consistent. In this case, inputs should be indented under task, and the properties under inputs should be indented further. This should resolve the parsing error you’re encountering.

    Hope this helps. Do let us know if you any further queries.

    0 comments No comments

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.