[ARM] Az Deployments : Add support for --query-string #16447
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Closed : #16400
Description
Az deployments now supports --query-string to be used with --template-uri for linked template deployments; --query-string is a SAS token for a storage container that contains the main template and linked template(s). Support for the --query-string parameter will facilitate the transition to template specs. Like with template specs linked templates are referenced through the relative path field in template link as illustrated below:
Testing Guide
Create storage account container and upload files for deployment.
az storage account create -n {} -g {} -l {} --sku {} --kind {}
az storage container create -n {} --account-name {}
az storage blob upload -c {} -f "{}" -n {} --account-name {}
Generate an SAS token for the entire container (query-string parameter)
az storage container generate-sas --account-name {} --account-key {} --name {} --permissions dlrw --expiry {}
Generate the url for the main template (template-uri parameter)
az storage blob url -c {} -n {} --account-name {}
Deploy with --template-uri and --query-string parameter.
az deployment group create -g {} --template-uri {blob_url} --query-string "{sas_token}"
az deployment sub create -g {} --template-uri {blob_url} --query-string "{sas_token}"
az deployment mg validate -g {} --template-uri {blob_url} --query-string "{sas_token}"
az deployment tenant validate -g {} --template-uri {blob_url} --query-string "{sas_token}"