* add az group create

* Switch to template-with-preexisting-rg.json

* Fix template args for az deployment sub create

* Fix arg appServicePlanLocation

* Try "call az deployment group create"

* Fix call az deployment group create #4

* Fix facebook pipeline

* Fix facebook call az deployment group create

* Fix template reference

* Fix webex pipeline

* Drop --location "westus"

* Fix windows func test build

* Fix botgroup

* Remove slack refs from windows template

* Add message to "Set up directline keys"
This commit is contained in:
BruceHaley 2020-06-23 15:55:38 -07:00 коммит произвёл GitHub
Родитель ebf495022c
Коммит bb52f9f885
Не найден ключ, соответствующий данной подписи
Идентификатор ключа GPG: 4AEE18F83AFDEB23
6 изменённых файлов: 168 добавлений и 9 удалений

Просмотреть файл

@ -0,0 +1,154 @@
{
"$schema": "https://schema.management.azure.com/schemas/2015-01-01/deploymentTemplate.json#",
"contentVersion": "1.0.0.0",
"parameters": {
"appId": {
"type": "string",
"metadata": {
"description": "Active Directory App ID, set as MicrosoftAppId in the Web App's Application Settings."
}
},
"appSecret": {
"type": "string",
"metadata": {
"description": "Active Directory App Password, set as MicrosoftAppPassword in the Web App's Application Settings. Defaults to \"\"."
}
},
"botId": {
"type": "string",
"metadata": {
"description": "The globally unique and immutable bot ID. Also used to configure the displayName of the bot, which is mutable."
}
},
"botSku": {
"type": "string",
"defaultValue": "F0",
"metadata": {
"description": "The pricing tier of the Bot Service Registration. Acceptable values are F0 and S1."
}
},
"newAppServicePlanName": {
"type": "string",
"defaultValue": "",
"metadata": {
"description": "The name of the new App Service Plan."
}
},
"newAppServicePlanSku": {
"type": "object",
"defaultValue": {
"name": "S1",
"tier": "Standard",
"size": "S1",
"family": "S",
"capacity": 1
},
"metadata": {
"description": "The SKU of the App Service Plan. Defaults to Standard values."
}
},
"appServicePlanLocation": {
"type": "string",
"metadata": {
"description": "The location of the App Service Plan."
}
},
"existingAppServicePlan": {
"type": "string",
"defaultValue": "",
"metadata": {
"description": "Name of the existing App Service Plan used to create the Web App for the bot."
}
},
"newWebAppName": {
"type": "string",
"defaultValue": "",
"metadata": {
"description": "The globally unique name of the Web App. Defaults to the value passed in for \"botId\"."
}
}
},
"variables": {
"defaultAppServicePlanName": "[if(empty(parameters('existingAppServicePlan')), 'createNewAppServicePlan', parameters('existingAppServicePlan'))]",
"useExistingAppServicePlan": "[not(equals(variables('defaultAppServicePlanName'), 'createNewAppServicePlan'))]",
"servicePlanName": "[if(variables('useExistingAppServicePlan'), parameters('existingAppServicePlan'), parameters('newAppServicePlanName'))]",
"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')]"
},
"resources": [
{
"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'))]",
"name": "[variables('servicePlanName')]",
"apiVersion": "2018-02-01",
"location": "[variables('resourcesLocation')]",
"sku": "[parameters('newAppServicePlanSku')]",
"properties": {
"name": "[variables('servicePlanName')]"
}
},
{
"comments": "Create a Web App using an App Service Plan",
"type": "Microsoft.Web/sites",
"apiVersion": "2015-08-01",
"location": "[variables('resourcesLocation')]",
"kind": "app",
"dependsOn": [
"[resourceId('Microsoft.Web/serverfarms/', variables('servicePlanName'))]"
],
"name": "[variables('webAppName')]",
"properties": {
"name": "[variables('webAppName')]",
"serverFarmId": "[variables('servicePlanName')]",
"siteConfig": {
"appSettings": [
{
"name": "WEBSITE_NODE_DEFAULT_VERSION",
"value": "10.14.1"
},
{
"name": "MicrosoftAppId",
"value": "[parameters('appId')]"
},
{
"name": "MicrosoftAppPassword",
"value": "[parameters('appSecret')]"
}
],
"cors": {
"allowedOrigins": [
"https://botservice.hosting.portal.azure.net",
"https://hosting.onecloud.azure-test.net/"
]
}
}
}
},
{
"apiVersion": "2017-12-01",
"type": "Microsoft.BotService/botServices",
"name": "[parameters('botId')]",
"location": "global",
"kind": "bot",
"sku": {
"name": "[parameters('botSku')]"
},
"properties": {
"name": "[parameters('botId')]",
"displayName": "[parameters('botId')]",
"endpoint": "[variables('botEndpoint')]",
"msaAppId": "[parameters('appId')]",
"developerAppInsightsApplicationId": null,
"developerAppInsightKey": null,
"publishingCredentials": null,
"storageResourceId": null
},
"dependsOn": [
"[resourceId('Microsoft.Web/sites/', variables('webAppName'))]"
]
}
]
}

Просмотреть файл

@ -76,7 +76,7 @@
"resourcesLocation": "[parameters('newAppServicePlanLocation')]",
"webAppName": "[if(empty(parameters('newWebAppName')), parameters('botId'), parameters('newWebAppName'))]",
"siteHost": "[concat(variables('webAppName'), '.azurewebsites.net')]",
"botEndpoint": "[concat('https://', variables('siteHost'), '/api/mybot')]"
"botEndpoint": "[concat('https://', variables('siteHost'), '/api/messages')]"
},
"resources": [
{

Просмотреть файл

@ -68,12 +68,13 @@ steps:
modifyOutputPath: false
- task: AzureCLI@1
displayName: 'Deploy bot to Azure'
displayName: 'Create resources, deploy bot'
inputs:
azureSubscription: '$(AzureSubscription)'
azureSubscription: $(AzureSubscription)
scriptLocation: inlineScript
inlineScript: |
call az deployment create --name "$(FacebookTestBotBotGroup)" --template-file "$(System.DefaultWorkingDirectory)\tests\Adapters\Microsoft.Bot.Builder.Adapters.Facebook.PrimaryTestBot\DeploymentTemplates\template-with-new-rg.json" --location "westus" --parameters appId="$(AppId)" appSecret="$(FacebookTestBotAppSecret)" botId="$(FacebookTestBotBotName)" botSku=F0 newAppServicePlanName="$(FacebookTestBotBotName)" newWebAppName="$(FacebookTestBotBotName)" groupName="$(FacebookTestBotBotGroup)" groupLocation="westus" newAppServicePlanLocation="westus" facebookVerifyToken="verifyToken" facebookAppSecret="$(FacebookTestBotFaceBookAppSecret)" facebookAccessToken="$(FacebookTestBotFacebookAccessToken)"
call az group create --location westus --name $(FacebookTestBotBotGroup)
call az deployment group create --resource-group "$(FacebookTestBotBotGroup)" --template-file "$(System.DefaultWorkingDirectory)\tests\Adapters\Microsoft.Bot.Builder.Adapters.Facebook.PrimaryTestBot\DeploymentTemplates\template-with-preexisting-rg.json" --parameters appId="$(AppId)" appSecret="$(FacebookTestBotAppSecret)" botId="$(FacebookTestBotBotName)" botSku=F0 newAppServicePlanName="$(FacebookTestBotBotName)" newWebAppName="$(FacebookTestBotBotName)" appServicePlanLocation="westus" facebookVerifyToken="verifyToken" facebookAppSecret="$(FacebookTestBotFaceBookAppSecret)" facebookAccessToken="$(FacebookTestBotFacebookAccessToken)" --name "$(FacebookTestBotBotName)"
call az webapp deployment source config-zip --resource-group "$(FacebookTestBotBotGroup)" --name "$(FacebookTestBotBotName)" --src "$(System.DefaultWorkingDirectory)\tests\Adapters\Microsoft.Bot.Builder.Adapters.Facebook.PrimaryTestBot\PublishedBot\PublishedBot.zip"
- powershell: |

Просмотреть файл

@ -67,7 +67,7 @@ steps:
displayName: 'Set Environment Variables'
- task: AzureCLI@1
displayName: 'Create Resources'
displayName: 'Create resources, deploy bot'
inputs:
azureSubscription: $(AzureSubscription)
scriptLocation: inlineScript

Просмотреть файл

@ -67,7 +67,8 @@ steps:
azureSubscription: '$(AzureSubscription)'
scriptLocation: inlineScript
inlineScript: |
call az deployment create --name "$(WebexTestBotBotGroup)" --template-file "$(System.DefaultWorkingDirectory)\tests\Adapters\Microsoft.Bot.Builder.Adapters.Webex.TestBot\DeploymentTemplates\template-with-new-rg.json" --location "westus" --parameters appId=$(WebexTestBotAppId) appSecret="$(WebexTestBotAppSecret)" botId="$(WebexTestBotBotName)" botSku=F0 newAppServicePlanName="$(WebexTestBotBotName)" newWebAppName="$(WebexTestBotBotName)" groupName="$(WebexTestBotBotGroup)" groupLocation="westus" newAppServicePlanLocation="westus" webexPublicAddress="$(WebexPublicAddress)" webexAccessToken="$(WebexTestBotWebexBotAccessToken)" webexSecret="$(WebexTestBotWebexWebhookSecret)" webexWebhookName="$(WebexTestBotWebexWebhookName)"
call az group create --location westus --name $(WebexTestBotBotGroup)
call az deployment group create --resource-group "$(WebexTestBotBotGroup)" --template-file "$(System.DefaultWorkingDirectory)\tests\Adapters\Microsoft.Bot.Builder.Adapters.Webex.TestBot\DeploymentTemplates\template-with-preexisting-rg.json" --parameters appId="$(WebexTestBotAppId)" appSecret="$(WebexTestBotAppSecret)" botId="$(WebexTestBotBotName)" botSku=F0 newAppServicePlanName="$(WebexTestBotBotName)" newWebAppName="$(WebexTestBotBotName)" appServicePlanLocation="westus" webexPublicAddress="$(WebexPublicAddress)" webexAccessToken="$(WebexTestBotWebexBotAccessToken)" webexSecret="$(WebexTestBotWebexWebhookSecret)" webexWebhookName="$(WebexTestBotWebexWebhookName)" --name "$(WebexTestBotBotName)"
call az webapp deployment source config-zip --resource-group "$(WebexTestBotBotGroup)" --name "$(WebexTestBotBotName)" --src "$(System.DefaultWorkingDirectory)\tests\Adapters\Microsoft.Bot.Builder.Adapters.Webex.TestBot\PublishedBot\PublishedBot.zip"
- task: AzureCLI@1

Просмотреть файл

@ -53,12 +53,13 @@ steps:
modifyOutputPath: false
- task: AzureCLI@1
displayName: 'Create Resource Group, deploy bot, create DirectLine channel'
displayName: 'Create resources, deploy bot, create DirectLine channel'
inputs:
azureSubscription: $(AzureSubscription)
scriptLocation: inlineScript
inlineScript: |
call az deployment create --name "$(WinTestBotBotGroup)" --template-file "$(System.DefaultWorkingDirectory)\FunctionalTests\ExportedTemplate\template.json" --location "westus" --parameters appId=$(WinTestBotAppId) appSecret="$(WinTestBotAppSecret)" botId="$(WinTestBotBotName)" botSku=F0 newAppServicePlanName="$(WinTestBotBotName)" newWebAppName="$(WinTestBotBotName)" groupName="$(WinTestBotBotGroup)" groupLocation="westus" newAppServicePlanLocation="westus"
call az group create --location westus --name $(WinTestBotBotGroup)
call az deployment group create --resource-group "$(WinTestBotBotGroup)" --template-file "$(System.DefaultWorkingDirectory)\FunctionalTests\ExportedTemplate\template-with-preexisting-rg.json" --parameters appId=$(WinTestBotAppId) appSecret="$(WinTestBotAppSecret)" botId="$(WinTestBotBotName)" botSku=F0 newAppServicePlanName="$(WinTestBotBotName)" newWebAppName="$(WinTestBotBotName)" appServicePlanLocation="westus" --name "$(WinTestBotBotName)"
call az webapp deployment source config-zip --resource-group "$(WinTestBotBotGroup)" --name "$(WinTestBotBotName)" --src "$(System.DefaultWorkingDirectory)\tests\Microsoft.Bot.Builder.TestBot\publishedbot\PublishedBot.zip"
call az bot directline create -n "$(WinTestBotBotName)" -g "$(WinTestBotBotGroup)" > "$(System.DefaultWorkingDirectory)\DirectLineCreate.json"
@ -67,7 +68,9 @@ steps:
$key = $json.properties.properties.sites.key
echo "##vso[task.setvariable variable=DIRECTLINE;]$key"
echo "##vso[task.setvariable variable=BOTID;]$(WinTestBotBotName)"
displayName: 'Get Bot Keys'
Write-Host "DIRECTLINE=$key";
Write-Host "BOTID=$(WinTestBotBotName)";
displayName: 'Set up directline keys'
- task: DotNetCoreCLI@2
displayName: 'dotnet test'