|
1 | 1 | { |
2 | | - "$schema": "https://schema.management.azure.com/schemas/2015-01-01/deploymentTemplate.json#", |
| 2 | + "$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentTemplate.json#", |
3 | 3 | "contentVersion": "1.0.0.0", |
4 | 4 | "parameters": { |
5 | | - "appId": { |
| 5 | + "appServiceName": { |
6 | 6 | "type": "string", |
| 7 | + "defaultValue": "", |
7 | 8 | "metadata": { |
8 | | - "description": "Active Directory App ID, set as MicrosoftAppId in the Web App's Application Settings." |
| 9 | + "description": "The globally unique name of the Web App." |
9 | 10 | } |
10 | 11 | }, |
11 | | - "appSecret": { |
| 12 | + "existingAppServicePlanName": { |
12 | 13 | "type": "string", |
| 14 | + "defaultValue": "", |
13 | 15 | "metadata": { |
14 | | - "description": "Active Directory App Password, set as MicrosoftAppPassword in the Web App's Application Settings. Defaults to \"\"." |
| 16 | + "description": "Name of the existing App Service Plan used to create the Web App for the bot." |
15 | 17 | } |
16 | 18 | }, |
17 | | - "botId": { |
| 19 | + "existingAppServicePlanLocation": { |
18 | 20 | "type": "string", |
19 | 21 | "metadata": { |
20 | | - "description": "The globally unique and immutable bot ID. Also used to configure the displayName of the bot, which is mutable." |
| 22 | + "description": "The location of the App Service Plan." |
21 | 23 | } |
22 | 24 | }, |
23 | | - "botSku": { |
24 | | - "defaultValue": "S1", |
| 25 | + "newAppServicePlanName": { |
25 | 26 | "type": "string", |
26 | 27 | "metadata": { |
27 | | - "description": "The pricing tier of the Bot Service Registration. Acceptable values are F0 and S1." |
| 28 | + "description": "The name of the new App Service Plan." |
28 | 29 | } |
29 | 30 | }, |
30 | | - "newAppServicePlanName": { |
| 31 | + "newAppServicePlanLocation": { |
31 | 32 | "type": "string", |
32 | | - "defaultValue": "", |
33 | 33 | "metadata": { |
34 | | - "description": "The name of the new App Service Plan." |
| 34 | + "description": "The location of the App Service Plan." |
35 | 35 | } |
36 | 36 | }, |
37 | 37 | "newAppServicePlanSku": { |
|
47 | 47 | "description": "The SKU of the App Service Plan. Defaults to Standard values." |
48 | 48 | } |
49 | 49 | }, |
50 | | - "appServicePlanLocation": { |
51 | | - "type": "string", |
52 | | - "defaultValue": "", |
53 | | - "metadata": { |
54 | | - "description": "The location of the App Service Plan." |
55 | | - } |
56 | | - }, |
57 | | - "existingAppServicePlan": { |
| 50 | + "appId": { |
58 | 51 | "type": "string", |
59 | | - "defaultValue": "", |
60 | 52 | "metadata": { |
61 | | - "description": "Name of the existing App Service Plan used to create the Web App for the bot." |
| 53 | + "description": "Active Directory App ID or User-Assigned Managed Identity Client ID, set as MicrosoftAppId in the Web App's Application Settings." |
62 | 54 | } |
63 | 55 | }, |
64 | | - "newWebAppName": { |
| 56 | + "appSecret": { |
65 | 57 | "type": "string", |
66 | 58 | "defaultValue": "", |
67 | 59 | "metadata": { |
68 | | - "description": "The globally unique name of the Web App. Defaults to the value passed in for \"botId\"." |
| 60 | + "description": "Active Directory App Password, set as MicrosoftAppPassword in the Web App's Application Settings. Required for MultiTenant and SingleTenant app types. Defaults to \"\"." |
69 | 61 | } |
70 | 62 | } |
71 | 63 | }, |
72 | 64 | "variables": { |
73 | | - "defaultAppServicePlanName": "[if(empty(parameters('existingAppServicePlan')), 'createNewAppServicePlan', parameters('existingAppServicePlan'))]", |
74 | | - "useExistingAppServicePlan": "[not(equals(variables('defaultAppServicePlanName'), 'createNewAppServicePlan'))]", |
75 | | - "servicePlanName": "[if(variables('useExistingAppServicePlan'), parameters('existingAppServicePlan'), parameters('newAppServicePlanName'))]", |
76 | | - "publishingUsername": "[concat('$', parameters('newWebAppName'))]", |
77 | | - "resourcesLocation": "[parameters('appServicePlanLocation')]", |
78 | | - "webAppName": "[if(empty(parameters('newWebAppName')), parameters('botId'), parameters('newWebAppName'))]", |
79 | | - "siteHost": "[concat(variables('webAppName'), '.azurewebsites.net')]", |
80 | | - "botEndpoint": "[concat('https://', variables('siteHost'), '/api/messages')]" |
| 65 | + "defaultAppServicePlanName": "[if(empty(parameters('existingAppServicePlanName')), 'createNewAppServicePlan', parameters('existingAppServicePlanName'))]", |
| 66 | + "useExistingServicePlan": "[not(equals(variables('defaultAppServicePlanName'), 'createNewAppServicePlan'))]", |
| 67 | + "servicePlanName": "[if(variables('useExistingServicePlan'), parameters('existingAppServicePlanName'), parameters('newAppServicePlanName'))]", |
| 68 | + "servicePlanLocation": "[if(variables('useExistingServicePlan'), parameters('existingAppServicePlanLocation'), parameters('newAppServicePlanLocation'))]" |
81 | 69 | }, |
82 | 70 | "resources": [ |
83 | 71 | { |
84 | | - "comments": "Create a new Linux App Service Plan if no existing App Service Plan name was passed in.", |
| 72 | + "comments": "Create a new App Service Plan if no existing App Service Plan name was passed in.", |
85 | 73 | "type": "Microsoft.Web/serverfarms", |
86 | | - "condition": "[not(variables('useExistingAppServicePlan'))]", |
| 74 | + "condition": "[not(variables('useExistingServicePlan'))]", |
87 | 75 | "name": "[variables('servicePlanName')]", |
88 | 76 | "apiVersion": "2018-02-01", |
89 | | - "location": "[variables('resourcesLocation')]", |
| 77 | + "location": "[parameters('newAppServicePlanLocation')]", |
90 | 78 | "sku": "[parameters('newAppServicePlanSku')]", |
91 | 79 | "kind": "linux", |
92 | 80 | "properties": { |
|
101 | 89 | } |
102 | 90 | }, |
103 | 91 | { |
104 | | - "comments": "Create a Web App using a Linux App Service Plan", |
| 92 | + "comments": "Create a Web App using an App Service Plan", |
105 | 93 | "type": "Microsoft.Web/sites", |
106 | 94 | "apiVersion": "2018-11-01", |
107 | | - "location": "[variables('resourcesLocation')]", |
| 95 | + "name": "[parameters('appServiceName')]", |
| 96 | + "location": "[variables('servicePlanLocation')]", |
108 | 97 | "kind": "app,linux", |
109 | 98 | "dependsOn": [ |
110 | 99 | "[resourceId('Microsoft.Web/serverfarms', variables('servicePlanName'))]" |
111 | 100 | ], |
112 | | - "name": "[variables('webAppName')]", |
113 | 101 | "properties": { |
114 | | - "name": "[variables('webAppName')]", |
| 102 | + "name": "[parameters('appServiceName')]", |
115 | 103 | "hostNameSslStates": [ |
116 | 104 | { |
117 | | - "name": "[concat(parameters('newWebAppName'), '.azurewebsites.net')]", |
| 105 | + "name": "[concat(parameters('appServiceName'), '.azurewebsites.net')]", |
118 | 106 | "sslState": "Disabled", |
119 | 107 | "hostType": "Standard" |
120 | 108 | }, |
121 | 109 | { |
122 | | - "name": "[concat(parameters('newWebAppName'), '.scm.azurewebsites.net')]", |
| 110 | + "name": "[concat(parameters('appServiceName'), '.scm.azurewebsites.net')]", |
123 | 111 | "sslState": "Disabled", |
124 | 112 | "hostType": "Repository" |
125 | 113 | } |
|
163 | 151 | { |
164 | 152 | "type": "Microsoft.Web/sites/config", |
165 | 153 | "apiVersion": "2018-11-01", |
166 | | - "name": "[concat(variables('webAppName'), '/web')]", |
167 | | - "location": "[variables('resourcesLocation')]", |
| 154 | + "name": "[concat(parameters('appServiceName'), '/web')]", |
| 155 | + "location": "[variables('servicePlanLocation')]", |
168 | 156 | "dependsOn": [ |
169 | | - "[resourceId('Microsoft.Web/sites/', variables('webAppName'))]" |
| 157 | + "[resourceId('Microsoft.Web/sites', parameters('appServiceName'))]" |
170 | 158 | ], |
171 | 159 | "properties": { |
172 | 160 | "numberOfWorkers": 1, |
|
188 | 176 | "httpLoggingEnabled": false, |
189 | 177 | "logsDirectorySizeLimit": 35, |
190 | 178 | "detailedErrorLoggingEnabled": false, |
191 | | - "publishingUsername": "[variables('publishingUsername')]", |
| 179 | + "publishingUsername": "[concat('$', parameters('appServiceName'))]", |
192 | 180 | "scmType": "None", |
193 | 181 | "use32BitWorkerProcess": true, |
194 | 182 | "webSocketsEnabled": false, |
|
231 | 219 | "ftpsState": "AllAllowed", |
232 | 220 | "reservedInstanceCount": 0 |
233 | 221 | } |
234 | | - }, |
235 | | - { |
236 | | - "apiVersion": "2021-03-01", |
237 | | - "type": "Microsoft.BotService/botServices", |
238 | | - "name": "[parameters('botId')]", |
239 | | - "location": "global", |
240 | | - "kind": "azurebot", |
241 | | - "sku": { |
242 | | - "name": "[parameters('botSku')]" |
243 | | - }, |
244 | | - "properties": { |
245 | | - "name": "[parameters('botId')]", |
246 | | - "displayName": "[parameters('botId')]", |
247 | | - "iconUrl": "https://docs.botframework.com/static/devportal/client/images/bot-framework-default.png", |
248 | | - "endpoint": "[variables('botEndpoint')]", |
249 | | - "msaAppId": "[parameters('appId')]", |
250 | | - "luisAppIds": [], |
251 | | - "schemaTransformationVersion": "1.3", |
252 | | - "isCmekEnabled": false, |
253 | | - "isIsolated": false |
254 | | - }, |
255 | | - "dependsOn": [ |
256 | | - "[resourceId('Microsoft.Web/sites/', variables('webAppName'))]" |
257 | | - ] |
258 | 222 | } |
259 | 223 | ] |
260 | 224 | } |
0 commit comments