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

Commit

Permalink
java template split AzureBot and BotApp
Browse files Browse the repository at this point in the history
Add AzureBot region
  • Loading branch information
fangyangci committed Aug 30, 2022
1 parent 4029851 commit b390de2
Show file tree
Hide file tree
Showing 30 changed files with 1,209 additions and 432 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
{
"$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentParameters.json#",
"contentVersion": "1.0.0.0",
"parameters": {
"azureBotId": {
"value": ""
},
"azureBotSku": {
"value": "S1"
},
"azureBotRegion": {
"value": "global"
},
"botEndpoint": {
"value": ""
},
"appId": {
"value": ""
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
{
"$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentParameters.json#",
"contentVersion": "1.0.0.0",
"parameters": {
"appServiceName": {
"value": ""
},
"existingAppServicePlanName": {
"value": ""
},
"existingAppServicePlanLocation": {
"value": ""
},
"newAppServicePlanName": {
"value": ""
},
"newAppServicePlanLocation": {
"value": ""
},
"newAppServicePlanSku": {
"value": {
"name": "P1v2",
"tier": "PremiumV2",
"size": "P1v2",
"family": "Pv2",
"capacity": 1
}
},
"appId": {
"value": ""
},
"appSecret": {
"value": ""
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
Need deploy BotAppService before AzureBot
---
az login
az deployment group create --resource-group <group-name> --template-file <template-file> --parameters @<parameters-file>
---

# parameters-for-template-BotApp-with-rg:

**appServiceName**:(required) The Name of the Bot App Service.

(choose an existingAppServicePlan or create a new AppServicePlan)
**existingAppServicePlanName**: The name of the App Service Plan.
**existingAppServicePlanLocation**: The location of the App Service Plan.
**newAppServicePlanName**: The name of the App Service Plan.
**newAppServicePlanLocation**: The location of the App Service Plan.
**newAppServicePlanSku**: The SKU of the App Service Plan. Defaults to Standard values.

**appId**:(required) Active Directory App ID or User-Assigned Managed Identity Client ID, set as MicrosoftAppId in the Web App's Application Settings.
**appSecret**:(required) Active Directory App Password, set as MicrosoftAppPassword in the Web App's Application Settings.

# parameters-for-template-AzureBot-with-rg:

**azureBotId**:(required) The globally unique and immutable bot ID.
**azureBotSku**: The pricing tier of the Bot Service Registration. **Allowed values are: F0, S1(default)**.
**azureBotRegion**: Specifies the location of the new AzureBot. **Allowed values are: global(default), westeurope**.
**botEndpoint**: Use to handle client messages, Such as https://<botappServiceName>.azurewebsites.net/api/messages.

**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 number Diff line number Diff line change
@@ -0,0 +1,61 @@
{
"$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentTemplate.json#",
"contentVersion": "1.0.0.0",
"parameters": {
"azureBotId": {
"type": "string",
"metadata": {
"description": "The globally unique and immutable bot ID."
}
},
"azureBotSku": {
"defaultValue": "S1",
"type": "string",
"metadata": {
"description": "The pricing tier of the Bot Service Registration. Allowed values are: F0, S1(default)."
}
},
"azureBotRegion": {
"type": "string",
"defaultValue": "global",
"metadata": {
"description": "Specifies the location of the new AzureBot. Allowed values are: global(default), westeurope."
}
},
"botEndpoint": {
"type": "string",
"metadata": {
"description": "Use to handle client messages, Such as https://<botappServiceName>.azurewebsites.net/api/messages."
}
},
"appId": {
"type": "string",
"metadata": {
"description": "Active Directory App ID or User-Assigned Managed Identity Client ID, set as MicrosoftAppId in the Web App's Application Settings."
}
}
},
"resources": [
{
"apiVersion": "2021-05-01-preview",
"type": "Microsoft.BotService/botServices",
"name": "[parameters('azureBotId')]",
"location": "[parameters('azureBotRegion')]",
"kind": "azurebot",
"sku": {
"name": "[parameters('azureBotSku')]"
},
"properties": {
"name": "[parameters('azureBotId')]",
"displayName": "[parameters('azureBotId')]",
"iconUrl": "https://docs.botframework.com/static/devportal/client/images/bot-framework-default.png",
"endpoint": "[parameters('botEndpoint')]",
"msaAppId": "[parameters('appId')]",
"luisAppIds": [],
"schemaTransformationVersion": "1.3",
"isCmekEnabled": false,
"isIsolated": false
}
}
]
}
Original file line number Diff line number Diff line change
@@ -1,37 +1,37 @@
{
"$schema": "https://schema.management.azure.com/schemas/2015-01-01/deploymentTemplate.json#",
"$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentTemplate.json#",
"contentVersion": "1.0.0.0",
"parameters": {
"appId": {
"appServiceName": {
"type": "string",
"defaultValue": "",
"metadata": {
"description": "Active Directory App ID, set as MicrosoftAppId in the Web App's Application Settings."
"description": "The globally unique name of the Web App."
}
},
"appSecret": {
"existingAppServicePlanName": {
"type": "string",
"defaultValue": "",
"metadata": {
"description": "Active Directory App Password, set as MicrosoftAppPassword in the Web App's Application Settings. Defaults to \"\"."
"description": "Name of the existing App Service Plan used to create the Web App for the bot."
}
},
"botId": {
"existingAppServicePlanLocation": {
"type": "string",
"metadata": {
"description": "The globally unique and immutable bot ID. Also used to configure the displayName of the bot, which is mutable."
"description": "The location of the App Service Plan."
}
},
"botSku": {
"defaultValue": "S1",
"newAppServicePlanName": {
"type": "string",
"metadata": {
"description": "The pricing tier of the Bot Service Registration. Acceptable values are F0 and S1."
"description": "The name of the new App Service Plan."
}
},
"newAppServicePlanName": {
"newAppServicePlanLocation": {
"type": "string",
"defaultValue": "",
"metadata": {
"description": "The name of the new App Service Plan."
"description": "The location of the App Service Plan."
}
},
"newAppServicePlanSku": {
Expand All @@ -47,46 +47,34 @@
"description": "The SKU of the App Service Plan. Defaults to Standard values."
}
},
"appServicePlanLocation": {
"type": "string",
"defaultValue": "",
"metadata": {
"description": "The location of the App Service Plan."
}
},
"existingAppServicePlan": {
"appId": {
"type": "string",
"defaultValue": "",
"metadata": {
"description": "Name of the existing App Service Plan used to create the Web App for the bot."
"description": "Active Directory App ID or User-Assigned Managed Identity Client ID, set as MicrosoftAppId in the Web App's Application Settings."
}
},
"newWebAppName": {
"appSecret": {
"type": "string",
"defaultValue": "",
"metadata": {
"description": "The globally unique name of the Web App. Defaults to the value passed in for \"botId\"."
"description": "Active Directory App Password, set as MicrosoftAppPassword in the Web App's Application Settings. Required for MultiTenant and SingleTenant app types. Defaults to \"\"."
}
}
},
"variables": {
"defaultAppServicePlanName": "[if(empty(parameters('existingAppServicePlan')), 'createNewAppServicePlan', parameters('existingAppServicePlan'))]",
"useExistingAppServicePlan": "[not(equals(variables('defaultAppServicePlanName'), 'createNewAppServicePlan'))]",
"servicePlanName": "[if(variables('useExistingAppServicePlan'), parameters('existingAppServicePlan'), parameters('newAppServicePlanName'))]",
"publishingUsername": "[concat('$', parameters('newWebAppName'))]",
"resourcesLocation": "[parameters('appServicePlanLocation')]",
"webAppName": "[if(empty(parameters('newWebAppName')), parameters('botId'), parameters('newWebAppName'))]",
"siteHost": "[concat(variables('webAppName'), '.azurewebsites.net')]",
"botEndpoint": "[concat('https://', variables('siteHost'), '/api/messages')]"
"defaultAppServicePlanName": "[if(empty(parameters('existingAppServicePlanName')), 'createNewAppServicePlan', parameters('existingAppServicePlanName'))]",
"useExistingServicePlan": "[not(equals(variables('defaultAppServicePlanName'), 'createNewAppServicePlan'))]",
"servicePlanName": "[if(variables('useExistingServicePlan'), parameters('existingAppServicePlanName'), parameters('newAppServicePlanName'))]",
"servicePlanLocation": "[if(variables('useExistingServicePlan'), parameters('existingAppServicePlanLocation'), parameters('newAppServicePlanLocation'))]"
},
"resources": [
{
"comments": "Create a new Linux App Service Plan if no existing App Service Plan name was passed in.",
"comments": "Create a new App Service Plan if no existing App Service Plan name was passed in.",
"type": "Microsoft.Web/serverfarms",
"condition": "[not(variables('useExistingAppServicePlan'))]",
"condition": "[not(variables('useExistingServicePlan'))]",
"name": "[variables('servicePlanName')]",
"apiVersion": "2018-02-01",
"location": "[variables('resourcesLocation')]",
"location": "[parameters('newAppServicePlanLocation')]",
"sku": "[parameters('newAppServicePlanSku')]",
"kind": "linux",
"properties": {
Expand All @@ -101,25 +89,25 @@
}
},
{
"comments": "Create a Web App using a Linux App Service Plan",
"comments": "Create a Web App using an App Service Plan",
"type": "Microsoft.Web/sites",
"apiVersion": "2018-11-01",
"location": "[variables('resourcesLocation')]",
"name": "[parameters('appServiceName')]",
"location": "[variables('servicePlanLocation')]",
"kind": "app,linux",
"dependsOn": [
"[resourceId('Microsoft.Web/serverfarms', variables('servicePlanName'))]"
],
"name": "[variables('webAppName')]",
"properties": {
"name": "[variables('webAppName')]",
"name": "[parameters('appServiceName')]",
"hostNameSslStates": [
{
"name": "[concat(parameters('newWebAppName'), '.azurewebsites.net')]",
"name": "[concat(parameters('appServiceName'), '.azurewebsites.net')]",
"sslState": "Disabled",
"hostType": "Standard"
},
{
"name": "[concat(parameters('newWebAppName'), '.scm.azurewebsites.net')]",
"name": "[concat(parameters('appServiceName'), '.scm.azurewebsites.net')]",
"sslState": "Disabled",
"hostType": "Repository"
}
Expand Down Expand Up @@ -163,10 +151,10 @@
{
"type": "Microsoft.Web/sites/config",
"apiVersion": "2018-11-01",
"name": "[concat(variables('webAppName'), '/web')]",
"location": "[variables('resourcesLocation')]",
"name": "[concat(parameters('appServiceName'), '/web')]",
"location": "[variables('servicePlanLocation')]",
"dependsOn": [
"[resourceId('Microsoft.Web/sites/', variables('webAppName'))]"
"[resourceId('Microsoft.Web/sites', parameters('appServiceName'))]"
],
"properties": {
"numberOfWorkers": 1,
Expand All @@ -188,7 +176,7 @@
"httpLoggingEnabled": false,
"logsDirectorySizeLimit": 35,
"detailedErrorLoggingEnabled": false,
"publishingUsername": "[variables('publishingUsername')]",
"publishingUsername": "[concat('$', parameters('appServiceName'))]",
"scmType": "None",
"use32BitWorkerProcess": true,
"webSocketsEnabled": false,
Expand Down Expand Up @@ -231,30 +219,6 @@
"ftpsState": "AllAllowed",
"reservedInstanceCount": 0
}
},
{
"apiVersion": "2021-03-01",
"type": "Microsoft.BotService/botServices",
"name": "[parameters('botId')]",
"location": "global",
"kind": "azurebot",
"sku": {
"name": "[parameters('botSku')]"
},
"properties": {
"name": "[parameters('botId')]",
"displayName": "[parameters('botId')]",
"iconUrl": "https://docs.botframework.com/static/devportal/client/images/bot-framework-default.png",
"endpoint": "[variables('botEndpoint')]",
"msaAppId": "[parameters('appId')]",
"luisAppIds": [],
"schemaTransformationVersion": "1.3",
"isCmekEnabled": false,
"isIsolated": false
},
"dependsOn": [
"[resourceId('Microsoft.Web/sites/', variables('webAppName'))]"
]
}
]
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
{
"$schema": "https://schema.management.azure.com/schemas/2015-01-01/deploymentTemplate.json#",
"contentVersion": "1.0.0.0",
"parameters": {
"groupName": {
"value": ""
},
"groupLocation": {
"value": ""
},
"azureBotId": {
"value": ""
},
"azureBotSku": {
"value": "S1"
},
"azureBotRegion": {
"value": "global"
},
"botEndpoint": {
"value": ""
},
"appId": {
"value": ""
}
}
}

0 comments on commit b390de2

Please sign in to comment.