1
votes

I have a JSON ARM template that I want to use in VSTS Release Management to create my App Service Plan environment for me. I'd like VSTS to use the App service plan name (and resource group if possible) instead of hardcoding a string into the web UI.

I'd like to use the parameter 'hostingPlanName' from my website.json file and put it in the release management UI. Is it possible to do so or is this a feature request?

enter image description here

website.json now has: "variables": { "webSiteName": "[parameters('webAppName')]", "hostingPlanName": "[parameters('hostingPlanName')]" }, "resources": [ { "apiVersion": "2015-08-01", "name": "[parameters('hostingPlanName')]",...

website.test.parameters.json

{ "$schema": "https://schema.management.azure.com/schemas/2015-01-01/deploymentParameters.json#", "contentVersion": "1.0.0.0", "parameters": { "hostingPlanName": { "value": "X-test-plan" }, "webAppName": { "value": "X-test-web" } } }

2

2 Answers

1
votes

No, RM doesn't read the values from JSON. Alternatively, you can define them as variables in the Release Definition environment and use it in the App Service Task.

1
votes

To override the parameter values defined in the website.parameters.json file, please refer to the steps (from Step 33 to Step 36) in this document: https://github.com/Microsoft/VisualStudio2017Launch_KeynoteDemos/tree/master/VSTS%20and%20DevOps.

You need to choose the website.json and website.parameters.json file in the Azure Resource Group Deployment step. Set Override template parameters like this:

-webAppName $(webApp) -hostingPlanName $(hostingPlan)

Then create 2 release variables in your release definition named $(webApp) and $(hostingPlan). Give the values that you want to use in release to the 2 variables.