Skip to content
This repository was archived by the owner on Dec 4, 2023. It is now read-only.

Commit f624b56

Browse files
authored
Updated ARM templates for "deployment sub create" support (#944)
1 parent f6b4e19 commit f624b56

File tree

32 files changed

+228
-157
lines changed

32 files changed

+228
-157
lines changed

samples/02.echo-bot/README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -54,10 +54,10 @@ Record the `appid` from the returned JSON
5454
Replace the values for `<appid>`, `<appsecret>`, `<botname>`, and `<groupname>` in the following commands:
5555

5656
#### To a new Resource Group
57-
`az deployment create --name "echoBotDeploy" --location "westus" --template-file ".\deploymentTemplates\template-with-new-rg.json" --parameters groupName="<groupname>" botId="<botname>" appId="<appid>" appSecret="<appsecret>"`
57+
`az deployment sub create --name "echoBotDeploy" --location "westus" --template-file ".\deploymentTemplates\template-with-new-rg.json" --parameters groupName="<groupname>" botId="<botname>" appId="<appid>" appSecret="<appsecret>"`
5858

5959
#### To an existing Resource Group
60-
`az group deployment create --name "echoBotDeploy" --resource-group "<groupname>" --template-file ".\deploymentTemplates\template-with-preexisting-rg.json" --parameters botId="<botname>" appId="<appid>" appSecret="<appsecret>"`
60+
`az group deployment sub create --name "echoBotDeploy" --resource-group "<groupname>" --template-file ".\deploymentTemplates\template-with-preexisting-rg.json" --parameters botId="<botname>" appId="<appid>" appSecret="<appsecret>"`
6161

6262
### 5. Update app id and password
6363
In src/main/resources/application.properties update

samples/02.echo-bot/deploymentTemplates/template-with-new-rg.json

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -76,13 +76,14 @@
7676
}
7777
},
7878
"variables": {
79-
"resourcesLocation": "[deployment().location]",
79+
"resourcesLocation": "[if(empty(parameters('newAppServicePlanLocation')), deployment().location, parameters('newAppServicePlanLocation'))]",
8080
"effectiveGroupLocation": "[if(empty(parameters('groupLocation')), variables('resourcesLocation'), parameters('groupLocation'))]",
81-
"effectivePlanLocation": "[if(empty(parameters('newAppServicePlanLocation')), variables('resourcesLocation'), parameters('newAppServicePlanLocation'))]",
81+
"effectivePlanLocation": "[if(empty(parameters('newAppServicePlanLocation')), deployment().location, parameters('newAppServicePlanLocation'))]",
8282
"appServicePlanName": "[if(empty(parameters('newAppServicePlanName')), concat(parameters('botId'), 'ServicePlan'), parameters('newAppServicePlanName'))]",
8383
"webAppName": "[if(empty(parameters('newWebAppName')), parameters('botId'), parameters('newWebAppName'))]",
8484
"siteHost": "[concat(variables('webAppName'), '.azurewebsites.net')]",
85-
"botEndpoint": "[concat('https://', variables('siteHost'), '/api/messages')]"
85+
"botEndpoint": "[concat('https://', variables('siteHost'), '/api/messages')]",
86+
"resourceGroupId": "[concat(subscription().id, '/resourceGroups/', parameters('groupName'))]"
8687
},
8788
"resources": [
8889
{
@@ -114,7 +115,7 @@
114115
"type": "Microsoft.Web/serverfarms",
115116
"name": "[variables('appServicePlanName')]",
116117
"apiVersion": "2018-02-01",
117-
"location": "[variables('effectivePlanLocation')]",
118+
"location": "[variables('resourcesLocation')]",
118119
"sku": "[parameters('newAppServicePlanSku')]",
119120
"kind": "linux",
120121
"properties": {
@@ -129,7 +130,7 @@
129130
"location": "[variables('resourcesLocation')]",
130131
"kind": "app",
131132
"dependsOn": [
132-
"[resourceId('Microsoft.Web/serverfarms/', variables('appServicePlanName'))]"
133+
"[concat(variables('resourceGroupId'), '/providers/Microsoft.Web/serverfarms/', variables('appServicePlanName'))]"
133134
],
134135
"name": "[variables('webAppName')]",
135136
"properties": {
@@ -179,7 +180,7 @@
179180
"storageResourceId": null
180181
},
181182
"dependsOn": [
182-
"[resourceId('Microsoft.Web/sites/', variables('webAppName'))]"
183+
"[concat(variables('resourceGroupId'), '/providers/Microsoft.Web/sites/', variables('webAppName'))]"
183184
]
184185
}
185186
],

samples/03.welcome-user/README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -54,10 +54,10 @@ Record the `appid` from the returned JSON
5454
Replace the values for `<appid>`, `<appsecret>`, `<botname>`, and `<groupname>` in the following commands:
5555

5656
#### To a new Resource Group
57-
`az deployment create --name "stateBotDeploy" --location "westus" --template-file ".\deploymentTemplates\template-with-new-rg.json" --parameters groupName="<groupname>" botId="<botname>" appId="<appid>" appSecret="<appsecret>"`
57+
`az deployment sub create --name "stateBotDeploy" --location "westus" --template-file ".\deploymentTemplates\template-with-new-rg.json" --parameters groupName="<groupname>" botId="<botname>" appId="<appid>" appSecret="<appsecret>"`
5858

5959
#### To an existing Resource Group
60-
`az group deployment create --name "stateBotDeploy" --resource-group "<groupname>" --template-file ".\deploymentTemplates\template-with-preexisting-rg.json" --parameters botId="<botname>" appId="<appid>" appSecret="<appsecret>"`
60+
`az group deployment sub create --name "stateBotDeploy" --resource-group "<groupname>" --template-file ".\deploymentTemplates\template-with-preexisting-rg.json" --parameters botId="<botname>" appId="<appid>" appSecret="<appsecret>"`
6161

6262
### 5. Update app id and password
6363
In src/main/resources/application.properties update

samples/03.welcome-user/deploymentTemplates/template-with-new-rg.json

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -76,13 +76,14 @@
7676
}
7777
},
7878
"variables": {
79-
"resourcesLocation": "[deployment().location]",
79+
"resourcesLocation": "[if(empty(parameters('newAppServicePlanLocation')), deployment().location, parameters('newAppServicePlanLocation'))]",
8080
"effectiveGroupLocation": "[if(empty(parameters('groupLocation')), variables('resourcesLocation'), parameters('groupLocation'))]",
81-
"effectivePlanLocation": "[if(empty(parameters('newAppServicePlanLocation')), variables('resourcesLocation'), parameters('newAppServicePlanLocation'))]",
81+
"effectivePlanLocation": "[if(empty(parameters('newAppServicePlanLocation')), deployment().location, parameters('newAppServicePlanLocation'))]",
8282
"appServicePlanName": "[if(empty(parameters('newAppServicePlanName')), concat(parameters('botId'), 'ServicePlan'), parameters('newAppServicePlanName'))]",
8383
"webAppName": "[if(empty(parameters('newWebAppName')), parameters('botId'), parameters('newWebAppName'))]",
8484
"siteHost": "[concat(variables('webAppName'), '.azurewebsites.net')]",
85-
"botEndpoint": "[concat('https://', variables('siteHost'), '/api/messages')]"
85+
"botEndpoint": "[concat('https://', variables('siteHost'), '/api/messages')]",
86+
"resourceGroupId": "[concat(subscription().id, '/resourceGroups/', parameters('groupName'))]"
8687
},
8788
"resources": [
8889
{
@@ -114,7 +115,7 @@
114115
"type": "Microsoft.Web/serverfarms",
115116
"name": "[variables('appServicePlanName')]",
116117
"apiVersion": "2018-02-01",
117-
"location": "[variables('effectivePlanLocation')]",
118+
"location": "[variables('resourcesLocation')]",
118119
"sku": "[parameters('newAppServicePlanSku')]",
119120
"kind": "linux",
120121
"properties": {
@@ -129,7 +130,7 @@
129130
"location": "[variables('resourcesLocation')]",
130131
"kind": "app",
131132
"dependsOn": [
132-
"[resourceId('Microsoft.Web/serverfarms/', variables('appServicePlanName'))]"
133+
"[concat(variables('resourceGroupId'), '/providers/Microsoft.Web/serverfarms/', variables('appServicePlanName'))]"
133134
],
134135
"name": "[variables('webAppName')]",
135136
"properties": {
@@ -179,7 +180,7 @@
179180
"storageResourceId": null
180181
},
181182
"dependsOn": [
182-
"[resourceId('Microsoft.Web/sites/', variables('webAppName'))]"
183+
"[concat(variables('resourceGroupId'), '/providers/Microsoft.Web/sites/', variables('webAppName'))]"
183184
]
184185
}
185186
],

samples/05.multi-turn-prompt/README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -54,10 +54,10 @@ Record the `appid` from the returned JSON
5454
Replace the values for `<appid>`, `<appsecret>`, `<botname>`, and `<groupname>` in the following commands:
5555

5656
#### To a new Resource Group
57-
`az deployment create --name "stateBotDeploy" --location "westus" --template-file ".\deploymentTemplates\template-with-new-rg.json" --parameters groupName="<groupname>" botId="<botname>" appId="<appid>" appSecret="<appsecret>"`
57+
`az deployment sub create --name "stateBotDeploy" --location "westus" --template-file ".\deploymentTemplates\template-with-new-rg.json" --parameters groupName="<groupname>" botId="<botname>" appId="<appid>" appSecret="<appsecret>"`
5858

5959
#### To an existing Resource Group
60-
`az group deployment create --name "stateBotDeploy" --resource-group "<groupname>" --template-file ".\deploymentTemplates\template-with-preexisting-rg.json" --parameters botId="<botname>" appId="<appid>" appSecret="<appsecret>"`
60+
`az group deployment sub create --name "stateBotDeploy" --resource-group "<groupname>" --template-file ".\deploymentTemplates\template-with-preexisting-rg.json" --parameters botId="<botname>" appId="<appid>" appSecret="<appsecret>"`
6161

6262
### 5. Update app id and password
6363
In src/main/resources/application.properties update

samples/05.multi-turn-prompt/deploymentTemplates/template-with-new-rg.json

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -76,13 +76,14 @@
7676
}
7777
},
7878
"variables": {
79-
"resourcesLocation": "[deployment().location]",
79+
"resourcesLocation": "[if(empty(parameters('newAppServicePlanLocation')), deployment().location, parameters('newAppServicePlanLocation'))]",
8080
"effectiveGroupLocation": "[if(empty(parameters('groupLocation')), variables('resourcesLocation'), parameters('groupLocation'))]",
81-
"effectivePlanLocation": "[if(empty(parameters('newAppServicePlanLocation')), variables('resourcesLocation'), parameters('newAppServicePlanLocation'))]",
81+
"effectivePlanLocation": "[if(empty(parameters('newAppServicePlanLocation')), deployment().location, parameters('newAppServicePlanLocation'))]",
8282
"appServicePlanName": "[if(empty(parameters('newAppServicePlanName')), concat(parameters('botId'), 'ServicePlan'), parameters('newAppServicePlanName'))]",
8383
"webAppName": "[if(empty(parameters('newWebAppName')), parameters('botId'), parameters('newWebAppName'))]",
8484
"siteHost": "[concat(variables('webAppName'), '.azurewebsites.net')]",
85-
"botEndpoint": "[concat('https://', variables('siteHost'), '/api/messages')]"
85+
"botEndpoint": "[concat('https://', variables('siteHost'), '/api/messages')]",
86+
"resourceGroupId": "[concat(subscription().id, '/resourceGroups/', parameters('groupName'))]"
8687
},
8788
"resources": [
8889
{
@@ -114,7 +115,7 @@
114115
"type": "Microsoft.Web/serverfarms",
115116
"name": "[variables('appServicePlanName')]",
116117
"apiVersion": "2018-02-01",
117-
"location": "[variables('effectivePlanLocation')]",
118+
"location": "[variables('resourcesLocation')]",
118119
"sku": "[parameters('newAppServicePlanSku')]",
119120
"kind": "linux",
120121
"properties": {
@@ -129,7 +130,7 @@
129130
"location": "[variables('resourcesLocation')]",
130131
"kind": "app",
131132
"dependsOn": [
132-
"[resourceId('Microsoft.Web/serverfarms/', variables('appServicePlanName'))]"
133+
"[concat(variables('resourceGroupId'), '/providers/Microsoft.Web/serverfarms/', variables('appServicePlanName'))]"
133134
],
134135
"name": "[variables('webAppName')]",
135136
"properties": {
@@ -179,7 +180,7 @@
179180
"storageResourceId": null
180181
},
181182
"dependsOn": [
182-
"[resourceId('Microsoft.Web/sites/', variables('webAppName'))]"
183+
"[concat(variables('resourceGroupId'), '/providers/Microsoft.Web/sites/', variables('webAppName'))]"
183184
]
184185
}
185186
],

samples/06.using-cards/README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -67,10 +67,10 @@ Record the `appid` from the returned JSON
6767
Replace the values for `<appid>`, `<appsecret>`, `<botname>`, and `<groupname>` in the following commands:
6868

6969
#### To a new Resource Group
70-
`az deployment create --name "stateBotDeploy" --location "westus" --template-file ".\deploymentTemplates\template-with-new-rg.json" --parameters groupName="<groupname>" botId="<botname>" appId="<appid>" appSecret="<appsecret>"`
70+
`az deployment sub create --name "stateBotDeploy" --location "westus" --template-file ".\deploymentTemplates\template-with-new-rg.json" --parameters groupName="<groupname>" botId="<botname>" appId="<appid>" appSecret="<appsecret>"`
7171

7272
#### To an existing Resource Group
73-
`az group deployment create --name "stateBotDeploy" --resource-group "<groupname>" --template-file ".\deploymentTemplates\template-with-preexisting-rg.json" --parameters botId="<botname>" appId="<appid>" appSecret="<appsecret>"`
73+
`az group deployment sub create --name "stateBotDeploy" --resource-group "<groupname>" --template-file ".\deploymentTemplates\template-with-preexisting-rg.json" --parameters botId="<botname>" appId="<appid>" appSecret="<appsecret>"`
7474

7575
### 5. Update app id and password
7676
In src/main/resources/application.properties update

samples/06.using-cards/deploymentTemplates/template-with-new-rg.json

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -76,13 +76,14 @@
7676
}
7777
},
7878
"variables": {
79-
"resourcesLocation": "[deployment().location]",
79+
"resourcesLocation": "[if(empty(parameters('newAppServicePlanLocation')), deployment().location, parameters('newAppServicePlanLocation'))]",
8080
"effectiveGroupLocation": "[if(empty(parameters('groupLocation')), variables('resourcesLocation'), parameters('groupLocation'))]",
81-
"effectivePlanLocation": "[if(empty(parameters('newAppServicePlanLocation')), variables('resourcesLocation'), parameters('newAppServicePlanLocation'))]",
81+
"effectivePlanLocation": "[if(empty(parameters('newAppServicePlanLocation')), deployment().location, parameters('newAppServicePlanLocation'))]",
8282
"appServicePlanName": "[if(empty(parameters('newAppServicePlanName')), concat(parameters('botId'), 'ServicePlan'), parameters('newAppServicePlanName'))]",
8383
"webAppName": "[if(empty(parameters('newWebAppName')), parameters('botId'), parameters('newWebAppName'))]",
8484
"siteHost": "[concat(variables('webAppName'), '.azurewebsites.net')]",
85-
"botEndpoint": "[concat('https://', variables('siteHost'), '/api/messages')]"
85+
"botEndpoint": "[concat('https://', variables('siteHost'), '/api/messages')]",
86+
"resourceGroupId": "[concat(subscription().id, '/resourceGroups/', parameters('groupName'))]"
8687
},
8788
"resources": [
8889
{
@@ -114,7 +115,7 @@
114115
"type": "Microsoft.Web/serverfarms",
115116
"name": "[variables('appServicePlanName')]",
116117
"apiVersion": "2018-02-01",
117-
"location": "[variables('effectivePlanLocation')]",
118+
"location": "[variables('resourcesLocation')]",
118119
"sku": "[parameters('newAppServicePlanSku')]",
119120
"kind": "linux",
120121
"properties": {
@@ -129,7 +130,7 @@
129130
"location": "[variables('resourcesLocation')]",
130131
"kind": "app",
131132
"dependsOn": [
132-
"[resourceId('Microsoft.Web/serverfarms/', variables('appServicePlanName'))]"
133+
"[concat(variables('resourceGroupId'), '/providers/Microsoft.Web/serverfarms/', variables('appServicePlanName'))]"
133134
],
134135
"name": "[variables('webAppName')]",
135136
"properties": {
@@ -179,7 +180,7 @@
179180
"storageResourceId": null
180181
},
181182
"dependsOn": [
182-
"[resourceId('Microsoft.Web/sites/', variables('webAppName'))]"
183+
"[concat(variables('resourceGroupId'), '/providers/Microsoft.Web/sites/', variables('webAppName'))]"
183184
]
184185
}
185186
],

samples/08.suggested-actions/README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -54,10 +54,10 @@ Record the `appid` from the returned JSON
5454
Replace the values for `<appid>`, `<appsecret>`, `<botname>`, and `<groupname>` in the following commands:
5555

5656
#### To a new Resource Group
57-
`az deployment create --name "echoBotDeploy" --location "westus" --template-file ".\deploymentTemplates\template-with-new-rg.json" --parameters groupName="<groupname>" botId="<botname>" appId="<appid>" appSecret="<appsecret>"`
57+
`az deployment sub create --name "echoBotDeploy" --location "westus" --template-file ".\deploymentTemplates\template-with-new-rg.json" --parameters groupName="<groupname>" botId="<botname>" appId="<appid>" appSecret="<appsecret>"`
5858

5959
#### To an existing Resource Group
60-
`az group deployment create --name "echoBotDeploy" --resource-group "<groupname>" --template-file ".\deploymentTemplates\template-with-preexisting-rg.json" --parameters botId="<botname>" appId="<appid>" appSecret="<appsecret>"`
60+
`az group deployment sub create --name "echoBotDeploy" --resource-group "<groupname>" --template-file ".\deploymentTemplates\template-with-preexisting-rg.json" --parameters botId="<botname>" appId="<appid>" appSecret="<appsecret>"`
6161

6262
### 5. Update app id and password
6363
In src/main/resources/application.properties update

0 commit comments

Comments
 (0)