-
Notifications
You must be signed in to change notification settings - Fork 479
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Deployments failing before template is validated due to 'parTelemetryOptOut' #745
Comments
Hey @brotheroneill, Thanks for the issue, I have tried to repro this locally and have been unable to so far To me this feels/smells like something to do with the ADO PowerShell task you are using. Are you able to try this without using the AzurePowershell task and just native pwsh inline script or az cli instead? You can see how we do this in our accelerator here:
Thanks |
Hi @jtracey93, thanks for looking into this. I've ran a few more test, moving params around within out task and even excluding some params. It doesn't appear to be a problem with the parTelemetryOptOut param specifically, but the first inline param you pass in (-par...). I've also noticed this is only an issue when the MS hosted agent isn't the latest runner image, assuming of course this is then linked to the version of Bicep being used. Here's the version info from a failing pipeline run:
When executing the same pipeline, without changing any of the underlying code, the pipeline succeeds, and here is the runner info:
I guess we can fix this our side by ensure the pipelines use the latest version of Bicep, but perhaps something to consider either as guidance in the accelerator, or testing on the version of Bicep/runner image that most teams will be using, as I can't imagine we're the only ones to experience this. |
@oZakari do we have anything in the accelerator or is this something we should add to our pipelines as a shared script that always runs to ensure the latest version of bicep is installed? |
I haven't seen this issue come up yet. We do use the ubuntu-latest runner by default, so seems possible that the windows and linux agents may be out of sync in terms of updates for the runners. Either way, something that we can fix no problem. I'll plan on adding an additional script that will be included in the applicable workflows/pipelines to check/update the bicep version. |
@oZakari if it helps, this code (from here) worked for us on our windows hosted agent in a PowerShell@2 task:
I also got this working with a check against the current version of Bicep before attempting the install, but it wasn't particularly clean and involved querying the repo where the bicep executable is downloaded from, observing where you're redirected to when calling /latest and then comparing that to the current version of Bicep. It also saved very little time, so figured it's best to just try installing the latest version each time. Either way, here's how I approached it:
|
I am having this issue while trying to pass a parameter during the deployment of a policy assignment like so:
Error: The parameter exists in the bicep file. Tried with other parameters in the bicep file with the same result. Also, this works fine while deploying a policy definition:
bicep is the latest version. What am I missing here? Also, see this, also fails:
While the same command in az cli does not fail:
RESOLVED. |
Hey @achechen, thanks for sharing the solution you found. This issue has me curious as both the action and task we use in the pipelines should be using the latest version of PowerShell. Could you help me try to replicate by answering the following:
|
Hi @oZakari , I was doing some tests by manually deploying the bicep templates using Az PowerShell installed on my laptop before implementing this in Azure Pipelines. Sorry, I can't remember the version of the Az module I updated from. I updated to the latest version, which fixed the issue. I've now also tried the same deployment using an Azure Pipeline too, and it worked without any issues probably because we use our own hosted build agents and we keep them up-to date. |
Ah, that makes sense and thank you for letting me know! |
What happened? Provide a clear and concise description of the bug, including deployment details.
We've recently update our upstream-releases folder to the 17.2 release, since doing so we're seeing an error in our pipelines at the point Bicep is validating templates suggesting that the parameter 'parTelemetryOptOut' cannot be matched to one found in the templates. The exact error is:
We're using AzurePowerShell@5 tasks within our pipelines, and we've observed this error now on both a policy assignment, and a resource group deployment (though, they're the only deployments we've ran since identifying this issue). Here's the resource group task for the above failure:
Please provide the correlation id associated with your error or bug.
n/a - the deployment isn't happening, it's failing whilst validating the deployment.
What was the expected outcome?
The deployment should be validated and be submitted to ARM.
Relevant log output
Check previous GitHub issues
Code of Conduct
The text was updated successfully, but these errors were encountered: