-
Notifications
You must be signed in to change notification settings - Fork 3k
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
2.3.0: Breaking changes to template deployments when using --template-uri #12890
Comments
add to S169 |
Also reported at in #12990. (just cross linking for folks that might be following one but not the other) |
This was in 169. Does this mean that it's going to be delayed? azbb (from p&p team) is broken until this is fixed. Feel free to follow up with me on Teams if there are questions, @yonzhan. This is also not a feature request, it's a breaking change that's impacting customers. |
@ckittel Thanks to bring it out. We will plan it in this Sprint with high priority. |
Thank you @yonzhan -- there are becoming more and more reports of this. Basically anyone using az cli to do template uri-based deployments where the templates use the |
@noelbundick @ckittel Hi, this is the same problem as #13317, and I have submitted a PR #13344 to fix it~ You can track the progress of the problem through this PR. |
Describe the bug
Starting with azure-cli 2.3.0, the default behavior has been updated to process extended JSON syntax.
Previously, a template deployed with
--template-uri
would be executed with thetemplateLink
property set. At runtime,[deployment().properties.templateLink.uri]
would be accessibleWith the new behavior, the CLI will download the template from the remote host, preprocess it, then PUT a deployment with
template
set. At runtime,[deployment().properties.templateLink.uri]
is not accessible.This appears to be an undocumented breaking change and causes my templates to fail
The following test recording was last run in Dec 2019. I believe if re-run today, this would demonstrate different results showing a PUT with the full template rather than the templateUri: https://github.com/Azure/azure-cli/blob/991cb7cc7c9e577d8bec3b78e0316dfb5d39fe10/src/azure-cli/azure/cli/command_modules/resource/tests/latest/recordings/test_group_deployment_thru_uri.yaml
Command Name
az deployment group create
Errors:
Template deploys successfully.
[deployment().properties.templateLink]
does not existTo Reproduce:
az group create -n test1 -l westus2
az deployment group create -g test1 --template-uri https://gist.githubusercontent.com/noelbundick/2a599b3954c9c4e47754151f138d942a/raw/45e64f07f4c82462ebcb09c6bd083ae01c3e4d3c/azuredeploy.json
Expected Behavior
[deployment().properties.templateLink]
is available per the previous behavior and documentation (https://docs.microsoft.com/en-us/azure/azure-resource-manager/templates/template-functions-deployment#deployment)Environment Summary
Additional Context
I have a sample zero resource template here that demonstrates the issue: https://gist.github.com/noelbundick/2a599b3954c9c4e47754151f138d942a
Works (2.2.0):
docker run --rm -it -v /home/$USER/.azure:/root/.azure mcr.microsoft.com/azure-cli:2.2.0 bash az deployment group create -g test1 --template-uri https://gist.githubusercontent.com/noelbundick/2a599b3954c9c4e47754151f138d942a/raw/45e64f07f4c82462ebcb09c6bd083ae01c3e4d3c/azuredeploy.json
Fails (2.3.0):
docker run --rm -it -v /home/$USER/.azure:/root/.azure mcr.microsoft.com/azure-cli:2.3.0 bash az deployment group create -g test1 --template-uri https://gist.githubusercontent.com/noelbundick/2a599b3954c9c4e47754151f138d942a/raw/45e64f07f4c82462ebcb09c6bd083ae01c3e4d3c/azuredeploy.json
I found these links relevant while investigating
--template-uri
:azure-cli/src/azure-cli/azure/cli/command_modules/resource/custom.py
Line 280 in a792aaa
azure-cli/src/azure-cli/azure/cli/command_modules/resource/custom.py
Line 373 in a792aaa
cc: @alex-frankel
The text was updated successfully, but these errors were encountered: