{ARM} Hotfix: Fix KeyError with template spec API version 2021-03-01-preview#17893
{ARM} Hotfix: Fix KeyError with template spec API version 2021-03-01-preview#17893wiebeck wants to merge 1 commit intoAzure:releasefrom wiebeck:template_spec_main_template
Conversation
|
Thank you for your contribution wiebeck! We will review the pull request and get back to you soon. |
|
This is not the proper fix for this. I was able to repro this issue (see discussion) and the key points to notice from the --debug output are : A. { Request URL: 'https://management.azure.com/subscriptions/a1bfa635-f2bf-42f1-86b5-848c674fc321/providers/Microsoft.Resources?api-version=2020-10-01' } Azure CLI currently points to Microsoft.Resources version 2020-10-01 and Template Specs 2019-06-01-preview. It looks this PR: This has caused a regression in Azure CLI. The code is CLI has not been updated for 2021-03-01 preview which has a few breaking changes for template specs; most notably the 'template' property has been replaced by 'main_template'. As a result the code in the CLI attempts to retrieve the 'template' property from the --template-spec input and fails. Although the TemplateSpecs API will be update for CLI when a proper SDK release for Python is done (https://github.com/Azure/sdk-release-request/issues/1469) , (ref: https://github.com/Azure/azure-cli/pull/17869/files) in the meantime I will send a fix for this and notify swagger team of the issue so they may prevent it in the future. |
|
Please review #17896 for fix. |
|
Hi @detienne20. Thanks for taking a look. I was hoping for someone more into it to take a look at my PR. Although yours is basically the same thing except for the |
Description
Deploying template specs currently does not work. The API version
2021-03-01-previewreturns a template spec withmainTemplateas part ofpropertieswhile the code insrc/azure-cli/azure/cli/command_modules/resource/custom.pytries to access keytemplatewhich has been the name of the key in API version2019-06-01-preview.This PR fixes #17733
The code contains other places where dict key
templateis being referenced but I am unsure whether this plays a role for this particular case (deploy a template spec version).Testing Guide
See #17733 for a detailed explanation, especially this comment by @tonystz.
This checklist is used to make sure that common guidelines for a pull request are followed.
The PR title and description has followed the guideline in Submitting Pull Requests.
I adhere to the Command Guidelines.
I adhere to the Error Handling Guidelines.