Skip to content
This repository has been archived by the owner on Jun 30, 2022. It is now read-only.

VA Template - New Deployment Features #1843

Merged
merged 34 commits into from
Jul 15, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
34 commits
Select commit Hold shift + click to select a range
c98ba7a
updated VA deployment scripts
lauren-mills Jul 11, 2019
e33f99d
updated skill template
lauren-mills Jul 11, 2019
cd49c4b
updated deployment scripts:
lauren-mills Jul 12, 2019
6600dca
add comments for local lite development
lauren-mills Jul 12, 2019
028017a
updated to latest luisgen format
lauren-mills Jul 12, 2019
59773ed
update to fix luis region issue
lauren-mills Jul 12, 2019
b90c6e0
merged
lauren-mills Jul 12, 2019
5b0cdf1
updated template deployment scripts
lauren-mills Jul 12, 2019
de3f211
template updates
lauren-mills Jul 12, 2019
0af3d07
updated project template file
lauren-mills Jul 12, 2019
89a2c81
added typescript files back
lauren-mills Jul 12, 2019
367ed50
Update automotive.lu
lauren-mills Jul 12, 2019
a8143f6
added typescript files back
lauren-mills Jul 12, 2019
e4dc698
Merge branch 'lamil/deployment_new' of https://github.com/Microsoft/A…
lauren-mills Jul 12, 2019
e95c542
ts fixes
lauren-mills Jul 12, 2019
245094e
Update todo.lu
lauren-mills Jul 12, 2019
146cfb4
Update todo.lu
lauren-mills Jul 12, 2019
954e2dd
Update pointofinterest.lu
lauren-mills Jul 12, 2019
6f6df8d
Update automotive.lu
lauren-mills Jul 12, 2019
fe9782d
Update calendar.lu
lauren-mills Jul 12, 2019
4e2fab1
Update calendar.lu
lauren-mills Jul 12, 2019
b708dd0
Update automotive.lu
lauren-mills Jul 12, 2019
613f157
Update todo.lu
lauren-mills Jul 12, 2019
f91cf29
Update pointofinterest.lu
lauren-mills Jul 12, 2019
3ac4532
Update restaurant.lu
lauren-mills Jul 12, 2019
09cf066
Update restaurant.lu
lauren-mills Jul 12, 2019
eeb2758
updated typescript files
lauren-mills Jul 12, 2019
c73da56
Merge branch 'lamil/deployment_new' of https://github.com/Microsoft/A…
lauren-mills Jul 12, 2019
9ceb9f9
Update restaurant.lu
lauren-mills Jul 12, 2019
2ada91b
Update restaurant.lu
lauren-mills Jul 12, 2019
293d5b9
ts fix
lauren-mills Jul 12, 2019
366e9aa
Merge branch 'lamil/deployment_new' of https://github.com/Microsoft/A…
lauren-mills Jul 12, 2019
a3108af
ts fix
lauren-mills Jul 12, 2019
94157b7
added useLuisGen flag to update script (for build pipeline)
lauren-mills Jul 15, 2019
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,8 @@ public DefaultAdapter(
telemetryClient.TrackException(exception);
};

// Uncomment the following line for local development without Azure Storage
// Use(new TranscriptLoggerMiddleware(new MemoryTranscriptStore()));
Use(new TranscriptLoggerMiddleware(new AzureBlobTranscriptStore(settings.BlobStorage.ConnectionString, settings.BlobStorage.Container)));
Use(new TelemetryLoggerMiddleware(telemetryClient, logPersonalInformation: true));
Use(new ShowTypingMiddleware());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,8 @@ public DefaultWebSocketAdapter(
telemetryClient.TrackException(exception);
};

Use(new TranscriptLoggerMiddleware(new AzureBlobTranscriptStore(settings.BlobStorage.ConnectionString, settings.BlobStorage.Container)));
// Uncomment the following line for local development without Azure Storage
// Use(new TranscriptLoggerMiddleware(new MemoryTranscriptStore())); Use(new TranscriptLoggerMiddleware(new AzureBlobTranscriptStore(settings.BlobStorage.ConnectionString, settings.BlobStorage.Container)));
Use(new TelemetryLoggerMiddleware(telemetryClient, logPersonalInformation: true));
Use(new ShowTypingMiddleware());
Use(new SetLocaleMiddleware(settings.DefaultLocale ?? "en-us"));
Expand Down
Original file line number Diff line number Diff line change
@@ -1,22 +1,33 @@

{
"$schema": "https://schema.management.azure.com/schemas/2015-01-01/deploymentParameters.json#",
"contentVersion": "1.0.0.0",
"parameters": {
"appInsightsLocation": {
"value": "westus2"
"useCosmosDb": {
"value": false
},
"contentModeratorLocation": {
"value": "westus"
"useStorage": {
"value": false
},
"luisServiceLocation": {
"value": "westus"
"useContentModerator": {
"value": false
},
"qnaServiceLocation": {
"value": "westus"
"appServicePlanSku": {
"value": {
"tier": "Free",
"name": "F1"
}
},
"botServiceSku": {
"value": "F0"
},
"luisServiceSku": {
"value": "F0"
},
"qnaMakerServiceSku": {
"value": "F0"
},
"qnaMakerSearchSku": {
"value": "basic"
"value": "free"
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -10,23 +10,35 @@
"type": "string",
"defaultValue": "[resourceGroup().location]"
},
"suffix": {
"type": "string",
"defaultValue": "[take(uniqueString(resourceGroup().id), 7)]"
},
"microsoftAppId": {
"type": "string"
},
"microsoftAppPassword": {
"type": "string"
},
"useCosmosDb": {
"type": "bool",
"defaultValue": true
},
"cosmosDbName": {
"type": "string",
"defaultValue": "[toLower(parameters('name'))]"
"defaultValue": "[concat(parameters('name'), '-', parameters('suffix'))]"
},
"useStorage": {
"type": "bool",
"defaultValue": true
},
"storageAccountName": {
"type": "string",
"defaultValue": "[toLower(parameters('name'))]"
"defaultValue": "[concat(parameters('name'), '-', parameters('suffix'))]"
},
"appServicePlanName": {
"type": "string",
"defaultValue": "[parameters('name')]"
"defaultValue": "[concat(parameters('name'), '-', parameters('suffix'))]"
},
"appServicePlanSku": {
"type": "object",
Expand All @@ -37,27 +49,31 @@
},
"appInsightsName": {
"type": "string",
"defaultValue": "[parameters('name')]"
"defaultValue": "[concat(parameters('name'), '-', parameters('suffix'))]"
},
"appInsightsLocation": {
"type": "string",
"defaultValue": "westus2"
"defaultValue": "[resourceGroup().location]"
},
"botWebAppName": {
"type": "string",
"defaultValue": "[parameters('name')]"
"defaultValue": "[concat(parameters('name'), '-', parameters('suffix'))]"
},
"botServiceName": {
"type": "string",
"defaultValue": "[parameters('name')]"
"defaultValue": "[concat(parameters('name'), '-', parameters('suffix'))]"
},
"botServiceSku": {
"type": "string",
"defaultValue": "S1"
},
"useContentModerator": {
"type": "bool",
"defaultValue": true
},
"contentModeratorName": {
"type": "string",
"defaultValue": "[concat(parameters('name'), '-cm')]"
"defaultValue": "[concat(parameters('name'), '-cm-', parameters('suffix'))]"
},
"contentModeratorSku": {
"type": "string",
Expand All @@ -69,7 +85,7 @@
},
"luisServiceName": {
"type": "string",
"defaultValue": "[concat(parameters('name'), '-luis')]"
"defaultValue": "[concat(parameters('name'), '-luis-', parameters('suffix'))]"
},
"luisServiceSku": {
"type": "string",
Expand All @@ -81,7 +97,7 @@
},
"qnaMakerServiceName": {
"type": "string",
"defaultValue": "[concat(parameters('name'), '-qna')]"
"defaultValue": "[concat(parameters('name'), '-qna-', parameters('suffix'))]"
},
"qnaMakerServiceSku": {
"type": "string",
Expand All @@ -93,20 +109,24 @@
},
"qnaMakerSearchName": {
"type": "string",
"defaultValue": "[toLower(concat(parameters('name'), '-search'))]"
"defaultValue": "[concat(parameters('name'), '-search-', parameters('suffix'))]"
},
"qnaMakerSearchSku": {
"type": "string",
"defaultValue": "standard"
},
"qnaMakerWebAppName": {
"type": "string",
"defaultValue": "[concat(parameters('name'), '-qnahost')]"
"defaultValue": "[concat(parameters('name'), '-qnahost-', parameters('suffix'))]"
}
},
"variables": {
"botEndpoint": "[concat('https://', toLower(parameters('botWebAppName')), '.azurewebsites.net/api/messages')]",
"cleanStorageAccountName": "[toLower(take(replace(replace(parameters('storageAccountName'), '-', ''), '_', ''), 24))]"
"botWebAppName": "[replace(parameters('botWebAppName'), '_', '')]",
"storageAccountName": "[toLower(take(replace(replace(parameters('storageAccountName'), '-', ''), '_', ''), 24))]",
"cosmosDbAccountName": "[toLower(take(replace(parameters('cosmosDbName'), '_', ''), 31))]",
"qnaMakerSearchName": "[toLower(replace(parameters('qnaMakerSearchName'), '_', ''))]",
"qnaMakerWebAppName": "[replace(parameters('qnaMakerWebAppName'), '_', '')]",
"botEndpoint": "[concat('https://', toLower(variables('botWebAppName')), '.azurewebsites.net/api/messages')]"
},
"resources": [
{
Expand All @@ -127,7 +147,7 @@
"type": "Microsoft.DocumentDB/databaseAccounts",
"kind": "GlobalDocumentDB",
"apiVersion": "2015-04-08",
"name": "[parameters('cosmosDbName')]",
"name": "[variables('cosmosDbAccountName')]",
"location": "[parameters('location')]",
"properties": {
"databaseAccountOfferType": "Standard",
Expand All @@ -137,18 +157,20 @@
"failoverPriority": 0
}
]
}
},
"condition": "[parameters('useCosmosDb')]"
},
{
"comments": "storage account",
"type": "Microsoft.Storage/storageAccounts",
"kind": "StorageV2",
"apiVersion": "2018-07-01",
"name": "[variables('cleanStorageAccountName')]",
"name": "[variables('storageAccountName')]",
"location": "[parameters('location')]",
"sku": {
"name": "Standard_LRS"
}
},
"condition": "[parameters('useStorage')]"
},
{
"comments": "app service plan",
Expand All @@ -174,7 +196,7 @@
"comments": "bot web app",
"type": "Microsoft.Web/sites",
"apiVersion": "2018-02-01",
"name": "[parameters('botWebAppName')]",
"name": "[variables('botWebAppName')]",
"location": "[parameters('location')]",
"properties": {
"serverFarmId": "[resourceId('Microsoft.Web/serverfarms', parameters('appServicePlanName'))]",
Expand Down Expand Up @@ -224,7 +246,8 @@
"location": "[parameters('contentModeratorLocation')]",
"sku": {
"name": "[parameters('contentModeratorSku')]"
}
},
"condition": "[parameters('useContentModerator')]"
},
{
"comments": "Cognitive service key for all LUIS apps.",
Expand All @@ -249,20 +272,20 @@
},
"properties": {
"apiProperties": {
"qnaRuntimeEndpoint": "[concat('https://',reference(resourceId('Microsoft.Web/sites', parameters('qnaMakerWebAppName'))).hostNames[0])]"
"qnaRuntimeEndpoint": "[concat('https://',reference(resourceId('Microsoft.Web/sites', variables('qnaMakerWebAppName'))).hostNames[0])]"
}
},
"dependsOn": [
"[resourceId('Microsoft.Web/Sites', parameters('qnaMakerWebAppName'))]",
"[resourceId('Microsoft.Search/searchServices/', parameters('qnaMakerSearchName'))]",
"[resourceId('Microsoft.Web/Sites', variables('qnaMakerWebAppName'))]",
"[resourceId('Microsoft.Search/searchServices/', variables('qnaMakerSearchName'))]",
"[resourceId('microsoft.insights/components/', parameters('appInsightsName'))]"
]
},
{
"comments": "Search service for QnA Maker service.",
"type": "Microsoft.Search/searchServices",
"apiVersion": "2015-08-19",
"name": "[parameters('qnaMakerSearchName')]",
"name": "[variables('qnaMakerSearchName')]",
"location": "[parameters('qnaServiceLocation')]",
"sku": {
"name": "[parameters('qnaMakerSearchSku')]"
Expand All @@ -277,11 +300,11 @@
"comments": "Web app for QnA Maker service.",
"type": "Microsoft.Web/sites",
"apiVersion": "2016-08-01",
"name": "[parameters('qnaMakerWebAppName')]",
"name": "[variables('qnaMakerWebAppName')]",
"location": "[parameters('qnaServiceLocation')]",
"properties": {
"enabled": true,
"name": "[parameters('qnaMakerWebAppName')]",
"name": "[variables('qnaMakerWebAppName')]",
"hostingEnvironment": "",
"serverFarmId": "[concat('/subscriptions/', subscription().id,'/resourcegroups/', resourceGroup().name, '/providers/Microsoft.Web/serverfarms/', parameters('appServicePlanName'))]",
"siteConfig": {
Expand All @@ -301,18 +324,18 @@
"name": "appsettings",
"type": "config",
"dependsOn": [
"[resourceId('Microsoft.Web/Sites', parameters('qnaMakerWebAppName'))]",
"[resourceId('Microsoft.Web/Sites', variables('qnaMakerWebAppName'))]",
"[resourceId('Microsoft.Insights/components', parameters('appInsightsName'))]",
"[resourceId('Microsoft.Search/searchServices/', parameters('qnaMakerSearchName'))]"
"[resourceId('Microsoft.Search/searchServices/', variables('qnaMakerSearchName'))]"
],
"properties": {
"AzureSearchName": "[parameters('qnaMakerSearchName')]",
"AzureSearchAdminKey": "[listAdminKeys(resourceId('Microsoft.Search/searchServices/', parameters('qnaMakerSearchName')), '2015-08-19').primaryKey]",
"AzureSearchName": "[variables('qnaMakerSearchName')]",
"AzureSearchAdminKey": "[listAdminKeys(resourceId('Microsoft.Search/searchServices/', variables('qnaMakerSearchName')), '2015-08-19').primaryKey]",
"UserAppInsightsKey": "[reference(resourceId('Microsoft.Insights/components/', parameters('appInsightsName')), '2015-05-01').InstrumentationKey]",
"UserAppInsightsName": "[parameters('appInsightsName')]",
"UserAppInsightsAppId": "[reference(resourceId('Microsoft.Insights/components/', parameters('appInsightsName')), '2015-05-01').AppId]",
"PrimaryEndpointKey": "[concat(parameters('qnaMakerWebAppName'), '-PrimaryEndpointKey')]",
"SecondaryEndpointKey": "[concat(parameters('qnaMakerWebAppName'), '-SecondaryEndpointKey')]",
"PrimaryEndpointKey": "[concat(variables('qnaMakerWebAppName'), '-PrimaryEndpointKey')]",
"SecondaryEndpointKey": "[concat(variables('qnaMakerWebAppName'), '-SecondaryEndpointKey')]",
"DefaultAnswer": "No good match found in KB.",
"QNAMAKER_EXTENSION_VERSION": "latest"
}
Expand All @@ -323,7 +346,7 @@
"outputs": {
"botWebAppName": {
"type": "string",
"value": "[parameters('botWebAppName')]"
"value": "[variables('botWebAppName')]"
},
"ApplicationInsights": {
"type": "object",
Expand All @@ -334,15 +357,15 @@
"blobStorage": {
"type": "object",
"value": {
"connectionString": "[concat('DefaultEndpointsProtocol=https;AccountName=', variables('cleanStorageAccountName'), ';AccountKey=', listKeys(resourceId('Microsoft.Storage/storageAccounts', variables('cleanStorageAccountName')), '2018-07-01').keys[0].value, ';EndpointSuffix=core.windows.net')]",
"connectionString": "[if(parameters('useStorage'), concat('DefaultEndpointsProtocol=https;AccountName=', variables('storageAccountName'), ';AccountKey=', listKeys(resourceId('Microsoft.Storage/storageAccounts', variables('storageAccountName')), '2018-07-01').keys[0].value, ';EndpointSuffix=core.windows.net'), '')]",
"container": "transcripts"
}
},
"cosmosDb": {
"type": "object",
"value": {
"cosmosDBEndpoint": "[reference(resourceId('Microsoft.DocumentDB/databaseAccounts', parameters('cosmosDbName'))).documentEndpoint]",
"authKey": "[listKeys(resourceId('Microsoft.DocumentDB/databaseAccounts', parameters('cosmosDbName')), '2015-04-08').primaryMasterKey]",
"cosmosDBEndpoint": "[if(parameters('useCosmosDb'), reference(resourceId('Microsoft.DocumentDB/databaseAccounts', variables('cosmosDbAccountName'))).documentEndpoint, '')]",
"authKey": "[if(parameters('useCosmosDb'), listKeys(resourceId('Microsoft.DocumentDB/databaseAccounts', variables('cosmosDbAccountName')), '2015-04-08').primaryMasterKey, '')]",
"databaseId": "botstate-db",
"collectionId": "botstate-collection"
}
Expand All @@ -351,20 +374,21 @@
"type": "object",
"value": {
"accountName": "[parameters('luisServiceName')]",
"region": "[parameters('luisServiceLocation')]",
"key": "[listKeys(resourceId('Microsoft.CognitiveServices/accounts', parameters('luisServiceName')),'2017-04-18').key1]"
}
},
"qnaMaker": {
"type": "object",
"value": {
"endpoint": "[concat('https://', reference(resourceId('Microsoft.Web/sites', parameters('qnaMakerWebAppName'))).hostNames[0])]",
"endpoint": "[concat('https://', reference(resourceId('Microsoft.Web/sites', variables('qnaMakerWebAppName'))).hostNames[0])]",
"key": "[listKeys(resourceId('Microsoft.CognitiveServices/accounts', parameters('qnaMakerServiceName')),'2017-04-18').key1]"
}
},
"contentModerator": {
"type": "object",
"value": {
"key": "[listKeys(resourceId('Microsoft.CognitiveServices/accounts', parameters('contentModeratorName')),'2017-04-18').key1]"
"key": "[if(parameters('useContentModerator'), listKeys(resourceId('Microsoft.CognitiveServices/accounts', parameters('contentModeratorName')),'2017-04-18').key1, '')]"
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ if (-not $appId) {
# Create app registration
$app = (az ad app create `
--display-name $name `
--password $appPassword `
--password `"$($appPassword)`" `
--available-to-other-tenants `
--reply-urls 'https://token.botframework.com/.auth/web/redirect')

Expand Down Expand Up @@ -198,7 +198,7 @@ if ($outputs)
Start-Sleep -s 30

# Deploy cognitive models
Invoke-Expression "& '$(Join-Path $PSScriptRoot 'deploy_cognitive_models.ps1')' -name $($name) -luisAuthoringRegion $($luisAuthoringRegion) -luisAuthoringKey $($luisAuthoringKey) -luisAccountName $($outputs.luis.value.accountName) -luisSubscriptionKey $($outputs.luis.value.key) -resourceGroup $($resourceGroup) -qnaSubscriptionKey '$($qnaSubscriptionKey)' -outFolder '$($projDir)' -languages '$($languages)'"
Invoke-Expression "& '$(Join-Path $PSScriptRoot 'deploy_cognitive_models.ps1')' -name $($name) -luisAuthoringRegion $($luisAuthoringRegion) -luisAuthoringKey $($luisAuthoringKey) -luisAccountName $($outputs.luis.value.accountName) -luisAccountRegion $($outputs.luis.value.region) -luisSubscriptionKey $($outputs.luis.value.key) -resourceGroup $($resourceGroup) -qnaSubscriptionKey '$($qnaSubscriptionKey)' -outFolder '$($projDir)' -languages '$($languages)'"

# Publish bot
Invoke-Expression "& '$(Join-Path $PSScriptRoot 'publish.ps1')' -name $($outputs.botWebAppName.value) -resourceGroup $($resourceGroup) -projFolder '$($projDir)'"
Expand Down
Loading