|
| 1 | +{ |
| 2 | + "$schema": "https://schema.management.azure.com/schemas/2015-01-01/deploymentTemplate.json#", |
| 3 | + "contentVersion": "1.0.0.0", |
| 4 | + "parameters": { |
| 5 | + "groupLocation": { |
| 6 | + "defaultValue": "", |
| 7 | + "type": "string", |
| 8 | + "metadata": { |
| 9 | + "description": "Specifies the location of the Resource Group." |
| 10 | + } |
| 11 | + }, |
| 12 | + "groupName": { |
| 13 | + "type": "string", |
| 14 | + "metadata": { |
| 15 | + "description": "Specifies the name of the Resource Group." |
| 16 | + } |
| 17 | + }, |
| 18 | + "appId": { |
| 19 | + "type": "string", |
| 20 | + "metadata": { |
| 21 | + "description": "Active Directory App ID, set as MicrosoftAppId in the Web App's Application Settings." |
| 22 | + } |
| 23 | + }, |
| 24 | + "appSecret": { |
| 25 | + "type": "string", |
| 26 | + "metadata": { |
| 27 | + "description": "Active Directory App Password, set as MicrosoftAppPassword in the Web App's Application Settings." |
| 28 | + } |
| 29 | + }, |
| 30 | + "botId": { |
| 31 | + "type": "string", |
| 32 | + "metadata": { |
| 33 | + "description": "The globally unique and immutable bot ID. Also used to configure the displayName of the bot, which is mutable." |
| 34 | + } |
| 35 | + }, |
| 36 | + "botSku": { |
| 37 | + "defaultValue": "S1", |
| 38 | + "type": "string", |
| 39 | + "metadata": { |
| 40 | + "description": "The pricing tier of the Bot Service Registration. Acceptable values are F0 and S1." |
| 41 | + } |
| 42 | + }, |
| 43 | + "newAppServicePlanName": { |
| 44 | + "defaultValue": "", |
| 45 | + "type": "string", |
| 46 | + "metadata": { |
| 47 | + "description": "The name of the App Service Plan." |
| 48 | + } |
| 49 | + }, |
| 50 | + "newAppServicePlanSku": { |
| 51 | + "type": "object", |
| 52 | + "defaultValue": { |
| 53 | + "name": "P1v2", |
| 54 | + "tier": "PremiumV2", |
| 55 | + "size": "P1v2", |
| 56 | + "family": "Pv2", |
| 57 | + "capacity": 1 |
| 58 | + }, |
| 59 | + "metadata": { |
| 60 | + "description": "The SKU of the App Service Plan. Defaults to Standard values." |
| 61 | + } |
| 62 | + }, |
| 63 | + "newAppServicePlanLocation": { |
| 64 | + "defaultValue": "", |
| 65 | + "type": "string", |
| 66 | + "metadata": { |
| 67 | + "description": "The location of the App Service Plan. Defaults to \"westus\"." |
| 68 | + } |
| 69 | + }, |
| 70 | + "newWebAppName": { |
| 71 | + "type": "string", |
| 72 | + "defaultValue": "", |
| 73 | + "metadata": { |
| 74 | + "description": "The globally unique name of the Web App. Defaults to the value passed in for \"botId\"." |
| 75 | + } |
| 76 | + } |
| 77 | + }, |
| 78 | + "variables": { |
| 79 | + "appServicePlanName": "[parameters('newAppServicePlanName')]", |
| 80 | + "resourcesLocation": "[parameters('newAppServicePlanLocation')]", |
| 81 | + "webAppName": "[if(empty(parameters('newWebAppName')), parameters('botId'), parameters('newWebAppName'))]", |
| 82 | + "siteHost": "[concat(variables('webAppName'), '.azurewebsites.net')]", |
| 83 | + "botEndpoint": "[concat('https://', variables('siteHost'), '/api/messages')]", |
| 84 | + "publishingUsername": "[concat('$', parameters('newWebAppName'))]", |
| 85 | + "resourceGroupId": "[concat(subscription().id, '/resourceGroups/', parameters('groupName'))]" |
| 86 | + }, |
| 87 | + "resources": [ |
| 88 | + { |
| 89 | + "name": "[parameters('groupName')]", |
| 90 | + "type": "Microsoft.Resources/resourceGroups", |
| 91 | + "apiVersion": "2018-05-01", |
| 92 | + "location": "[parameters('groupLocation')]", |
| 93 | + "properties": {} |
| 94 | + }, |
| 95 | + { |
| 96 | + "type": "Microsoft.Resources/deployments", |
| 97 | + "apiVersion": "2018-05-01", |
| 98 | + "name": "storageDeployment", |
| 99 | + "resourceGroup": "[parameters('groupName')]", |
| 100 | + "dependsOn": [ |
| 101 | + "[resourceId('Microsoft.Resources/resourceGroups/', parameters('groupName'))]" |
| 102 | + ], |
| 103 | + "properties": { |
| 104 | + "mode": "Incremental", |
| 105 | + "template": { |
| 106 | + "$schema": "https://schema.management.azure.com/schemas/2015-01-01/deploymentTemplate.json#", |
| 107 | + "contentVersion": "1.0.0.0", |
| 108 | + "parameters": {}, |
| 109 | + "variables": {}, |
| 110 | + "resources": [ |
| 111 | + { |
| 112 | + "comments": "Create a new Linux App Service Plan if no existing App Service Plan name was passed in.", |
| 113 | + "type": "Microsoft.Web/serverfarms", |
| 114 | + "name": "[variables('appServicePlanName')]", |
| 115 | + "apiVersion": "2018-02-01", |
| 116 | + "location": "[variables('resourcesLocation')]", |
| 117 | + "sku": "[parameters('newAppServicePlanSku')]", |
| 118 | + "kind": "linux", |
| 119 | + "properties": { |
| 120 | + "perSiteScaling": false, |
| 121 | + "maximumElasticWorkerCount": 1, |
| 122 | + "isSpot": false, |
| 123 | + "reserved": true, |
| 124 | + "isXenon": false, |
| 125 | + "hyperV": false, |
| 126 | + "targetWorkerCount": 0, |
| 127 | + "targetWorkerSizeId": 0 |
| 128 | + } |
| 129 | + }, |
| 130 | + { |
| 131 | + "comments": "Create a Web App using a Linux App Service Plan", |
| 132 | + "type": "Microsoft.Web/sites", |
| 133 | + "apiVersion": "2018-11-01", |
| 134 | + "location": "[variables('resourcesLocation')]", |
| 135 | + "kind": "app,linux", |
| 136 | + "dependsOn": [ |
| 137 | + "[concat(variables('resourceGroupId'), '/providers/Microsoft.Web/serverfarms/', variables('appServicePlanName'))]" |
| 138 | + ], |
| 139 | + "name": "[variables('webAppName')]", |
| 140 | + "properties": { |
| 141 | + "name": "[variables('webAppName')]", |
| 142 | + "hostNameSslStates": [ |
| 143 | + { |
| 144 | + "name": "[concat(parameters('newWebAppName'), '.azurewebsites.net')]", |
| 145 | + "sslState": "Disabled", |
| 146 | + "hostType": "Standard" |
| 147 | + }, |
| 148 | + { |
| 149 | + "name": "[concat(parameters('newWebAppName'), '.scm.azurewebsites.net')]", |
| 150 | + "sslState": "Disabled", |
| 151 | + "hostType": "Repository" |
| 152 | + } |
| 153 | + ], |
| 154 | + "serverFarmId": "[variables('appServicePlanName')]", |
| 155 | + "reserved": true, |
| 156 | + "isXenon": false, |
| 157 | + "hyperV": false, |
| 158 | + "scmSiteAlsoStopped": false, |
| 159 | + "clientAffinityEnabled": true, |
| 160 | + "clientCertEnabled": false, |
| 161 | + "hostNamesDisabled": false, |
| 162 | + "containerSize": 0, |
| 163 | + "dailyMemoryTimeQuota": 0, |
| 164 | + "httpsOnly": false, |
| 165 | + "redundancyMode": "None", |
| 166 | + "siteConfig": { |
| 167 | + "appSettings": [ |
| 168 | + { |
| 169 | + "name": "JAVA_OPTS", |
| 170 | + "value": "-Dserver.port=80" |
| 171 | + }, |
| 172 | + { |
| 173 | + "name": "MicrosoftAppId", |
| 174 | + "value": "[parameters('appId')]" |
| 175 | + }, |
| 176 | + { |
| 177 | + "name": "MicrosoftAppPassword", |
| 178 | + "value": "[parameters('appSecret')]" |
| 179 | + } |
| 180 | + ], |
| 181 | + "cors": { |
| 182 | + "allowedOrigins": [ |
| 183 | + "https://botservice.hosting.portal.azure.net", |
| 184 | + "https://hosting.onecloud.azure-test.net/" |
| 185 | + ] |
| 186 | + } |
| 187 | + } |
| 188 | + } |
| 189 | + }, |
| 190 | + { |
| 191 | + "type": "Microsoft.Web/sites/config", |
| 192 | + "apiVersion": "2018-11-01", |
| 193 | + "name": "[concat(variables('webAppName'), '/web')]", |
| 194 | + "location": "[variables('resourcesLocation')]", |
| 195 | + "dependsOn": [ |
| 196 | + "[concat(variables('resourceGroupId'), '/providers/Microsoft.Web/sites/', variables('webAppName'))]" |
| 197 | + ], |
| 198 | + "properties": { |
| 199 | + "numberOfWorkers": 1, |
| 200 | + "defaultDocuments": [ |
| 201 | + "Default.htm", |
| 202 | + "Default.html", |
| 203 | + "Default.asp", |
| 204 | + "index.htm", |
| 205 | + "index.html", |
| 206 | + "iisstart.htm", |
| 207 | + "default.aspx", |
| 208 | + "index.php", |
| 209 | + "hostingstart.html" |
| 210 | + ], |
| 211 | + "netFrameworkVersion": "v4.0", |
| 212 | + "linuxFxVersion": "JAVA|8-jre8", |
| 213 | + "requestTracingEnabled": false, |
| 214 | + "remoteDebuggingEnabled": false, |
| 215 | + "httpLoggingEnabled": false, |
| 216 | + "logsDirectorySizeLimit": 35, |
| 217 | + "detailedErrorLoggingEnabled": false, |
| 218 | + "publishingUsername": "[variables('publishingUsername')]", |
| 219 | + "scmType": "None", |
| 220 | + "use32BitWorkerProcess": true, |
| 221 | + "webSocketsEnabled": false, |
| 222 | + "alwaysOn": true, |
| 223 | + "managedPipelineMode": "Integrated", |
| 224 | + "virtualApplications": [ |
| 225 | + { |
| 226 | + "virtualPath": "/", |
| 227 | + "physicalPath": "site\\wwwroot", |
| 228 | + "preloadEnabled": true |
| 229 | + } |
| 230 | + ], |
| 231 | + "loadBalancing": "LeastRequests", |
| 232 | + "experiments": { |
| 233 | + "rampUpRules": [] |
| 234 | + }, |
| 235 | + "autoHealEnabled": false, |
| 236 | + "localMySqlEnabled": false, |
| 237 | + "ipSecurityRestrictions": [ |
| 238 | + { |
| 239 | + "ipAddress": "Any", |
| 240 | + "action": "Allow", |
| 241 | + "priority": 1, |
| 242 | + "name": "Allow all", |
| 243 | + "description": "Allow all access" |
| 244 | + } |
| 245 | + ], |
| 246 | + "scmIpSecurityRestrictions": [ |
| 247 | + { |
| 248 | + "ipAddress": "Any", |
| 249 | + "action": "Allow", |
| 250 | + "priority": 1, |
| 251 | + "name": "Allow all", |
| 252 | + "description": "Allow all access" |
| 253 | + } |
| 254 | + ], |
| 255 | + "scmIpSecurityRestrictionsUseMain": false, |
| 256 | + "http20Enabled": false, |
| 257 | + "minTlsVersion": "1.2", |
| 258 | + "ftpsState": "AllAllowed", |
| 259 | + "reservedInstanceCount": 0 |
| 260 | + } |
| 261 | + }, |
| 262 | + { |
| 263 | + "apiVersion": "2021-03-01", |
| 264 | + "type": "Microsoft.BotService/botServices", |
| 265 | + "name": "[parameters('botId')]", |
| 266 | + "location": "global", |
| 267 | + "kind": "azurebot", |
| 268 | + "sku": { |
| 269 | + "name": "[parameters('botSku')]" |
| 270 | + }, |
| 271 | + "properties": { |
| 272 | + "name": "[parameters('botId')]", |
| 273 | + "displayName": "[parameters('botId')]", |
| 274 | + "iconUrl": "https://docs.botframework.com/static/devportal/client/images/bot-framework-default.png", |
| 275 | + "endpoint": "[variables('botEndpoint')]", |
| 276 | + "msaAppId": "[parameters('appId')]", |
| 277 | + "luisAppIds": [], |
| 278 | + "schemaTransformationVersion": "1.3", |
| 279 | + "isCmekEnabled": false, |
| 280 | + "isIsolated": false |
| 281 | + }, |
| 282 | + "dependsOn": [ |
| 283 | + "[concat(variables('resourceGroupId'), '/providers/Microsoft.Web/sites/', variables('webAppName'))]" |
| 284 | + ] |
| 285 | + } |
| 286 | + ], |
| 287 | + "outputs": {} |
| 288 | + } |
| 289 | + } |
| 290 | + } |
| 291 | + ] |
| 292 | +} |
0 commit comments