forked from Azure/azure-cli
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[ARM] Az Deployments : Add support for --query-string (Azure#16447)
* Query string support * Try catch added for query_string * Improve error messages Co-authored-by: Dania Etienne <daetienn@microsoft.com>
- Loading branch information
1 parent
9601031
commit c66daef
Showing
7 changed files
with
378 additions
and
44 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
109 changes: 67 additions & 42 deletions
109
src/azure-cli/azure/cli/command_modules/resource/custom.py
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
98 changes: 98 additions & 0 deletions
98
...azure/cli/command_modules/resource/tests/latest/resource_group_level_linked_template.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,98 @@ | ||
{ | ||
"$schema": "https://schema.management.azure.com/schemas/2015-01-01/deploymentTemplate.json#", | ||
"contentVersion": "1.0.0.0", | ||
"parameters": { | ||
"projectName": { | ||
"type": "string", | ||
"minLength": 3, | ||
"maxLength": 11, | ||
"metadata": { | ||
"description": "Specify a project name that is used to generate resource names." | ||
} | ||
}, | ||
"location": { | ||
"type": "string", | ||
"defaultValue": "[resourceGroup().location]", | ||
"metadata": { | ||
"description": "Specify a location for the resources." | ||
} | ||
}, | ||
"linuxFxVersion": { | ||
"type": "string", | ||
"defaultValue": "php|7.0", | ||
"metadata": { | ||
"description": "The Runtime stack of current web app" | ||
} | ||
} | ||
}, | ||
"variables": { | ||
"storageAccountName": "[concat(parameters('projectName'), 'store')]", | ||
"webAppName": "[concat(parameters('projectName'), 'WebApp')]", | ||
"appServicePlanName": "[concat(parameters('projectName'), 'Plan')]" | ||
}, | ||
"resources": [ | ||
{ | ||
"name": "storage_account_linked_template", | ||
"type": "Microsoft.Resources/deployments", | ||
"apiVersion": "2020-10-01", | ||
"properties": { | ||
"mode": "Incremental", | ||
"templateLink": { | ||
"relativePath":"storage_account_linked_template.json", | ||
"contentVersion":"1.0.0.0" | ||
}, | ||
"parameters": { | ||
"storageAccountName": { | ||
"value": "[variables('storageAccountName')]" | ||
}, | ||
"location": { | ||
"value": "[parameters('location')]" | ||
} | ||
} | ||
} | ||
}, | ||
{ | ||
"type": "Microsoft.Web/serverfarms", | ||
"apiVersion": "2016-09-01", | ||
"name": "[variables('appServicePlanName')]", | ||
"location": "[parameters('location')]", | ||
"sku": { | ||
"name": "B1", | ||
"tier": "Basic", | ||
"size": "B1", | ||
"family": "B", | ||
"capacity": 1 | ||
}, | ||
"kind": "linux", | ||
"properties": { | ||
"perSiteScaling": false, | ||
"reserved": true, | ||
"targetWorkerCount": 0, | ||
"targetWorkerSizeId": 0 | ||
} | ||
}, | ||
{ | ||
"type": "Microsoft.Web/sites", | ||
"apiVersion": "2018-11-01", | ||
"name": "[variables('webAppName')]", | ||
"location": "[parameters('location')]", | ||
"dependsOn": [ | ||
"[resourceId('Microsoft.Web/serverfarms', variables('appServicePlanName'))]" | ||
], | ||
"kind": "app", | ||
"properties": { | ||
"serverFarmId": "[resourceId('Microsoft.Web/serverfarms', variables('appServicePlanName'))]", | ||
"siteConfig": { | ||
"linuxFxVersion": "[parameters('linuxFxVersion')]" | ||
} | ||
} | ||
} | ||
], | ||
"outputs": { | ||
"storageEndpoint": { | ||
"type": "object", | ||
"value": "[reference('storage_account_linked_template').outputs.storageEndpoint.value]" | ||
} | ||
} | ||
} | ||
|
57 changes: 57 additions & 0 deletions
57
...-cli/azure/cli/command_modules/resource/tests/latest/storage_account_linked_template.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,57 @@ | ||
{ | ||
"$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentTemplate.json#", | ||
"contentVersion": "1.0.0.0", | ||
"parameters": { | ||
"storageAccountName": { | ||
"type": "string", | ||
"metadata": { | ||
"description": "Specify the storage account name." | ||
} | ||
}, | ||
"location": { | ||
"type": "string", | ||
"metadata": { | ||
"description": "Specify a location for the resources." | ||
} | ||
}, | ||
"storageSKU": { | ||
"type": "string", | ||
"defaultValue": "Standard_LRS", | ||
"allowedValues": [ | ||
"Standard_LRS", | ||
"Standard_GRS", | ||
"Standard_RAGRS", | ||
"Standard_ZRS", | ||
"Premium_LRS", | ||
"Premium_ZRS", | ||
"Standard_GZRS", | ||
"Standard_RAGZRS" | ||
], | ||
"metadata": { | ||
"description": "Specify the storage account type." | ||
} | ||
} | ||
}, | ||
"resources": [ | ||
{ | ||
"type": "Microsoft.Storage/storageAccounts", | ||
"apiVersion": "2019-04-01", | ||
"name": "[parameters('storageAccountName')]", | ||
"location": "[parameters('location')]", | ||
"sku": { | ||
"name": "[parameters('storageSKU')]" | ||
}, | ||
"kind": "StorageV2", | ||
"properties": { | ||
"supportsHttpsTrafficOnly": true | ||
} | ||
} | ||
], | ||
"outputs": { | ||
"storageEndpoint": { | ||
"type": "object", | ||
"value": "[reference(parameters('storageAccountName')).primaryEndpoints]" | ||
} | ||
} | ||
} | ||
|
59 changes: 59 additions & 0 deletions
59
...i/azure/cli/command_modules/resource/tests/latest/subscription_level_linked_template.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,59 @@ | ||
{ | ||
"$schema": "https://schema.management.azure.com/schemas/2018-05-01/subscriptionDeploymentTemplate.json#", | ||
"contentVersion": "1.0.0.0", | ||
/* | ||
comment | ||
*/ | ||
"parameters": { | ||
"rgName": { | ||
"type": "string" | ||
}, | ||
"rgLocation": { | ||
"type": "string" | ||
}, | ||
"keyVaultName": { | ||
"type": "string" | ||
} | ||
}, | ||
"variables": {}, | ||
"resources": [ | ||
{ | ||
"type": "Microsoft.Resources/deployments", | ||
"apiVersion": "2020-10-01", | ||
"name": "deploymentRg", | ||
"location": "[parameters('rgLocation')]", | ||
"properties": { | ||
"mode": "Incremental", | ||
"templateLink": { | ||
"relativePath":"createResourceGroup.json", | ||
"contentVersion":"1.0.0.0" | ||
}, | ||
"parameters": { | ||
"rgName":{"value": "[parameters('rgName')]"}, | ||
"rgLocation":{"value": "[parameters('rgLocation')]"} | ||
} | ||
} | ||
}, | ||
{ | ||
"type": "Microsoft.Resources/deployments", | ||
"apiVersion": "2020-10-01", | ||
"name": "keyVaultAndSecret", | ||
"resourceGroup": "[parameters('rgName')]", | ||
"dependsOn": [ | ||
"deploymentRg" | ||
], | ||
"properties": { | ||
"mode": "Incremental", | ||
"templateLink": { | ||
"relativePath":"createKeyVaultWithSecret.json", | ||
"contentVersion":"1.0.0.0" | ||
}, | ||
"parameters": { | ||
"keyVaultName":{"value": "[parameters('keyVaultName')]"} | ||
} | ||
} | ||
} | ||
], | ||
"outputs": {} | ||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters