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

Commit ccc753d

Browse files
committed
java template split AzureBot and BotApp
Add AzureBot region
1 parent 4029851 commit ccc753d

30 files changed

+1209
-432
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
{
2+
"$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentParameters.json#",
3+
"contentVersion": "1.0.0.0",
4+
"parameters": {
5+
"azureBotId": {
6+
"value": ""
7+
},
8+
"azureBotSku": {
9+
"value": "S1"
10+
},
11+
"azureBotRegion": {
12+
"value": "global"
13+
},
14+
"botEndpoint": {
15+
"value": ""
16+
},
17+
"appId": {
18+
"value": ""
19+
}
20+
}
21+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
{
2+
"$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentParameters.json#",
3+
"contentVersion": "1.0.0.0",
4+
"parameters": {
5+
"appServiceName": {
6+
"value": ""
7+
},
8+
"existingAppServicePlanName": {
9+
"value": ""
10+
},
11+
"existingAppServicePlanLocation": {
12+
"value": ""
13+
},
14+
"newAppServicePlanName": {
15+
"value": ""
16+
},
17+
"newAppServicePlanLocation": {
18+
"value": ""
19+
},
20+
"newAppServicePlanSku": {
21+
"value": {
22+
"name": "P1v2",
23+
"tier": "PremiumV2",
24+
"size": "P1v2",
25+
"family": "Pv2",
26+
"capacity": 1
27+
}
28+
},
29+
"appId": {
30+
"value": ""
31+
},
32+
"appSecret": {
33+
"value": ""
34+
}
35+
}
36+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
Need deploy BotAppService before AzureBot
2+
---
3+
az login
4+
az deployment group create --resource-group <group-name> --template-file <template-file> --parameters @<parameters-file>
5+
---
6+
7+
# parameters-for-template-BotApp-with-rg:
8+
9+
**appServiceName**:(required) The Name of the Bot App Service.
10+
11+
(choose an existingAppServicePlan or create a new AppServicePlan)
12+
**existingAppServicePlanName**: The name of the App Service Plan.
13+
**existingAppServicePlanLocation**: The location of the App Service Plan.
14+
**newAppServicePlanName**: The name of the App Service Plan.
15+
**newAppServicePlanLocation**: The location of the App Service Plan.
16+
**newAppServicePlanSku**: The SKU of the App Service Plan. Defaults to Standard values.
17+
18+
**appId**:(required) Active Directory App ID or User-Assigned Managed Identity Client ID, set as MicrosoftAppId in the Web App's Application Settings.
19+
**appSecret**:(required) Active Directory App Password, set as MicrosoftAppPassword in the Web App's Application Settings.
20+
21+
# parameters-for-template-AzureBot-with-rg:
22+
23+
**azureBotId**:(required) The globally unique and immutable bot ID.
24+
**azureBotSku**: The pricing tier of the Bot Service Registration. **Allowed values are: F0, S1(default)**.
25+
**azureBotRegion**: Specifies the location of the new AzureBot. **Allowed values are: global(default), westeurope**.
26+
**botEndpoint**: Use to handle client messages, Such as https://<botappServiceName>.azurewebsites.net/api/messages.
27+
28+
**appId**:(required) Active Directory App ID or User-Assigned Managed Identity Client ID, set as MicrosoftAppId in the Web App's Application Settings.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,61 @@
1+
{
2+
"$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentTemplate.json#",
3+
"contentVersion": "1.0.0.0",
4+
"parameters": {
5+
"azureBotId": {
6+
"type": "string",
7+
"metadata": {
8+
"description": "The globally unique and immutable bot ID."
9+
}
10+
},
11+
"azureBotSku": {
12+
"defaultValue": "S1",
13+
"type": "string",
14+
"metadata": {
15+
"description": "The pricing tier of the Bot Service Registration. Allowed values are: F0, S1(default)."
16+
}
17+
},
18+
"azureBotRegion": {
19+
"type": "string",
20+
"defaultValue": "global",
21+
"metadata": {
22+
"description": "Specifies the location of the new AzureBot. Allowed values are: global(default), westeurope."
23+
}
24+
},
25+
"botEndpoint": {
26+
"type": "string",
27+
"metadata": {
28+
"description": "Use to handle client messages, Such as https://<botappServiceName>.azurewebsites.net/api/messages."
29+
}
30+
},
31+
"appId": {
32+
"type": "string",
33+
"metadata": {
34+
"description": "Active Directory App ID or User-Assigned Managed Identity Client ID, set as MicrosoftAppId in the Web App's Application Settings."
35+
}
36+
}
37+
},
38+
"resources": [
39+
{
40+
"apiVersion": "2021-05-01-preview",
41+
"type": "Microsoft.BotService/botServices",
42+
"name": "[parameters('azureBotId')]",
43+
"location": "[parameters('azureBotRegion')]",
44+
"kind": "azurebot",
45+
"sku": {
46+
"name": "[parameters('azureBotSku')]"
47+
},
48+
"properties": {
49+
"name": "[parameters('azureBotId')]",
50+
"displayName": "[parameters('azureBotId')]",
51+
"iconUrl": "https://docs.botframework.com/static/devportal/client/images/bot-framework-default.png",
52+
"endpoint": "[parameters('botEndpoint')]",
53+
"msaAppId": "[parameters('appId')]",
54+
"luisAppIds": [],
55+
"schemaTransformationVersion": "1.3",
56+
"isCmekEnabled": false,
57+
"isIsolated": false
58+
}
59+
}
60+
]
61+
}

generators/generators/app/templates/empty/project/deploymentTemplates/template-with-preexisting-rg.json renamed to generators/generators/app/templates/core/project/deploymentTemplates/DeployUseExistResourceGroup/template-BotApp-with-rg.json

+34-70
Original file line numberDiff line numberDiff line change
@@ -1,37 +1,37 @@
11
{
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#",
33
"contentVersion": "1.0.0.0",
44
"parameters": {
5-
"appId": {
5+
"appServiceName": {
66
"type": "string",
7+
"defaultValue": "",
78
"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."
910
}
1011
},
11-
"appSecret": {
12+
"existingAppServicePlanName": {
1213
"type": "string",
14+
"defaultValue": "",
1315
"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."
1517
}
1618
},
17-
"botId": {
19+
"existingAppServicePlanLocation": {
1820
"type": "string",
1921
"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."
2123
}
2224
},
23-
"botSku": {
24-
"defaultValue": "S1",
25+
"newAppServicePlanName": {
2526
"type": "string",
2627
"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."
2829
}
2930
},
30-
"newAppServicePlanName": {
31+
"newAppServicePlanLocation": {
3132
"type": "string",
32-
"defaultValue": "",
3333
"metadata": {
34-
"description": "The name of the new App Service Plan."
34+
"description": "The location of the App Service Plan."
3535
}
3636
},
3737
"newAppServicePlanSku": {
@@ -47,46 +47,34 @@
4747
"description": "The SKU of the App Service Plan. Defaults to Standard values."
4848
}
4949
},
50-
"appServicePlanLocation": {
51-
"type": "string",
52-
"defaultValue": "",
53-
"metadata": {
54-
"description": "The location of the App Service Plan."
55-
}
56-
},
57-
"existingAppServicePlan": {
50+
"appId": {
5851
"type": "string",
59-
"defaultValue": "",
6052
"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."
6254
}
6355
},
64-
"newWebAppName": {
56+
"appSecret": {
6557
"type": "string",
6658
"defaultValue": "",
6759
"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 \"\"."
6961
}
7062
}
7163
},
7264
"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'))]"
8169
},
8270
"resources": [
8371
{
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.",
8573
"type": "Microsoft.Web/serverfarms",
86-
"condition": "[not(variables('useExistingAppServicePlan'))]",
74+
"condition": "[not(variables('useExistingServicePlan'))]",
8775
"name": "[variables('servicePlanName')]",
8876
"apiVersion": "2018-02-01",
89-
"location": "[variables('resourcesLocation')]",
77+
"location": "[parameters('newAppServicePlanLocation')]",
9078
"sku": "[parameters('newAppServicePlanSku')]",
9179
"kind": "linux",
9280
"properties": {
@@ -101,25 +89,25 @@
10189
}
10290
},
10391
{
104-
"comments": "Create a Web App using a Linux App Service Plan",
92+
"comments": "Create a Web App using an App Service Plan",
10593
"type": "Microsoft.Web/sites",
10694
"apiVersion": "2018-11-01",
107-
"location": "[variables('resourcesLocation')]",
95+
"name": "[parameters('appServiceName')]",
96+
"location": "[variables('servicePlanLocation')]",
10897
"kind": "app,linux",
10998
"dependsOn": [
11099
"[resourceId('Microsoft.Web/serverfarms', variables('servicePlanName'))]"
111100
],
112-
"name": "[variables('webAppName')]",
113101
"properties": {
114-
"name": "[variables('webAppName')]",
102+
"name": "[parameters('appServiceName')]",
115103
"hostNameSslStates": [
116104
{
117-
"name": "[concat(parameters('newWebAppName'), '.azurewebsites.net')]",
105+
"name": "[concat(parameters('appServiceName'), '.azurewebsites.net')]",
118106
"sslState": "Disabled",
119107
"hostType": "Standard"
120108
},
121109
{
122-
"name": "[concat(parameters('newWebAppName'), '.scm.azurewebsites.net')]",
110+
"name": "[concat(parameters('appServiceName'), '.scm.azurewebsites.net')]",
123111
"sslState": "Disabled",
124112
"hostType": "Repository"
125113
}
@@ -163,10 +151,10 @@
163151
{
164152
"type": "Microsoft.Web/sites/config",
165153
"apiVersion": "2018-11-01",
166-
"name": "[concat(variables('webAppName'), '/web')]",
167-
"location": "[variables('resourcesLocation')]",
154+
"name": "[concat(parameters('appServiceName'), '/web')]",
155+
"location": "[variables('servicePlanLocation')]",
168156
"dependsOn": [
169-
"[resourceId('Microsoft.Web/sites/', variables('webAppName'))]"
157+
"[resourceId('Microsoft.Web/sites', parameters('appServiceName'))]"
170158
],
171159
"properties": {
172160
"numberOfWorkers": 1,
@@ -188,7 +176,7 @@
188176
"httpLoggingEnabled": false,
189177
"logsDirectorySizeLimit": 35,
190178
"detailedErrorLoggingEnabled": false,
191-
"publishingUsername": "[variables('publishingUsername')]",
179+
"publishingUsername": "[concat('$', parameters('appServiceName'))]",
192180
"scmType": "None",
193181
"use32BitWorkerProcess": true,
194182
"webSocketsEnabled": false,
@@ -231,30 +219,6 @@
231219
"ftpsState": "AllAllowed",
232220
"reservedInstanceCount": 0
233221
}
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-
]
258222
}
259223
]
260224
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
{
2+
"$schema": "https://schema.management.azure.com/schemas/2015-01-01/deploymentTemplate.json#",
3+
"contentVersion": "1.0.0.0",
4+
"parameters": {
5+
"groupName": {
6+
"value": ""
7+
},
8+
"groupLocation": {
9+
"value": ""
10+
},
11+
"azureBotId": {
12+
"value": ""
13+
},
14+
"azureBotSku": {
15+
"value": "S1"
16+
},
17+
"azureBotRegion": {
18+
"value": "global"
19+
},
20+
"botEndpoint": {
21+
"value": ""
22+
},
23+
"appId": {
24+
"value": ""
25+
}
26+
}
27+
}

0 commit comments

Comments
 (0)