From a5df67e09092954822e77d4f8a6ee800bbbf388a Mon Sep 17 00:00:00 2001 From: Erik Parmann Date: Mon, 1 Jun 2020 20:29:56 +0200 Subject: [PATCH 1/8] Create webapp from arm template automatically --- .pipelines/diabetes_regression-cd.yml | 26 +++++ .pipelines/diabetes_regression-ci.yml | 2 +- ...etes_regression-package-model-template.yml | 3 + docs/getting_started.md | 4 +- .../arm-templates/aci-password.json | 30 +++++ .../arm-templates/webapp-env.json | 106 ++++++++++++++++++ 6 files changed, 167 insertions(+), 4 deletions(-) create mode 100644 environment_setup/arm-templates/aci-password.json create mode 100644 environment_setup/arm-templates/webapp-env.json diff --git a/.pipelines/diabetes_regression-cd.yml b/.pipelines/diabetes_regression-cd.yml index 8dd35e47..101d0901 100644 --- a/.pipelines/diabetes_regression-cd.yml +++ b/.pipelines/diabetes_regression-cd.yml @@ -142,6 +142,32 @@ stages: condaFilePath: '$(Build.SourcesDirectory)/$(SOURCES_DIR_TRAIN)/conda_dependencies.yml' - script: echo $(IMAGE_LOCATION) >image_location.txt displayName: "Write image location file" + + - task: AzureResourceGroupDeployment@2 + inputs: + azureSubscription: '$(AZURE_RM_SVC_CONNECTION)' + action: 'Create Or Update Resource Group' + resourceGroupName: '$(RESOURCE_GROUP)' + location: $(LOCATION) + templateLocation: 'Linked artifact' + csmFile: '$(Build.SourcesDirectory)/environment_setup/arm-templates/aci-password.json' + overrideParameters: '-baseName $(BASE_NAME)' + deploymentMode: 'Incremental' + deploymentOutputs: 'ACRCREDENTIALS' + displayName: 'Get ACR username and password' + + - task: AzureResourceGroupDeployment@2 + inputs: + azureSubscription: '$(AZURE_RM_SVC_CONNECTION)' + action: 'Create Or Update Resource Group' + resourceGroupName: '$(RESOURCE_GROUP)' + location: $(LOCATION) + templateLocation: 'Linked artifact' + csmFile: '$(Build.SourcesDirectory)/environment_setup/arm-templates/webapp-env.json' + overrideParameters: '-baseName $(BASE_NAME) -location $(LOCATION) -imagelocation $(IMAGE_TAGGED) -acrcredentials $(ACRCREDENTIALS)' + deploymentMode: 'Incremental' + displayName: 'Create webapp' + - task: AzureWebAppContainer@1 name: WebAppDeploy displayName: 'Azure Web App on Container Deploy' diff --git a/.pipelines/diabetes_regression-ci.yml b/.pipelines/diabetes_regression-ci.yml index 5a539af0..0d0eaa31 100644 --- a/.pipelines/diabetes_regression-ci.yml +++ b/.pipelines/diabetes_regression-ci.yml @@ -94,4 +94,4 @@ stages: container: mlops timeoutInMinutes: 0 steps: - - template: diabetes_regression-publish-model-artifact-template.yml + - template: diabetes_regression-publish-model-artifact-template.yml \ No newline at end of file diff --git a/.pipelines/diabetes_regression-package-model-template.yml b/.pipelines/diabetes_regression-package-model-template.yml index 7725b19c..c3ccc4f2 100644 --- a/.pipelines/diabetes_regression-package-model-template.yml +++ b/.pipelines/diabetes_regression-package-model-template.yml @@ -40,3 +40,6 @@ steps: # Set environment variable using the last line of logs that has the package location IMAGE_LOCATION=$(tail -n 1 image_logs.txt) echo "##vso[task.setvariable variable=IMAGE_LOCATION]$IMAGE_LOCATION" + echo $IMAGE_LOCATION > image_location.txt + IMAGE_TAGGED="$(sed 's/@sha256.*/:latest/g' image_location.txt)" + echo "##vso[task.setvariable variable=IMAGE_TAGGED]$IMAGE_TAGGED" diff --git a/docs/getting_started.md b/docs/getting_started.md index 629e0dc2..2ce77ade 100644 --- a/docs/getting_started.md +++ b/docs/getting_started.md @@ -349,9 +349,7 @@ Delete the **ACI_DEPLOYMENT_NAME** variable. The pipeline uses the [Create Image Script](../ml_service/util/create_scoring_image.py) to create a scoring image. The image will be registered under an Azure Container Registry instance that belongs to the Azure Machine Learning Service. Any dependencies that the scoring file depends on can also be packaged with the container with an image config. Learn more about how to create a container using the Azure ML SDK with the [Image class](https://docs.microsoft.com/en-us/python/api/azureml-core/azureml.core.image.image.image?view=azure-ml-py#create-workspace--name--models--image-config-) API documentation. -Make sure your webapp has the credentials to pull the image from the Azure Container Registry created by the Infrastructure as Code pipeline. Instructions can be found on the [Configure registry credentials in web app](https://docs.microsoft.com/en-us/azure/devops/pipelines/targets/webapp-on-container-linux?view=azure-devops&tabs=dotnet-core%2Cyaml#configure-registry-credentials-in-web-app) page. You'll need to run the pipeline once (including the Deploy to Webapp stage up to the `Create scoring image` step) so an image is present in the registry. After that, you can connect the Webapp to the Azure Container Registry in the Azure Portal. - -![build](./images/multi-stage-webapp.png) +The pipeline should create the webapp automatically the first time it is run with **WEBAPP_DEPLOYMENT_NAME** set. ### Example pipelines using R diff --git a/environment_setup/arm-templates/aci-password.json b/environment_setup/arm-templates/aci-password.json new file mode 100644 index 00000000..aa12de32 --- /dev/null +++ b/environment_setup/arm-templates/aci-password.json @@ -0,0 +1,30 @@ +{ + "$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentTemplate.json#", + "contentVersion": "1.0.0.0", + "parameters": { + "baseName": { + "type": "string", + "maxLength": 10, + "minLength": 3, + "metadata": { + "description": "The base name to use as prefix to create all the resources." + } + }, + "acr": { + "type": "string", + "defaultValue": "[concat(toLower(parameters('baseName')),'amlcr')]" + } + }, + "resources": [] + , "outputs": { + "password": { + "type": "string", + "value": "[listCredentials(resourceId('myResourceGroup','Microsoft.ContainerRegistry/registries',parameters('acr')),'2019-05-01').passwords[1].value]" + }, + "username": { + "type": "string", + "value": "[listCredentials(resourceId('Microsoft.ContainerRegistry/registries',parameters('acr')),'2019-05-01').username]" + } + } + + } diff --git a/environment_setup/arm-templates/webapp-env.json b/environment_setup/arm-templates/webapp-env.json new file mode 100644 index 00000000..2915ba57 --- /dev/null +++ b/environment_setup/arm-templates/webapp-env.json @@ -0,0 +1,106 @@ +{ + "$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentTemplate.json#", + "contentVersion": "1.0.0.0", + "parameters": { + "imagelocation":{ + "type": "string" + }, + "acrcredentials": { + "type": "secureObject" + }, + "baseName": { + "type": "string", + "maxLength": 10, + "minLength": 3, + "metadata": { + "description": "The base name to use as prefix to create all the resources." + } + }, + "location": { + "type": "string", + "defaultValue": "eastus", + "allowedValues": [ + "eastus", + "eastus2", + "southcentralus", + "southeastasia", + "westcentralus", + "westeurope", + "westus2", + "centralus" + ], + "metadata": { + "description": "Specifies the location for all resources." + } + }, + "acr": { + "type": "string", + "defaultValue": "[concat(toLower(parameters('baseName')),'amlcr')]" + }, + "webAppName": { + "type": "string", + "defaultValue" : "[concat(toLower(parameters('baseName')),'webapp')]", + "metadata": { + "description": "Base name of the resource such as web app name and app service plan " + }, + "minLength": 2 + } + }, + "variables": { + "containerRegistryName": "[parameters('acr')]", + "webAppPortalName": "[concat(parameters('webAppName'), '-webapp')]", + "appServicePlanName": "[concat('AppServicePlan-', parameters('webAppName'))]" + + }, + "resources": [ + { + "type": "Microsoft.Web/serverfarms", + "apiVersion": "2018-02-01", + "name": "[variables('appServicePlanName')]", + "location": "[parameters('location')]", + "sku": { + "name": "S1" + }, + "kind": "linux", + "properties":{ + "reserved":true, + "maximumElasticWorkerCount": 5 + } + }, + { + "type": "Microsoft.Web/sites", + "apiVersion": "2018-11-01", + "name": "[variables('webAppPortalName')]", + "location": "[parameters('location')]", + "kind": "app,linux,container", + "dependsOn": [ + "[resourceId('Microsoft.Web/serverfarms', variables('appServicePlanName'))]" + ], + "properties": { + "serverFarmId": "[resourceId('Microsoft.Web/serverfarms', variables('appServicePlanName'))]", + "httpsOnly": true, + "siteConfig": { + "linuxFxVersion": "[concat('DOCKER|', parameters('imagelocation'))]", + "appSettings": [ + { + "name": "WEBSITES_ENABLE_APP_SERVICE_STORAGE", + "value": "false" + }, + { + "name": "DOCKER_REGISTRY_SERVER_URL", + "value": "[concat('https://', variables('containerRegistryName'), '.azurecr.io')]" + }, + { + "name": "DOCKER_REGISTRY_SERVER_USERNAME", + "value": "[parameters('acrcredentials').username.value]" + }, + { + "name": "DOCKER_REGISTRY_SERVER_PASSWORD", + "value": "[parameters('acrcredentials').password.value]" + } + ] + } + } + } + ] + } From 107c83d70fd6e1907d29480fed07f6d72e34038e Mon Sep 17 00:00:00 2001 From: Erik Parmann Date: Tue, 2 Jun 2020 22:42:57 +0200 Subject: [PATCH 2/8] Remove dangling reference to myResourceGroup --- environment_setup/arm-templates/aci-password.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/environment_setup/arm-templates/aci-password.json b/environment_setup/arm-templates/aci-password.json index aa12de32..51c40762 100644 --- a/environment_setup/arm-templates/aci-password.json +++ b/environment_setup/arm-templates/aci-password.json @@ -19,7 +19,7 @@ , "outputs": { "password": { "type": "string", - "value": "[listCredentials(resourceId('myResourceGroup','Microsoft.ContainerRegistry/registries',parameters('acr')),'2019-05-01').passwords[1].value]" + "value": "[listCredentials(resourceId('Microsoft.ContainerRegistry/registries',parameters('acr')),'2019-05-01').passwords[1].value]" }, "username": { "type": "string", From c5185e26d2ab695bf307c5275363716612e20393 Mon Sep 17 00:00:00 2001 From: Erik Parmann Date: Wed, 8 Jul 2020 09:27:16 +0200 Subject: [PATCH 3/8] Use az cli to fetch ACI username/password --- .pipelines/diabetes_regression-cd.yml | 24 ++- .pipelines/diabetes_regression-ci.yml | 2 +- .../arm-templates/aci-password.json | 30 --- .../arm-templates/webapp-env.json | 201 +++++++++--------- 4 files changed, 116 insertions(+), 141 deletions(-) delete mode 100644 environment_setup/arm-templates/aci-password.json diff --git a/.pipelines/diabetes_regression-cd.yml b/.pipelines/diabetes_regression-cd.yml index 101d0901..fa7cfb06 100644 --- a/.pipelines/diabetes_regression-cd.yml +++ b/.pipelines/diabetes_regression-cd.yml @@ -143,18 +143,20 @@ stages: - script: echo $(IMAGE_LOCATION) >image_location.txt displayName: "Write image location file" - - task: AzureResourceGroupDeployment@2 + - task: AzureCLI@2 + displayName: 'Get ACR username and password' + continueOnError: false inputs: azureSubscription: '$(AZURE_RM_SVC_CONNECTION)' - action: 'Create Or Update Resource Group' - resourceGroupName: '$(RESOURCE_GROUP)' - location: $(LOCATION) - templateLocation: 'Linked artifact' - csmFile: '$(Build.SourcesDirectory)/environment_setup/arm-templates/aci-password.json' - overrideParameters: '-baseName $(BASE_NAME)' - deploymentMode: 'Incremental' - deploymentOutputs: 'ACRCREDENTIALS' - displayName: 'Get ACR username and password' + scriptLocation: inlineScript + scriptType: 'bash' + inlineScript: | + export acr_password=`az acr credential show -n $(ACR_NAME) --query passwords[0].value -g $(RESOURCE_GROUP)` + export acr_username=`az acr credential show -n $(ACR_NAME) --query username -g $(RESOURCE_GROUP)` + echo "Got username: " + echo $acr_username + echo "##vso[task.setvariable variable=acr_password]$acr_password" + echo "##vso[task.setvariable variable=acr_username]$acr_username" - task: AzureResourceGroupDeployment@2 inputs: @@ -164,7 +166,7 @@ stages: location: $(LOCATION) templateLocation: 'Linked artifact' csmFile: '$(Build.SourcesDirectory)/environment_setup/arm-templates/webapp-env.json' - overrideParameters: '-baseName $(BASE_NAME) -location $(LOCATION) -imagelocation $(IMAGE_TAGGED) -acrcredentials $(ACRCREDENTIALS)' + overrideParameters: '-baseName $(BASE_NAME) -location $(LOCATION) -imagelocation $(IMAGE_TAGGED) -acr_password $(acr_password) -acr_username $(acr_username)' deploymentMode: 'Incremental' displayName: 'Create webapp' diff --git a/.pipelines/diabetes_regression-ci.yml b/.pipelines/diabetes_regression-ci.yml index 0d0eaa31..5a539af0 100644 --- a/.pipelines/diabetes_regression-ci.yml +++ b/.pipelines/diabetes_regression-ci.yml @@ -94,4 +94,4 @@ stages: container: mlops timeoutInMinutes: 0 steps: - - template: diabetes_regression-publish-model-artifact-template.yml \ No newline at end of file + - template: diabetes_regression-publish-model-artifact-template.yml diff --git a/environment_setup/arm-templates/aci-password.json b/environment_setup/arm-templates/aci-password.json deleted file mode 100644 index 51c40762..00000000 --- a/environment_setup/arm-templates/aci-password.json +++ /dev/null @@ -1,30 +0,0 @@ -{ - "$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentTemplate.json#", - "contentVersion": "1.0.0.0", - "parameters": { - "baseName": { - "type": "string", - "maxLength": 10, - "minLength": 3, - "metadata": { - "description": "The base name to use as prefix to create all the resources." - } - }, - "acr": { - "type": "string", - "defaultValue": "[concat(toLower(parameters('baseName')),'amlcr')]" - } - }, - "resources": [] - , "outputs": { - "password": { - "type": "string", - "value": "[listCredentials(resourceId('Microsoft.ContainerRegistry/registries',parameters('acr')),'2019-05-01').passwords[1].value]" - }, - "username": { - "type": "string", - "value": "[listCredentials(resourceId('Microsoft.ContainerRegistry/registries',parameters('acr')),'2019-05-01').username]" - } - } - - } diff --git a/environment_setup/arm-templates/webapp-env.json b/environment_setup/arm-templates/webapp-env.json index 2915ba57..60779a8e 100644 --- a/environment_setup/arm-templates/webapp-env.json +++ b/environment_setup/arm-templates/webapp-env.json @@ -1,106 +1,109 @@ { - "$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentTemplate.json#", - "contentVersion": "1.0.0.0", - "parameters": { - "imagelocation":{ - "type": "string" - }, - "acrcredentials": { - "type": "secureObject" - }, - "baseName": { - "type": "string", - "maxLength": 10, - "minLength": 3, - "metadata": { - "description": "The base name to use as prefix to create all the resources." - } - }, - "location": { - "type": "string", - "defaultValue": "eastus", - "allowedValues": [ - "eastus", - "eastus2", - "southcentralus", - "southeastasia", - "westcentralus", - "westeurope", - "westus2", - "centralus" - ], - "metadata": { - "description": "Specifies the location for all resources." - } - }, - "acr": { - "type": "string", - "defaultValue": "[concat(toLower(parameters('baseName')),'amlcr')]" - }, - "webAppName": { - "type": "string", - "defaultValue" : "[concat(toLower(parameters('baseName')),'webapp')]", - "metadata": { - "description": "Base name of the resource such as web app name and app service plan " - }, - "minLength": 2 + "$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentTemplate.json#", + "contentVersion": "1.0.0.0", + "parameters": { + "imagelocation": { + "type": "string" + }, + "acr_username": { + "type": "string" + }, + "acr_password": { + "type": "secureString" + }, + "baseName": { + "type": "string", + "maxLength": 10, + "minLength": 3, + "metadata": { + "description": "The base name to use as prefix to create all the resources." + } + }, + "location": { + "type": "string", + "defaultValue": "eastus", + "allowedValues": [ + "eastus", + "eastus2", + "southcentralus", + "southeastasia", + "westcentralus", + "westeurope", + "westus2", + "centralus" + ], + "metadata": { + "description": "Specifies the location for all resources." } }, - "variables": { - "containerRegistryName": "[parameters('acr')]", - "webAppPortalName": "[concat(parameters('webAppName'), '-webapp')]", - "appServicePlanName": "[concat('AppServicePlan-', parameters('webAppName'))]" - + "acr": { + "type": "string", + "defaultValue": "[concat(toLower(parameters('baseName')),'amlcr')]" }, - "resources": [ - { - "type": "Microsoft.Web/serverfarms", - "apiVersion": "2018-02-01", - "name": "[variables('appServicePlanName')]", - "location": "[parameters('location')]", - "sku": { - "name": "S1" - }, - "kind": "linux", - "properties":{ - "reserved":true, - "maximumElasticWorkerCount": 5 - } + "webAppName": { + "type": "string", + "defaultValue": "[concat(toLower(parameters('baseName')),'webapp')]", + "metadata": { + "description": "Base name of the resource such as web app name and app service plan " }, - { - "type": "Microsoft.Web/sites", - "apiVersion": "2018-11-01", - "name": "[variables('webAppPortalName')]", - "location": "[parameters('location')]", - "kind": "app,linux,container", - "dependsOn": [ - "[resourceId('Microsoft.Web/serverfarms', variables('appServicePlanName'))]" - ], - "properties": { - "serverFarmId": "[resourceId('Microsoft.Web/serverfarms', variables('appServicePlanName'))]", - "httpsOnly": true, - "siteConfig": { - "linuxFxVersion": "[concat('DOCKER|', parameters('imagelocation'))]", - "appSettings": [ - { - "name": "WEBSITES_ENABLE_APP_SERVICE_STORAGE", - "value": "false" - }, - { - "name": "DOCKER_REGISTRY_SERVER_URL", - "value": "[concat('https://', variables('containerRegistryName'), '.azurecr.io')]" - }, - { - "name": "DOCKER_REGISTRY_SERVER_USERNAME", - "value": "[parameters('acrcredentials').username.value]" - }, - { - "name": "DOCKER_REGISTRY_SERVER_PASSWORD", - "value": "[parameters('acrcredentials').password.value]" - } - ] + "minLength": 2 + } + }, + "variables": { + "containerRegistryName": "[parameters('acr')]", + "webAppPortalName": "[concat(parameters('webAppName'), '-webapp')]", + "appServicePlanName": "[concat('AppServicePlan-', parameters('webAppName'))]" + + }, + "resources": [ + { + "type": "Microsoft.Web/serverfarms", + "apiVersion": "2018-02-01", + "name": "[variables('appServicePlanName')]", + "location": "[parameters('location')]", + "sku": { + "name": "S1" + }, + "kind": "linux", + "properties": { + "reserved": true, + "maximumElasticWorkerCount": 5 + } + }, + { + "type": "Microsoft.Web/sites", + "apiVersion": "2018-11-01", + "name": "[variables('webAppPortalName')]", + "location": "[parameters('location')]", + "kind": "app,linux,container", + "dependsOn": [ + "[resourceId('Microsoft.Web/serverfarms', variables('appServicePlanName'))]" + ], + "properties": { + "serverFarmId": "[resourceId('Microsoft.Web/serverfarms', variables('appServicePlanName'))]", + "httpsOnly": true, + "siteConfig": { + "linuxFxVersion": "[concat('DOCKER|', parameters('imagelocation'))]", + "appSettings": [ + { + "name": "WEBSITES_ENABLE_APP_SERVICE_STORAGE", + "value": "false" + }, + { + "name": "DOCKER_REGISTRY_SERVER_URL", + "value": "[concat('https://', variables('containerRegistryName'), '.azurecr.io')]" + }, + { + "name": "DOCKER_REGISTRY_SERVER_USERNAME", + "value": "[parameters('acr_username')]" + }, + { + "name": "DOCKER_REGISTRY_SERVER_PASSWORD", + "value": "[parameters('acr_password')]" } + ] } - } - ] - } + } + } + ] +} From fd3549ae0e1bab49410072911f57db33a9838272 Mon Sep 17 00:00:00 2001 From: Erik Parmann Date: Wed, 8 Jul 2020 09:57:22 +0200 Subject: [PATCH 4/8] Add ACR_NAME variable --- .pipelines/diabetes_regression-cd.yml | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/.pipelines/diabetes_regression-cd.yml b/.pipelines/diabetes_regression-cd.yml index fa7cfb06..8dc16c2f 100644 --- a/.pipelines/diabetes_regression-cd.yml +++ b/.pipelines/diabetes_regression-cd.yml @@ -26,6 +26,8 @@ resources: variables: - template: diabetes_regression-variables-template.yml - group: devopsforai-aml-vg +- name: "ACR_NAME" + value: "$(BASE_NAME)amlcr" stages: - stage: 'Deploy_ACI' @@ -152,7 +154,7 @@ stages: scriptType: 'bash' inlineScript: | export acr_password=`az acr credential show -n $(ACR_NAME) --query passwords[0].value -g $(RESOURCE_GROUP)` - export acr_username=`az acr credential show -n $(ACR_NAME) --query username -g $(RESOURCE_GROUP)` + export acr_username=`az acr credential show -n $(ACR_NAME) --query username -g $(RESOURCE_GROUP)` echo "Got username: " echo $acr_username echo "##vso[task.setvariable variable=acr_password]$acr_password" @@ -166,7 +168,7 @@ stages: location: $(LOCATION) templateLocation: 'Linked artifact' csmFile: '$(Build.SourcesDirectory)/environment_setup/arm-templates/webapp-env.json' - overrideParameters: '-baseName $(BASE_NAME) -location $(LOCATION) -imagelocation $(IMAGE_TAGGED) -acr_password $(acr_password) -acr_username $(acr_username)' + overrideParameters: '-baseName $(BASE_NAME) -location $(LOCATION) -imagelocation $(IMAGE_TAGGED) -acr $(ACR_NAME) -acr_password $(acr_password) -acr_username $(acr_username)' deploymentMode: 'Incremental' displayName: 'Create webapp' From 994ae93d261ddfb5dd1585bdb1d4e05487bc0b29 Mon Sep 17 00:00:00 2001 From: Erik Parmann Date: Wed, 8 Jul 2020 10:08:36 +0200 Subject: [PATCH 5/8] Remove location restriction in webapp arm --- environment_setup/arm-templates/webapp-env.json | 11 ----------- 1 file changed, 11 deletions(-) diff --git a/environment_setup/arm-templates/webapp-env.json b/environment_setup/arm-templates/webapp-env.json index 60779a8e..e0d91d0e 100644 --- a/environment_setup/arm-templates/webapp-env.json +++ b/environment_setup/arm-templates/webapp-env.json @@ -21,17 +21,6 @@ }, "location": { "type": "string", - "defaultValue": "eastus", - "allowedValues": [ - "eastus", - "eastus2", - "southcentralus", - "southeastasia", - "westcentralus", - "westeurope", - "westus2", - "centralus" - ], "metadata": { "description": "Specifies the location for all resources." } From 5748809aee0a35e28d4cef6a25b5936ff105a9dc Mon Sep 17 00:00:00 2001 From: Erik Parmann Date: Wed, 8 Jul 2020 10:09:03 +0200 Subject: [PATCH 6/8] Parameterize SKU in webapp arm --- environment_setup/arm-templates/webapp-env.json | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/environment_setup/arm-templates/webapp-env.json b/environment_setup/arm-templates/webapp-env.json index e0d91d0e..6e38d999 100644 --- a/environment_setup/arm-templates/webapp-env.json +++ b/environment_setup/arm-templates/webapp-env.json @@ -36,6 +36,13 @@ "description": "Base name of the resource such as web app name and app service plan " }, "minLength": 2 + }, + "sku": { + "type": "string", + "metadata": { + "description": "SKU for the app service plan" + }, + "defaultValue": "S1" } }, "variables": { @@ -51,7 +58,7 @@ "name": "[variables('appServicePlanName')]", "location": "[parameters('location')]", "sku": { - "name": "S1" + "name": "[parameters('sku')]" }, "kind": "linux", "properties": { From 082db54df1b2be997342d097cdbd83b5ad9ab73c Mon Sep 17 00:00:00 2001 From: Erik Parmann Date: Wed, 8 Jul 2020 10:09:41 +0200 Subject: [PATCH 7/8] Cleanup comment in webapp arm --- environment_setup/arm-templates/webapp-env.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/environment_setup/arm-templates/webapp-env.json b/environment_setup/arm-templates/webapp-env.json index 6e38d999..2b534b88 100644 --- a/environment_setup/arm-templates/webapp-env.json +++ b/environment_setup/arm-templates/webapp-env.json @@ -33,7 +33,7 @@ "type": "string", "defaultValue": "[concat(toLower(parameters('baseName')),'webapp')]", "metadata": { - "description": "Base name of the resource such as web app name and app service plan " + "description": "Base name of the web app name and app service plan" }, "minLength": 2 }, From 44b4a6efd7bacce9f0fce8ee33a6d8f68bd1be94 Mon Sep 17 00:00:00 2001 From: Erik Parmann Date: Wed, 8 Jul 2020 10:10:00 +0200 Subject: [PATCH 8/8] Cleanup variables in webapp arm --- environment_setup/arm-templates/webapp-env.json | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/environment_setup/arm-templates/webapp-env.json b/environment_setup/arm-templates/webapp-env.json index 2b534b88..67736b30 100644 --- a/environment_setup/arm-templates/webapp-env.json +++ b/environment_setup/arm-templates/webapp-env.json @@ -46,9 +46,8 @@ } }, "variables": { - "containerRegistryName": "[parameters('acr')]", "webAppPortalName": "[concat(parameters('webAppName'), '-webapp')]", - "appServicePlanName": "[concat('AppServicePlan-', parameters('webAppName'))]" + "appServicePlanName": "[concat(parameters('webAppName'),'AppServicePlan')]" }, "resources": [ @@ -87,7 +86,7 @@ }, { "name": "DOCKER_REGISTRY_SERVER_URL", - "value": "[concat('https://', variables('containerRegistryName'), '.azurecr.io')]" + "value": "[concat('https://', parameters('acr'), '.azurecr.io')]" }, { "name": "DOCKER_REGISTRY_SERVER_USERNAME",