|
4 | 4 | "parameters": { |
5 | 5 | "appServiceName": { |
6 | 6 | "type": "string", |
7 | | - "defaultValue": "", |
8 | 7 | "metadata": { |
9 | 8 | "description": "The globally unique name of the Web App." |
10 | 9 | } |
|
18 | 17 | }, |
19 | 18 | "existingAppServicePlanLocation": { |
20 | 19 | "type": "string", |
| 20 | + "defaultValue": "", |
21 | 21 | "metadata": { |
22 | 22 | "description": "The location of the App Service Plan." |
23 | 23 | } |
24 | 24 | }, |
25 | 25 | "newAppServicePlanName": { |
26 | 26 | "type": "string", |
| 27 | + "defaultValue": "", |
27 | 28 | "metadata": { |
28 | 29 | "description": "The name of the new App Service Plan." |
29 | 30 | } |
30 | 31 | }, |
31 | 32 | "newAppServicePlanLocation": { |
32 | 33 | "type": "string", |
| 34 | + "defaultValue": "", |
33 | 35 | "metadata": { |
34 | 36 | "description": "The location of the App Service Plan." |
35 | 37 | } |
|
47 | 49 | "description": "The SKU of the App Service Plan. Defaults to Standard values." |
48 | 50 | } |
49 | 51 | }, |
| 52 | + "appType": { |
| 53 | + "type": "string", |
| 54 | + "defaultValue": "MultiTenant", |
| 55 | + "allowedValues": [ |
| 56 | + "MultiTenant", |
| 57 | + "SingleTenant", |
| 58 | + "UserAssignedMSI" |
| 59 | + ], |
| 60 | + "metadata": { |
| 61 | + "description": "Type of Bot Authentication. set as MicrosoftAppType in the Web App's Application Settings. Allowed values are: MultiTenant, SingleTenant, UserAssignedMSI. Defaults to \"MultiTenant\"." |
| 62 | + } |
| 63 | + }, |
50 | 64 | "appId": { |
51 | 65 | "type": "string", |
52 | 66 | "metadata": { |
|
59 | 73 | "metadata": { |
60 | 74 | "description": "Active Directory App Password, set as MicrosoftAppPassword in the Web App's Application Settings. Required for MultiTenant and SingleTenant app types. Defaults to \"\"." |
61 | 75 | } |
| 76 | + }, |
| 77 | + "UMSIName": { |
| 78 | + "type": "string", |
| 79 | + "defaultValue": "", |
| 80 | + "metadata": { |
| 81 | + "description": "The User-Assigned Managed Identity Resource used for the Bot's Authentication. Defaults to \"\"." |
| 82 | + } |
| 83 | + }, |
| 84 | + "UMSIResourceGroupName": { |
| 85 | + "type": "string", |
| 86 | + "defaultValue": "", |
| 87 | + "metadata": { |
| 88 | + "description": "The User-Assigned Managed Identity Resource Group used for the Bot's Authentication. Defaults to \"\"." |
| 89 | + } |
| 90 | + }, |
| 91 | + "tenantId": { |
| 92 | + "type": "string", |
| 93 | + "defaultValue": "[subscription().tenantId]", |
| 94 | + "metadata": { |
| 95 | + "description": "The Azure AD Tenant ID to use as part of the Bot's Authentication. Only used for SingleTenant and UserAssignedMSI app types. Defaults to \"Subscription Tenant ID\"." |
| 96 | + } |
62 | 97 | } |
63 | 98 | }, |
64 | 99 | "variables": { |
65 | | - "defaultAppServicePlanName": "[if(empty(parameters('existingAppServicePlanName')), 'createNewAppServicePlan', parameters('existingAppServicePlanName'))]", |
66 | | - "useExistingServicePlan": "[not(equals(variables('defaultAppServicePlanName'), 'createNewAppServicePlan'))]", |
| 100 | + "tenantId": "[if(empty(parameters('tenantId')), subscription().tenantId, parameters('tenantId'))]", |
| 101 | + "useExistingServicePlan": "[not(empty(parameters('existingAppServicePlanName')))]", |
67 | 102 | "servicePlanName": "[if(variables('useExistingServicePlan'), parameters('existingAppServicePlanName'), parameters('newAppServicePlanName'))]", |
68 | | - "servicePlanLocation": "[if(variables('useExistingServicePlan'), parameters('existingAppServicePlanLocation'), parameters('newAppServicePlanLocation'))]" |
| 103 | + "servicePlanLocation": "[if(variables('useExistingServicePlan'), parameters('existingAppServicePlanLocation'), parameters('newAppServicePlanLocation'))]", |
| 104 | + "msiResourceId": "[if(empty(parameters('UMSIName')), '', concat(subscription().id, '/resourceGroups/', parameters('UMSIResourceGroupName'), '/providers/', 'Microsoft.ManagedIdentity/userAssignedIdentities/', parameters('UMSIName')))]", |
| 105 | + "appTypeDef": { |
| 106 | + "MultiTenant": { |
| 107 | + "tenantId": "", |
| 108 | + "identity": { "type": "None" } |
| 109 | + }, |
| 110 | + "SingleTenant": { |
| 111 | + "tenantId": "[variables('tenantId')]", |
| 112 | + "identity": { "type": "None" } |
| 113 | + }, |
| 114 | + "UserAssignedMSI": { |
| 115 | + "tenantId": "[variables('tenantId')]", |
| 116 | + "identity": { |
| 117 | + "type": "UserAssigned", |
| 118 | + "userAssignedIdentities": { |
| 119 | + "[variables('msiResourceId')]": {} |
| 120 | + } |
| 121 | + } |
| 122 | + } |
| 123 | + }, |
| 124 | + "appType": { |
| 125 | + "tenantId": "[variables('appTypeDef')[parameters('appType')].tenantId]", |
| 126 | + "identity": "[variables('appTypeDef')[parameters('appType')].identity]" |
| 127 | + } |
69 | 128 | }, |
70 | 129 | "resources": [ |
71 | 130 | { |
|
89 | 148 | "comments": "Create a Web App using an App Service Plan", |
90 | 149 | "type": "Microsoft.Web/sites", |
91 | 150 | "apiVersion": "2015-08-01", |
92 | | - "name": "[parameters('appServiceName')]", |
93 | 151 | "location": "[variables('servicePlanLocation')]", |
94 | 152 | "kind": "app,linux", |
95 | 153 | "dependsOn": [ |
96 | | - "[resourceId('Microsoft.Web/serverfarms', variables('servicePlanName'))]" |
| 154 | + "[resourceId('Microsoft.Web/serverfarms', variables('servicePlanName'))]" |
97 | 155 | ], |
| 156 | + "name": "[parameters('appServiceName')]", |
| 157 | + "identity": "[variables('appType').identity]", |
98 | 158 | "properties": { |
| 159 | + "name": "[parameters('appServiceName')]", |
99 | 160 | "enabled": true, |
100 | 161 | "hostNameSslStates": [ |
101 | 162 | { |
|
124 | 185 | "name": "SCM_DO_BUILD_DURING_DEPLOYMENT", |
125 | 186 | "value": "true" |
126 | 187 | }, |
| 188 | + { |
| 189 | + "name": "MicrosoftAppType", |
| 190 | + "value": "[parameters('appType')]" |
| 191 | + }, |
127 | 192 | { |
128 | 193 | "name": "MicrosoftAppId", |
129 | 194 | "value": "[parameters('appId')]" |
130 | 195 | }, |
131 | 196 | { |
132 | 197 | "name": "MicrosoftAppPassword", |
133 | 198 | "value": "[parameters('appSecret')]" |
| 199 | + }, |
| 200 | + { |
| 201 | + "name": "MicrosoftAppTenantId", |
| 202 | + "value": "[variables('appType').tenantId]" |
134 | 203 | } |
135 | 204 | ], |
136 | 205 | "cors": { |
|
167 | 236 | "phpVersion": "", |
168 | 237 | "pythonVersion": "", |
169 | 238 | "nodeVersion": "", |
170 | | - "linuxFxVersion": "PYTHON|3.7", |
| 239 | + "linuxFxVersion": "PYTHON|3.9", |
171 | 240 | "requestTracingEnabled": false, |
172 | 241 | "remoteDebuggingEnabled": false, |
173 | 242 | "remoteDebuggingVersion": "VS2017", |
|
201 | 270 | "autoHealEnabled": false, |
202 | 271 | "vnetName": "", |
203 | 272 | "minTlsVersion": "1.2", |
204 | | - "ftpsState": "AllAllowed", |
| 273 | + "ftpsState": "Disabled", |
205 | 274 | "reservedInstanceCount": 0 |
206 | 275 | } |
207 | 276 | } |
|
0 commit comments