diff --git a/skills/src/csharp/automotiveskill/automotiveskill/Deployment/Scripts/deploy.ps1 b/skills/src/csharp/automotiveskill/automotiveskill/Deployment/Scripts/deploy.ps1 index 2ec874cf98..42e2c12e50 100644 --- a/skills/src/csharp/automotiveskill/automotiveskill/Deployment/Scripts/deploy.ps1 +++ b/skills/src/csharp/automotiveskill/automotiveskill/Deployment/Scripts/deploy.ps1 @@ -187,7 +187,7 @@ if ($outputs) # Update appsettings.json Write-Host "> Updating appsettings.json ..." if (Test-Path $(Join-Path $projDir appsettings.json)) { - $settings = Get-Content $(Join-Path $projDir appsettings.json) | ConvertFrom-Json + $settings = Get-Content -Encoding utf8 $(Join-Path $projDir appsettings.json) | ConvertFrom-Json } else { $settings = New-Object PSObject @@ -196,7 +196,7 @@ if ($outputs) $settings | Add-Member -Type NoteProperty -Force -Name 'microsoftAppId' -Value $appId $settings | Add-Member -Type NoteProperty -Force -Name 'microsoftAppPassword' -Value $appPassword foreach ($key in $outputMap.Keys) { $settings | Add-Member -Type NoteProperty -Force -Name $key -Value $outputMap[$key].value } - $settings | ConvertTo-Json -depth 100 | Out-File $(Join-Path $projDir appsettings.json) + $settings | ConvertTo-Json -depth 100 | Out-File -Encoding utf8 $(Join-Path $projDir appsettings.json) if ($outputs.qnaMaker.value.key) { $qnaSubscriptionKey = $outputs.qnaMaker.value.key } @@ -206,6 +206,13 @@ if ($outputs) # Deploy cognitive models 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)'" + # Summary + Write-Host "Summary of the deployed resources:" -ForegroundColor Yellow + + Write-Host "- Resource Group: $($resourceGroup)" -ForegroundColor Yellow + + Write-Host "- Bot Web App: $($outputs.botWebAppName.value)`n" -ForegroundColor Yellow + # Publish bot Invoke-Expression "& '$(Join-Path $PSScriptRoot 'publish.ps1')' -name $($outputs.botWebAppName.value) -resourceGroup $($resourceGroup) -projFolder '$($projDir)'" diff --git a/skills/src/csharp/automotiveskill/automotiveskill/Deployment/Scripts/deploy_cognitive_models.ps1 b/skills/src/csharp/automotiveskill/automotiveskill/Deployment/Scripts/deploy_cognitive_models.ps1 index ddd21d0b3f..1d5c73b58f 100644 --- a/skills/src/csharp/automotiveskill/automotiveskill/Deployment/Scripts/deploy_cognitive_models.ps1 +++ b/skills/src/csharp/automotiveskill/automotiveskill/Deployment/Scripts/deploy_cognitive_models.ps1 @@ -297,4 +297,4 @@ foreach ($language in $languageArr) } # Write out config to file -$settings | ConvertTo-Json -depth 100 | Out-File $(Join-Path $outFolder "cognitivemodels.json" ) \ No newline at end of file +$settings | ConvertTo-Json -depth 100 | Out-File -Encoding utf8 $(Join-Path $outFolder "cognitivemodels.json" ) \ No newline at end of file diff --git a/skills/src/csharp/automotiveskill/automotiveskill/Deployment/Scripts/update_cognitive_models.ps1 b/skills/src/csharp/automotiveskill/automotiveskill/Deployment/Scripts/update_cognitive_models.ps1 index dd371f067b..33ce888873 100644 --- a/skills/src/csharp/automotiveskill/automotiveskill/Deployment/Scripts/update_cognitive_models.ps1 +++ b/skills/src/csharp/automotiveskill/automotiveskill/Deployment/Scripts/update_cognitive_models.ps1 @@ -24,7 +24,7 @@ else { Write-Host "> Getting config file ..." $languageMap = @{ } -$config = Get-Content -Raw -Path $configFile | ConvertFrom-Json +$config = Get-Content -Encoding utf8 -Raw -Path $configFile | ConvertFrom-Json $config.cognitiveModels.PSObject.Properties | Foreach-Object { $languageMap[$_.Name] = $_.Value } foreach ($langCode in $languageMap.Keys) { diff --git a/skills/src/csharp/calendarskill/calendarskill/Deployment/Scripts/deploy.ps1 b/skills/src/csharp/calendarskill/calendarskill/Deployment/Scripts/deploy.ps1 index 2ec874cf98..42e2c12e50 100644 --- a/skills/src/csharp/calendarskill/calendarskill/Deployment/Scripts/deploy.ps1 +++ b/skills/src/csharp/calendarskill/calendarskill/Deployment/Scripts/deploy.ps1 @@ -187,7 +187,7 @@ if ($outputs) # Update appsettings.json Write-Host "> Updating appsettings.json ..." if (Test-Path $(Join-Path $projDir appsettings.json)) { - $settings = Get-Content $(Join-Path $projDir appsettings.json) | ConvertFrom-Json + $settings = Get-Content -Encoding utf8 $(Join-Path $projDir appsettings.json) | ConvertFrom-Json } else { $settings = New-Object PSObject @@ -196,7 +196,7 @@ if ($outputs) $settings | Add-Member -Type NoteProperty -Force -Name 'microsoftAppId' -Value $appId $settings | Add-Member -Type NoteProperty -Force -Name 'microsoftAppPassword' -Value $appPassword foreach ($key in $outputMap.Keys) { $settings | Add-Member -Type NoteProperty -Force -Name $key -Value $outputMap[$key].value } - $settings | ConvertTo-Json -depth 100 | Out-File $(Join-Path $projDir appsettings.json) + $settings | ConvertTo-Json -depth 100 | Out-File -Encoding utf8 $(Join-Path $projDir appsettings.json) if ($outputs.qnaMaker.value.key) { $qnaSubscriptionKey = $outputs.qnaMaker.value.key } @@ -206,6 +206,13 @@ if ($outputs) # Deploy cognitive models 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)'" + # Summary + Write-Host "Summary of the deployed resources:" -ForegroundColor Yellow + + Write-Host "- Resource Group: $($resourceGroup)" -ForegroundColor Yellow + + Write-Host "- Bot Web App: $($outputs.botWebAppName.value)`n" -ForegroundColor Yellow + # Publish bot Invoke-Expression "& '$(Join-Path $PSScriptRoot 'publish.ps1')' -name $($outputs.botWebAppName.value) -resourceGroup $($resourceGroup) -projFolder '$($projDir)'" diff --git a/skills/src/csharp/calendarskill/calendarskill/Deployment/Scripts/deploy_cognitive_models.ps1 b/skills/src/csharp/calendarskill/calendarskill/Deployment/Scripts/deploy_cognitive_models.ps1 index ddd21d0b3f..1d5c73b58f 100644 --- a/skills/src/csharp/calendarskill/calendarskill/Deployment/Scripts/deploy_cognitive_models.ps1 +++ b/skills/src/csharp/calendarskill/calendarskill/Deployment/Scripts/deploy_cognitive_models.ps1 @@ -297,4 +297,4 @@ foreach ($language in $languageArr) } # Write out config to file -$settings | ConvertTo-Json -depth 100 | Out-File $(Join-Path $outFolder "cognitivemodels.json" ) \ No newline at end of file +$settings | ConvertTo-Json -depth 100 | Out-File -Encoding utf8 $(Join-Path $outFolder "cognitivemodels.json" ) \ No newline at end of file diff --git a/skills/src/csharp/calendarskill/calendarskill/Deployment/Scripts/update_cognitive_models.ps1 b/skills/src/csharp/calendarskill/calendarskill/Deployment/Scripts/update_cognitive_models.ps1 index dd371f067b..33ce888873 100644 --- a/skills/src/csharp/calendarskill/calendarskill/Deployment/Scripts/update_cognitive_models.ps1 +++ b/skills/src/csharp/calendarskill/calendarskill/Deployment/Scripts/update_cognitive_models.ps1 @@ -24,7 +24,7 @@ else { Write-Host "> Getting config file ..." $languageMap = @{ } -$config = Get-Content -Raw -Path $configFile | ConvertFrom-Json +$config = Get-Content -Encoding utf8 -Raw -Path $configFile | ConvertFrom-Json $config.cognitiveModels.PSObject.Properties | Foreach-Object { $languageMap[$_.Name] = $_.Value } foreach ($langCode in $languageMap.Keys) { diff --git a/skills/src/csharp/emailskill/emailskill/Deployment/Scripts/deploy.ps1 b/skills/src/csharp/emailskill/emailskill/Deployment/Scripts/deploy.ps1 index 2ec874cf98..42e2c12e50 100644 --- a/skills/src/csharp/emailskill/emailskill/Deployment/Scripts/deploy.ps1 +++ b/skills/src/csharp/emailskill/emailskill/Deployment/Scripts/deploy.ps1 @@ -187,7 +187,7 @@ if ($outputs) # Update appsettings.json Write-Host "> Updating appsettings.json ..." if (Test-Path $(Join-Path $projDir appsettings.json)) { - $settings = Get-Content $(Join-Path $projDir appsettings.json) | ConvertFrom-Json + $settings = Get-Content -Encoding utf8 $(Join-Path $projDir appsettings.json) | ConvertFrom-Json } else { $settings = New-Object PSObject @@ -196,7 +196,7 @@ if ($outputs) $settings | Add-Member -Type NoteProperty -Force -Name 'microsoftAppId' -Value $appId $settings | Add-Member -Type NoteProperty -Force -Name 'microsoftAppPassword' -Value $appPassword foreach ($key in $outputMap.Keys) { $settings | Add-Member -Type NoteProperty -Force -Name $key -Value $outputMap[$key].value } - $settings | ConvertTo-Json -depth 100 | Out-File $(Join-Path $projDir appsettings.json) + $settings | ConvertTo-Json -depth 100 | Out-File -Encoding utf8 $(Join-Path $projDir appsettings.json) if ($outputs.qnaMaker.value.key) { $qnaSubscriptionKey = $outputs.qnaMaker.value.key } @@ -206,6 +206,13 @@ if ($outputs) # Deploy cognitive models 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)'" + # Summary + Write-Host "Summary of the deployed resources:" -ForegroundColor Yellow + + Write-Host "- Resource Group: $($resourceGroup)" -ForegroundColor Yellow + + Write-Host "- Bot Web App: $($outputs.botWebAppName.value)`n" -ForegroundColor Yellow + # Publish bot Invoke-Expression "& '$(Join-Path $PSScriptRoot 'publish.ps1')' -name $($outputs.botWebAppName.value) -resourceGroup $($resourceGroup) -projFolder '$($projDir)'" diff --git a/skills/src/csharp/emailskill/emailskill/Deployment/Scripts/deploy_cognitive_models.ps1 b/skills/src/csharp/emailskill/emailskill/Deployment/Scripts/deploy_cognitive_models.ps1 index ddd21d0b3f..1d5c73b58f 100644 --- a/skills/src/csharp/emailskill/emailskill/Deployment/Scripts/deploy_cognitive_models.ps1 +++ b/skills/src/csharp/emailskill/emailskill/Deployment/Scripts/deploy_cognitive_models.ps1 @@ -297,4 +297,4 @@ foreach ($language in $languageArr) } # Write out config to file -$settings | ConvertTo-Json -depth 100 | Out-File $(Join-Path $outFolder "cognitivemodels.json" ) \ No newline at end of file +$settings | ConvertTo-Json -depth 100 | Out-File -Encoding utf8 $(Join-Path $outFolder "cognitivemodels.json" ) \ No newline at end of file diff --git a/skills/src/csharp/emailskill/emailskill/Deployment/Scripts/update_cognitive_models.ps1 b/skills/src/csharp/emailskill/emailskill/Deployment/Scripts/update_cognitive_models.ps1 index dd371f067b..33ce888873 100644 --- a/skills/src/csharp/emailskill/emailskill/Deployment/Scripts/update_cognitive_models.ps1 +++ b/skills/src/csharp/emailskill/emailskill/Deployment/Scripts/update_cognitive_models.ps1 @@ -24,7 +24,7 @@ else { Write-Host "> Getting config file ..." $languageMap = @{ } -$config = Get-Content -Raw -Path $configFile | ConvertFrom-Json +$config = Get-Content -Encoding utf8 -Raw -Path $configFile | ConvertFrom-Json $config.cognitiveModels.PSObject.Properties | Foreach-Object { $languageMap[$_.Name] = $_.Value } foreach ($langCode in $languageMap.Keys) { diff --git a/skills/src/csharp/experimental/bingsearchskill/bingsearchskill/Deployment/Scripts/deploy.ps1 b/skills/src/csharp/experimental/bingsearchskill/bingsearchskill/Deployment/Scripts/deploy.ps1 index 2ec874cf98..42e2c12e50 100644 --- a/skills/src/csharp/experimental/bingsearchskill/bingsearchskill/Deployment/Scripts/deploy.ps1 +++ b/skills/src/csharp/experimental/bingsearchskill/bingsearchskill/Deployment/Scripts/deploy.ps1 @@ -187,7 +187,7 @@ if ($outputs) # Update appsettings.json Write-Host "> Updating appsettings.json ..." if (Test-Path $(Join-Path $projDir appsettings.json)) { - $settings = Get-Content $(Join-Path $projDir appsettings.json) | ConvertFrom-Json + $settings = Get-Content -Encoding utf8 $(Join-Path $projDir appsettings.json) | ConvertFrom-Json } else { $settings = New-Object PSObject @@ -196,7 +196,7 @@ if ($outputs) $settings | Add-Member -Type NoteProperty -Force -Name 'microsoftAppId' -Value $appId $settings | Add-Member -Type NoteProperty -Force -Name 'microsoftAppPassword' -Value $appPassword foreach ($key in $outputMap.Keys) { $settings | Add-Member -Type NoteProperty -Force -Name $key -Value $outputMap[$key].value } - $settings | ConvertTo-Json -depth 100 | Out-File $(Join-Path $projDir appsettings.json) + $settings | ConvertTo-Json -depth 100 | Out-File -Encoding utf8 $(Join-Path $projDir appsettings.json) if ($outputs.qnaMaker.value.key) { $qnaSubscriptionKey = $outputs.qnaMaker.value.key } @@ -206,6 +206,13 @@ if ($outputs) # Deploy cognitive models 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)'" + # Summary + Write-Host "Summary of the deployed resources:" -ForegroundColor Yellow + + Write-Host "- Resource Group: $($resourceGroup)" -ForegroundColor Yellow + + Write-Host "- Bot Web App: $($outputs.botWebAppName.value)`n" -ForegroundColor Yellow + # Publish bot Invoke-Expression "& '$(Join-Path $PSScriptRoot 'publish.ps1')' -name $($outputs.botWebAppName.value) -resourceGroup $($resourceGroup) -projFolder '$($projDir)'" diff --git a/skills/src/csharp/experimental/bingsearchskill/bingsearchskill/Deployment/Scripts/deploy_cognitive_models.ps1 b/skills/src/csharp/experimental/bingsearchskill/bingsearchskill/Deployment/Scripts/deploy_cognitive_models.ps1 index ddd21d0b3f..1d5c73b58f 100644 --- a/skills/src/csharp/experimental/bingsearchskill/bingsearchskill/Deployment/Scripts/deploy_cognitive_models.ps1 +++ b/skills/src/csharp/experimental/bingsearchskill/bingsearchskill/Deployment/Scripts/deploy_cognitive_models.ps1 @@ -297,4 +297,4 @@ foreach ($language in $languageArr) } # Write out config to file -$settings | ConvertTo-Json -depth 100 | Out-File $(Join-Path $outFolder "cognitivemodels.json" ) \ No newline at end of file +$settings | ConvertTo-Json -depth 100 | Out-File -Encoding utf8 $(Join-Path $outFolder "cognitivemodels.json" ) \ No newline at end of file diff --git a/skills/src/csharp/experimental/bingsearchskill/bingsearchskill/Deployment/Scripts/update_cognitive_models.ps1 b/skills/src/csharp/experimental/bingsearchskill/bingsearchskill/Deployment/Scripts/update_cognitive_models.ps1 index dd371f067b..33ce888873 100644 --- a/skills/src/csharp/experimental/bingsearchskill/bingsearchskill/Deployment/Scripts/update_cognitive_models.ps1 +++ b/skills/src/csharp/experimental/bingsearchskill/bingsearchskill/Deployment/Scripts/update_cognitive_models.ps1 @@ -24,7 +24,7 @@ else { Write-Host "> Getting config file ..." $languageMap = @{ } -$config = Get-Content -Raw -Path $configFile | ConvertFrom-Json +$config = Get-Content -Encoding utf8 -Raw -Path $configFile | ConvertFrom-Json $config.cognitiveModels.PSObject.Properties | Foreach-Object { $languageMap[$_.Name] = $_.Value } foreach ($langCode in $languageMap.Keys) { diff --git a/skills/src/csharp/experimental/eventskill/Deployment/Scripts/deploy.ps1 b/skills/src/csharp/experimental/eventskill/Deployment/Scripts/deploy.ps1 index 2ec874cf98..42e2c12e50 100644 --- a/skills/src/csharp/experimental/eventskill/Deployment/Scripts/deploy.ps1 +++ b/skills/src/csharp/experimental/eventskill/Deployment/Scripts/deploy.ps1 @@ -187,7 +187,7 @@ if ($outputs) # Update appsettings.json Write-Host "> Updating appsettings.json ..." if (Test-Path $(Join-Path $projDir appsettings.json)) { - $settings = Get-Content $(Join-Path $projDir appsettings.json) | ConvertFrom-Json + $settings = Get-Content -Encoding utf8 $(Join-Path $projDir appsettings.json) | ConvertFrom-Json } else { $settings = New-Object PSObject @@ -196,7 +196,7 @@ if ($outputs) $settings | Add-Member -Type NoteProperty -Force -Name 'microsoftAppId' -Value $appId $settings | Add-Member -Type NoteProperty -Force -Name 'microsoftAppPassword' -Value $appPassword foreach ($key in $outputMap.Keys) { $settings | Add-Member -Type NoteProperty -Force -Name $key -Value $outputMap[$key].value } - $settings | ConvertTo-Json -depth 100 | Out-File $(Join-Path $projDir appsettings.json) + $settings | ConvertTo-Json -depth 100 | Out-File -Encoding utf8 $(Join-Path $projDir appsettings.json) if ($outputs.qnaMaker.value.key) { $qnaSubscriptionKey = $outputs.qnaMaker.value.key } @@ -206,6 +206,13 @@ if ($outputs) # Deploy cognitive models 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)'" + # Summary + Write-Host "Summary of the deployed resources:" -ForegroundColor Yellow + + Write-Host "- Resource Group: $($resourceGroup)" -ForegroundColor Yellow + + Write-Host "- Bot Web App: $($outputs.botWebAppName.value)`n" -ForegroundColor Yellow + # Publish bot Invoke-Expression "& '$(Join-Path $PSScriptRoot 'publish.ps1')' -name $($outputs.botWebAppName.value) -resourceGroup $($resourceGroup) -projFolder '$($projDir)'" diff --git a/skills/src/csharp/experimental/eventskill/Deployment/Scripts/deploy_cognitive_models.ps1 b/skills/src/csharp/experimental/eventskill/Deployment/Scripts/deploy_cognitive_models.ps1 index 361af45fa9..1d5c73b58f 100644 --- a/skills/src/csharp/experimental/eventskill/Deployment/Scripts/deploy_cognitive_models.ps1 +++ b/skills/src/csharp/experimental/eventskill/Deployment/Scripts/deploy_cognitive_models.ps1 @@ -61,7 +61,7 @@ if (-not $luisAuthoringKey) { } if (-not $luisAccountName) { - $luisAccountName = Read-Host "? LUIS Service Name (exising service in Azure required)" + $luisAccountName = Read-Host "? LUIS Service Name (existing service in Azure required)" } if (-not $resourceGroup) { @@ -70,7 +70,7 @@ if (-not $resourceGroup) { $rgExists = az group exists -n $resourceGroup --output json if ($rgExists -eq "false") { - $resourceGroup = Read-Host "? LUIS Service Resource Group (exising service in Azure required)" + $resourceGroup = Read-Host "? LUIS Service Resource Group (existing service in Azure required)" } } @@ -181,10 +181,10 @@ foreach ($language in $languageArr) $config.languageModels += @{ id = $lu.BaseName name = $luisApp.name - appid = $luisApp.id - authoringkey = $luisAuthoringKey + appId = $luisApp.id + authoringKey = $luisAuthoringKey authoringRegion = $luisAuthoringRegion - subscriptionkey = $luisSubscriptionKey + subscriptionKey = $luisSubscriptionKey version = $luisApp.activeVersion region = $luisAccountRegion } @@ -283,10 +283,10 @@ foreach ($language in $languageArr) $config.dispatchModel = @{ type = "dispatch" name = $dispatchApp.name - appid = $dispatchApp.appId - authoringkey = $luisauthoringkey + appId = $dispatchApp.appId + authoringKey = $luisauthoringkey authoringRegion = $luisAuthoringRegion - subscriptionkey = $luisSubscriptionKey + subscriptionKey = $luisSubscriptionKey region = $luisAccountRegion } } @@ -297,4 +297,4 @@ foreach ($language in $languageArr) } # Write out config to file -$settings | ConvertTo-Json -depth 100 | Out-File $(Join-Path $outFolder "cognitivemodels.json" ) \ No newline at end of file +$settings | ConvertTo-Json -depth 100 | Out-File -Encoding utf8 $(Join-Path $outFolder "cognitivemodels.json" ) \ No newline at end of file diff --git a/skills/src/csharp/experimental/eventskill/Deployment/Scripts/qna_functions.ps1 b/skills/src/csharp/experimental/eventskill/Deployment/Scripts/qna_functions.ps1 index 0da139daa8..cac35fae67 100644 --- a/skills/src/csharp/experimental/eventskill/Deployment/Scripts/qna_functions.ps1 +++ b/skills/src/csharp/experimental/eventskill/Deployment/Scripts/qna_functions.ps1 @@ -1,112 +1,87 @@ -function DeployLUIS ($name, $lu_file, $region, $luisAuthoringKey, $language, $log) +function DeployKB ($name, $lu_file, $qnaSubscriptionKey, $log) { $id = $lu_file.BaseName - $outFile = "$($id).luis" + $outFile = "$($id).qna" $outFolder = $lu_file.DirectoryName - $appName = "$($name)$($langCode)_$($id)" - + # Parse LU file Write-Host "> Parsing $($id) LU file ..." - ludown parse toluis ` + ludown parse toqna ` --in $lu_file ` - --luis_culture $language ` --out_folder $outFolder ` - --out $outFile + --out $outFile - # Create LUIS app - Write-Host "> Deploying $($id) LUIS app ..." - $luisApp = (luis import application ` - --appName $appName ` - --authoringKey $luisAuthoringKey ` - --subscriptionKey $luisAuthoringKey ` - --region $region ` - --in "$(Join-Path $outFolder $outFile)" ` - --wait) 2>> $log | ConvertFrom-Json + # Create QnA Maker kb + Write-Host "> Deploying $($id) QnA kb ..." + + # These values pretty much guarantee success. We can decrease them if the QnA backend gets faster + $initialDelaySeconds = 30; + $retryAttemptsRemaining = 3; + $retryDelaySeconds = 15; + $retryDelayIncrease = 30; + + while ($retryAttemptsRemaining -ge 0) { + $qnaKb = (qnamaker create kb ` + --name $id ` + --subscriptionKey $qnaSubscriptionKey ` + --in $(Join-Path $outFolder $outFile) ` + --force ` + --wait ` + --msbot) 2>> $log + + if (-not $qnaKb) { + $retryAttemptsRemaining = $retryAttemptsRemaining - 1 + Write-Host $retryAttemptsRemaining + Start-Sleep -s $retryDelaySeconds + $retryDelaySeconds += $retryDelayIncrease + + if ($retryAttemptsRemaining -lt 0) { + Write-Host "! Unable to create QnA KB." -ForegroundColor Cyan + } + else { + Write-Host "> Retrying ..." + Continue + } + } + else { + Break + } + } - if (-not $luisApp) { - Write-Host "! Could not deploy LUIS model. Review the log for more information." -ForegroundColor DarkRed + if (-not $qnaKb) { + Write-Host "! Could not deploy knowledgebase. Review the log for more information." -ForegroundColor DarkRed Write-Host "! Log: $($log)" -ForegroundColor DarkRed Return $null } else { - # train and publish luis app - $(luis train version --appId $luisApp.id --region $region --authoringKey $luisAuthoringKey --versionId $luisApp.activeVersion --wait - & luis publish version --appId $luisApp.id --region $region --authoringKey $luisAuthoringKey --versionId $luisApp.activeVersion --wait) 2>> $log | Out-Null + $qnaKb = $qnaKb | ConvertFrom-Json - Return $luisApp + # Publish QnA Maker knowledgebase + $(qnamaker publish kb --kbId $qnaKb.kbId --subscriptionKey $qnaSubscriptionKey) 2>> $log | Out-Null + + Return $qnaKb } } -function UpdateLUIS ($lu_file, $appId, $version, $region, $authoringKey, $subscriptionKey, $log) +function UpdateKB ($lu_file, $kbId, $qnaSubscriptionKey) { $id = $lu_file.BaseName - $outFile = "$($id).luis" + $outFile = "$($id).qna" $outFolder = $lu_file.DirectoryName - $luisApp = luis get application --appId $appId --region $region --authoringKey $authoringKey | ConvertFrom-Json - # Parse LU file Write-Host "> Parsing $($id) LU file ..." - ludown parse toluis ` + ludown parse toqna ` --in $lu_file ` - --luis_culture $luisApp.culture ` --out_folder $outFolder ` --out $outFile - - Write-Host "> Getting current versions ..." - # Get list of current versions - $versions = luis list versions ` - --appId $appId ` - --region $region ` - --authoringKey $authoringKey | ConvertFrom-Json - - # If the current version exists - if ($versions | Where { $_.version -eq $version }) - { - # delete any old backups - if ($versions | Where { $_.version -eq "backup" }) - { - Write-Host "> Deleting old backup version ..." - luis delete version ` - --appId $appId ` - --versionId "backup" ` - --region $region ` - --authoringKey $authoringKey ` - --force --wait | Out-Null - } - - # rename the active version to backup - Write-Host "> Saving current version as backup ..." - luis rename version ` - --appId $appId ` - --versionId $version ` - --region $region ` - --newVersionId backup ` - --authoringKey $authoringKey ` - --subscriptionKey $subscriptionKey ` - --wait | Out-Null - } - - # import the new 0.1 version from the .luis file - Write-Host "> Importing new version ..." - luis import version ` - --appId $appId ` - --versionId $version ` - --region $region ` - --authoringKey $authoringKey ` - --subscriptionKey $subscriptionKey ` - --in "$(Join-Path $outFolder $outFile)" ` - --wait | ConvertFrom-Json - - # train and publish luis app - $(luis train version --appId $appId --region $region --authoringKey $authoringKey --versionId $version --wait - & luis publish version --appId $appId --region $region --authoringKey $authoringKey --versionId $version --wait) 2>> $log | Out-Null -} -function RunLuisGen($lu_file, $outName, $outFolder) { - $id = $lu_file.BaseName - $luisFolder = $lu_file.DirectoryName - $luisFile = Join-Path $luisFolder "$($id).luis" + Write-Host "> Replacing $($id) QnA kb ..." + qnamaker replace kb ` + --in $(Join-Path $outFolder $outFile) ` + --kbId $kbId ` + --subscriptionKey $qnaSubscriptionKey - luisgen $luisFile -cs "$($outName)Luis" -o $outFolder -} \ No newline at end of file + # Publish QnA Maker knowledgebase + $(qnamaker publish kb --kbId $kbId --subscriptionKey $qnaSubscriptionKey) 2>&1 | Out-Null +} diff --git a/skills/src/csharp/experimental/eventskill/Deployment/Scripts/update_cognitive_models.ps1 b/skills/src/csharp/experimental/eventskill/Deployment/Scripts/update_cognitive_models.ps1 index d435017c30..33ce888873 100644 --- a/skills/src/csharp/experimental/eventskill/Deployment/Scripts/update_cognitive_models.ps1 +++ b/skills/src/csharp/experimental/eventskill/Deployment/Scripts/update_cognitive_models.ps1 @@ -24,7 +24,7 @@ else { Write-Host "> Getting config file ..." $languageMap = @{ } -$config = Get-Content -Raw -Path $configFile | ConvertFrom-Json +$config = Get-Content -Encoding utf8 -Raw -Path $configFile | ConvertFrom-Json $config.cognitiveModels.PSObject.Properties | Foreach-Object { $languageMap[$_.Name] = $_.Value } foreach ($langCode in $languageMap.Keys) { @@ -42,7 +42,7 @@ foreach ($langCode in $languageMap.Keys) { Write-Host "> Updating local $($luisApp.id).lu file ..." luis export version ` - --appId $luisApp.appid ` + --appId $luisApp.appId ` --versionId $luisApp.version ` --region $luisApp.authoringRegion ` --authoringKey $luisApp.authoringKey | ludown refresh ` @@ -76,7 +76,7 @@ foreach ($langCode in $languageMap.Keys) { (dispatch add ` --type "luis" ` --name $luisApp.name ` - --id $luisApp.appid ` + --id $luisApp.appId ` --region $luisApp.authoringRegion ` --intentName "l_$($luisApp.id)" ` --dispatch $(Join-Path $dispatchFolder $langCode "$($dispatch.name).dispatch") ` @@ -117,7 +117,7 @@ foreach ($langCode in $languageMap.Keys) { $lu = Get-Item -Path $(Join-Path $luisFolder $langCode "$($luisApp.id).lu") UpdateLUIS ` -lu_file $lu ` - -appId $luisApp.appid ` + -appId $luisApp.appId ` -version $luisApp.version ` -region $luisApp.authoringRegion ` -authoringKey $luisApp.authoringKey ` diff --git a/skills/src/csharp/experimental/hospitalityskill/Deployment/Scripts/deploy.ps1 b/skills/src/csharp/experimental/hospitalityskill/Deployment/Scripts/deploy.ps1 index 2ec874cf98..42e2c12e50 100644 --- a/skills/src/csharp/experimental/hospitalityskill/Deployment/Scripts/deploy.ps1 +++ b/skills/src/csharp/experimental/hospitalityskill/Deployment/Scripts/deploy.ps1 @@ -187,7 +187,7 @@ if ($outputs) # Update appsettings.json Write-Host "> Updating appsettings.json ..." if (Test-Path $(Join-Path $projDir appsettings.json)) { - $settings = Get-Content $(Join-Path $projDir appsettings.json) | ConvertFrom-Json + $settings = Get-Content -Encoding utf8 $(Join-Path $projDir appsettings.json) | ConvertFrom-Json } else { $settings = New-Object PSObject @@ -196,7 +196,7 @@ if ($outputs) $settings | Add-Member -Type NoteProperty -Force -Name 'microsoftAppId' -Value $appId $settings | Add-Member -Type NoteProperty -Force -Name 'microsoftAppPassword' -Value $appPassword foreach ($key in $outputMap.Keys) { $settings | Add-Member -Type NoteProperty -Force -Name $key -Value $outputMap[$key].value } - $settings | ConvertTo-Json -depth 100 | Out-File $(Join-Path $projDir appsettings.json) + $settings | ConvertTo-Json -depth 100 | Out-File -Encoding utf8 $(Join-Path $projDir appsettings.json) if ($outputs.qnaMaker.value.key) { $qnaSubscriptionKey = $outputs.qnaMaker.value.key } @@ -206,6 +206,13 @@ if ($outputs) # Deploy cognitive models 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)'" + # Summary + Write-Host "Summary of the deployed resources:" -ForegroundColor Yellow + + Write-Host "- Resource Group: $($resourceGroup)" -ForegroundColor Yellow + + Write-Host "- Bot Web App: $($outputs.botWebAppName.value)`n" -ForegroundColor Yellow + # Publish bot Invoke-Expression "& '$(Join-Path $PSScriptRoot 'publish.ps1')' -name $($outputs.botWebAppName.value) -resourceGroup $($resourceGroup) -projFolder '$($projDir)'" diff --git a/skills/src/csharp/experimental/hospitalityskill/Deployment/Scripts/deploy_cognitive_models.ps1 b/skills/src/csharp/experimental/hospitalityskill/Deployment/Scripts/deploy_cognitive_models.ps1 index 7e0a474e50..1d5c73b58f 100644 --- a/skills/src/csharp/experimental/hospitalityskill/Deployment/Scripts/deploy_cognitive_models.ps1 +++ b/skills/src/csharp/experimental/hospitalityskill/Deployment/Scripts/deploy_cognitive_models.ps1 @@ -61,7 +61,7 @@ if (-not $luisAuthoringKey) { } if (-not $luisAccountName) { - $luisAccountName = Read-Host "? LUIS Service Name (exising service in Azure required)" + $luisAccountName = Read-Host "? LUIS Service Name (existing service in Azure required)" } if (-not $resourceGroup) { @@ -70,7 +70,7 @@ if (-not $resourceGroup) { $rgExists = az group exists -n $resourceGroup --output json if ($rgExists -eq "false") { - $resourceGroup = Read-Host "? LUIS Service Resource Group (exising service in Azure required)" + $resourceGroup = Read-Host "? LUIS Service Resource Group (existing service in Azure required)" } } @@ -297,4 +297,4 @@ foreach ($language in $languageArr) } # Write out config to file -$settings | ConvertTo-Json -depth 100 | Out-File $(Join-Path $outFolder "cognitivemodels.json" ) \ No newline at end of file +$settings | ConvertTo-Json -depth 100 | Out-File -Encoding utf8 $(Join-Path $outFolder "cognitivemodels.json" ) \ No newline at end of file diff --git a/skills/src/csharp/experimental/hospitalityskill/Deployment/Scripts/qna_functions.ps1 b/skills/src/csharp/experimental/hospitalityskill/Deployment/Scripts/qna_functions.ps1 index a3afe7a32e..cac35fae67 100644 --- a/skills/src/csharp/experimental/hospitalityskill/Deployment/Scripts/qna_functions.ps1 +++ b/skills/src/csharp/experimental/hospitalityskill/Deployment/Scripts/qna_functions.ps1 @@ -84,4 +84,4 @@ function UpdateKB ($lu_file, $kbId, $qnaSubscriptionKey) # Publish QnA Maker knowledgebase $(qnamaker publish kb --kbId $kbId --subscriptionKey $qnaSubscriptionKey) 2>&1 | Out-Null -} \ No newline at end of file +} diff --git a/skills/src/csharp/experimental/hospitalityskill/Deployment/Scripts/update_cognitive_models.ps1 b/skills/src/csharp/experimental/hospitalityskill/Deployment/Scripts/update_cognitive_models.ps1 index dd371f067b..33ce888873 100644 --- a/skills/src/csharp/experimental/hospitalityskill/Deployment/Scripts/update_cognitive_models.ps1 +++ b/skills/src/csharp/experimental/hospitalityskill/Deployment/Scripts/update_cognitive_models.ps1 @@ -24,7 +24,7 @@ else { Write-Host "> Getting config file ..." $languageMap = @{ } -$config = Get-Content -Raw -Path $configFile | ConvertFrom-Json +$config = Get-Content -Encoding utf8 -Raw -Path $configFile | ConvertFrom-Json $config.cognitiveModels.PSObject.Properties | Foreach-Object { $languageMap[$_.Name] = $_.Value } foreach ($langCode in $languageMap.Keys) { diff --git a/skills/src/csharp/experimental/itsmskill/Deployment/Scripts/deploy.ps1 b/skills/src/csharp/experimental/itsmskill/Deployment/Scripts/deploy.ps1 index 2ec874cf98..42e2c12e50 100644 --- a/skills/src/csharp/experimental/itsmskill/Deployment/Scripts/deploy.ps1 +++ b/skills/src/csharp/experimental/itsmskill/Deployment/Scripts/deploy.ps1 @@ -187,7 +187,7 @@ if ($outputs) # Update appsettings.json Write-Host "> Updating appsettings.json ..." if (Test-Path $(Join-Path $projDir appsettings.json)) { - $settings = Get-Content $(Join-Path $projDir appsettings.json) | ConvertFrom-Json + $settings = Get-Content -Encoding utf8 $(Join-Path $projDir appsettings.json) | ConvertFrom-Json } else { $settings = New-Object PSObject @@ -196,7 +196,7 @@ if ($outputs) $settings | Add-Member -Type NoteProperty -Force -Name 'microsoftAppId' -Value $appId $settings | Add-Member -Type NoteProperty -Force -Name 'microsoftAppPassword' -Value $appPassword foreach ($key in $outputMap.Keys) { $settings | Add-Member -Type NoteProperty -Force -Name $key -Value $outputMap[$key].value } - $settings | ConvertTo-Json -depth 100 | Out-File $(Join-Path $projDir appsettings.json) + $settings | ConvertTo-Json -depth 100 | Out-File -Encoding utf8 $(Join-Path $projDir appsettings.json) if ($outputs.qnaMaker.value.key) { $qnaSubscriptionKey = $outputs.qnaMaker.value.key } @@ -206,6 +206,13 @@ if ($outputs) # Deploy cognitive models 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)'" + # Summary + Write-Host "Summary of the deployed resources:" -ForegroundColor Yellow + + Write-Host "- Resource Group: $($resourceGroup)" -ForegroundColor Yellow + + Write-Host "- Bot Web App: $($outputs.botWebAppName.value)`n" -ForegroundColor Yellow + # Publish bot Invoke-Expression "& '$(Join-Path $PSScriptRoot 'publish.ps1')' -name $($outputs.botWebAppName.value) -resourceGroup $($resourceGroup) -projFolder '$($projDir)'" diff --git a/skills/src/csharp/experimental/itsmskill/Deployment/Scripts/deploy_cognitive_models.ps1 b/skills/src/csharp/experimental/itsmskill/Deployment/Scripts/deploy_cognitive_models.ps1 index 7c9a676ad5..1d5c73b58f 100644 --- a/skills/src/csharp/experimental/itsmskill/Deployment/Scripts/deploy_cognitive_models.ps1 +++ b/skills/src/csharp/experimental/itsmskill/Deployment/Scripts/deploy_cognitive_models.ps1 @@ -9,7 +9,7 @@ Param( [string] $luisSubscriptionKey, [string] $qnaSubscriptionKey, [string] $resourceGroup, - [switch] $useDispatch = $true, + [switch] $useDispatch, [string] $languages = "en-us", [string] $outFolder = $(Get-Location), [string] $logFile = $(Join-Path $PSScriptRoot .. "deploy_cognitive_models_log.txt") @@ -61,7 +61,7 @@ if (-not $luisAuthoringKey) { } if (-not $luisAccountName) { - $luisAccountName = Read-Host "? LUIS Service Name (exising service in Azure required)" + $luisAccountName = Read-Host "? LUIS Service Name (existing service in Azure required)" } if (-not $resourceGroup) { @@ -70,7 +70,7 @@ if (-not $resourceGroup) { $rgExists = az group exists -n $resourceGroup --output json if ($rgExists -eq "false") { - $resourceGroup = Read-Host "? LUIS Service Resource Group (exising service in Azure required)" + $resourceGroup = Read-Host "? LUIS Service Resource Group (existing service in Azure required)" } } @@ -181,10 +181,10 @@ foreach ($language in $languageArr) $config.languageModels += @{ id = $lu.BaseName name = $luisApp.name - appid = $luisApp.id - authoringkey = $luisAuthoringKey + appId = $luisApp.id + authoringKey = $luisAuthoringKey authoringRegion = $luisAuthoringRegion - subscriptionkey = $luisSubscriptionKey + subscriptionKey = $luisSubscriptionKey version = $luisApp.activeVersion region = $luisAccountRegion } @@ -283,10 +283,10 @@ foreach ($language in $languageArr) $config.dispatchModel = @{ type = "dispatch" name = $dispatchApp.name - appid = $dispatchApp.appId - authoringkey = $luisauthoringkey + appId = $dispatchApp.appId + authoringKey = $luisauthoringkey authoringRegion = $luisAuthoringRegion - subscriptionkey = $luisSubscriptionKey + subscriptionKey = $luisSubscriptionKey region = $luisAccountRegion } } @@ -297,4 +297,4 @@ foreach ($language in $languageArr) } # Write out config to file -$settings | ConvertTo-Json -depth 100 | Out-File $(Join-Path $outFolder "cognitivemodels.json" ) \ No newline at end of file +$settings | ConvertTo-Json -depth 100 | Out-File -Encoding utf8 $(Join-Path $outFolder "cognitivemodels.json" ) \ No newline at end of file diff --git a/skills/src/csharp/experimental/itsmskill/Deployment/Scripts/update_cognitive_models.ps1 b/skills/src/csharp/experimental/itsmskill/Deployment/Scripts/update_cognitive_models.ps1 index d435017c30..33ce888873 100644 --- a/skills/src/csharp/experimental/itsmskill/Deployment/Scripts/update_cognitive_models.ps1 +++ b/skills/src/csharp/experimental/itsmskill/Deployment/Scripts/update_cognitive_models.ps1 @@ -24,7 +24,7 @@ else { Write-Host "> Getting config file ..." $languageMap = @{ } -$config = Get-Content -Raw -Path $configFile | ConvertFrom-Json +$config = Get-Content -Encoding utf8 -Raw -Path $configFile | ConvertFrom-Json $config.cognitiveModels.PSObject.Properties | Foreach-Object { $languageMap[$_.Name] = $_.Value } foreach ($langCode in $languageMap.Keys) { @@ -42,7 +42,7 @@ foreach ($langCode in $languageMap.Keys) { Write-Host "> Updating local $($luisApp.id).lu file ..." luis export version ` - --appId $luisApp.appid ` + --appId $luisApp.appId ` --versionId $luisApp.version ` --region $luisApp.authoringRegion ` --authoringKey $luisApp.authoringKey | ludown refresh ` @@ -76,7 +76,7 @@ foreach ($langCode in $languageMap.Keys) { (dispatch add ` --type "luis" ` --name $luisApp.name ` - --id $luisApp.appid ` + --id $luisApp.appId ` --region $luisApp.authoringRegion ` --intentName "l_$($luisApp.id)" ` --dispatch $(Join-Path $dispatchFolder $langCode "$($dispatch.name).dispatch") ` @@ -117,7 +117,7 @@ foreach ($langCode in $languageMap.Keys) { $lu = Get-Item -Path $(Join-Path $luisFolder $langCode "$($luisApp.id).lu") UpdateLUIS ` -lu_file $lu ` - -appId $luisApp.appid ` + -appId $luisApp.appId ` -version $luisApp.version ` -region $luisApp.authoringRegion ` -authoringKey $luisApp.authoringKey ` diff --git a/skills/src/csharp/experimental/musicskill/Deployment/Scripts/deploy.ps1 b/skills/src/csharp/experimental/musicskill/Deployment/Scripts/deploy.ps1 index 2ec874cf98..42e2c12e50 100644 --- a/skills/src/csharp/experimental/musicskill/Deployment/Scripts/deploy.ps1 +++ b/skills/src/csharp/experimental/musicskill/Deployment/Scripts/deploy.ps1 @@ -187,7 +187,7 @@ if ($outputs) # Update appsettings.json Write-Host "> Updating appsettings.json ..." if (Test-Path $(Join-Path $projDir appsettings.json)) { - $settings = Get-Content $(Join-Path $projDir appsettings.json) | ConvertFrom-Json + $settings = Get-Content -Encoding utf8 $(Join-Path $projDir appsettings.json) | ConvertFrom-Json } else { $settings = New-Object PSObject @@ -196,7 +196,7 @@ if ($outputs) $settings | Add-Member -Type NoteProperty -Force -Name 'microsoftAppId' -Value $appId $settings | Add-Member -Type NoteProperty -Force -Name 'microsoftAppPassword' -Value $appPassword foreach ($key in $outputMap.Keys) { $settings | Add-Member -Type NoteProperty -Force -Name $key -Value $outputMap[$key].value } - $settings | ConvertTo-Json -depth 100 | Out-File $(Join-Path $projDir appsettings.json) + $settings | ConvertTo-Json -depth 100 | Out-File -Encoding utf8 $(Join-Path $projDir appsettings.json) if ($outputs.qnaMaker.value.key) { $qnaSubscriptionKey = $outputs.qnaMaker.value.key } @@ -206,6 +206,13 @@ if ($outputs) # Deploy cognitive models 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)'" + # Summary + Write-Host "Summary of the deployed resources:" -ForegroundColor Yellow + + Write-Host "- Resource Group: $($resourceGroup)" -ForegroundColor Yellow + + Write-Host "- Bot Web App: $($outputs.botWebAppName.value)`n" -ForegroundColor Yellow + # Publish bot Invoke-Expression "& '$(Join-Path $PSScriptRoot 'publish.ps1')' -name $($outputs.botWebAppName.value) -resourceGroup $($resourceGroup) -projFolder '$($projDir)'" diff --git a/skills/src/csharp/experimental/musicskill/Deployment/Scripts/deploy_cognitive_models.ps1 b/skills/src/csharp/experimental/musicskill/Deployment/Scripts/deploy_cognitive_models.ps1 index 361af45fa9..1d5c73b58f 100644 --- a/skills/src/csharp/experimental/musicskill/Deployment/Scripts/deploy_cognitive_models.ps1 +++ b/skills/src/csharp/experimental/musicskill/Deployment/Scripts/deploy_cognitive_models.ps1 @@ -61,7 +61,7 @@ if (-not $luisAuthoringKey) { } if (-not $luisAccountName) { - $luisAccountName = Read-Host "? LUIS Service Name (exising service in Azure required)" + $luisAccountName = Read-Host "? LUIS Service Name (existing service in Azure required)" } if (-not $resourceGroup) { @@ -70,7 +70,7 @@ if (-not $resourceGroup) { $rgExists = az group exists -n $resourceGroup --output json if ($rgExists -eq "false") { - $resourceGroup = Read-Host "? LUIS Service Resource Group (exising service in Azure required)" + $resourceGroup = Read-Host "? LUIS Service Resource Group (existing service in Azure required)" } } @@ -181,10 +181,10 @@ foreach ($language in $languageArr) $config.languageModels += @{ id = $lu.BaseName name = $luisApp.name - appid = $luisApp.id - authoringkey = $luisAuthoringKey + appId = $luisApp.id + authoringKey = $luisAuthoringKey authoringRegion = $luisAuthoringRegion - subscriptionkey = $luisSubscriptionKey + subscriptionKey = $luisSubscriptionKey version = $luisApp.activeVersion region = $luisAccountRegion } @@ -283,10 +283,10 @@ foreach ($language in $languageArr) $config.dispatchModel = @{ type = "dispatch" name = $dispatchApp.name - appid = $dispatchApp.appId - authoringkey = $luisauthoringkey + appId = $dispatchApp.appId + authoringKey = $luisauthoringkey authoringRegion = $luisAuthoringRegion - subscriptionkey = $luisSubscriptionKey + subscriptionKey = $luisSubscriptionKey region = $luisAccountRegion } } @@ -297,4 +297,4 @@ foreach ($language in $languageArr) } # Write out config to file -$settings | ConvertTo-Json -depth 100 | Out-File $(Join-Path $outFolder "cognitivemodels.json" ) \ No newline at end of file +$settings | ConvertTo-Json -depth 100 | Out-File -Encoding utf8 $(Join-Path $outFolder "cognitivemodels.json" ) \ No newline at end of file diff --git a/skills/src/csharp/experimental/musicskill/Deployment/Scripts/qna_functions.ps1 b/skills/src/csharp/experimental/musicskill/Deployment/Scripts/qna_functions.ps1 index 0da139daa8..cac35fae67 100644 --- a/skills/src/csharp/experimental/musicskill/Deployment/Scripts/qna_functions.ps1 +++ b/skills/src/csharp/experimental/musicskill/Deployment/Scripts/qna_functions.ps1 @@ -1,112 +1,87 @@ -function DeployLUIS ($name, $lu_file, $region, $luisAuthoringKey, $language, $log) +function DeployKB ($name, $lu_file, $qnaSubscriptionKey, $log) { $id = $lu_file.BaseName - $outFile = "$($id).luis" + $outFile = "$($id).qna" $outFolder = $lu_file.DirectoryName - $appName = "$($name)$($langCode)_$($id)" - + # Parse LU file Write-Host "> Parsing $($id) LU file ..." - ludown parse toluis ` + ludown parse toqna ` --in $lu_file ` - --luis_culture $language ` --out_folder $outFolder ` - --out $outFile + --out $outFile - # Create LUIS app - Write-Host "> Deploying $($id) LUIS app ..." - $luisApp = (luis import application ` - --appName $appName ` - --authoringKey $luisAuthoringKey ` - --subscriptionKey $luisAuthoringKey ` - --region $region ` - --in "$(Join-Path $outFolder $outFile)" ` - --wait) 2>> $log | ConvertFrom-Json + # Create QnA Maker kb + Write-Host "> Deploying $($id) QnA kb ..." + + # These values pretty much guarantee success. We can decrease them if the QnA backend gets faster + $initialDelaySeconds = 30; + $retryAttemptsRemaining = 3; + $retryDelaySeconds = 15; + $retryDelayIncrease = 30; + + while ($retryAttemptsRemaining -ge 0) { + $qnaKb = (qnamaker create kb ` + --name $id ` + --subscriptionKey $qnaSubscriptionKey ` + --in $(Join-Path $outFolder $outFile) ` + --force ` + --wait ` + --msbot) 2>> $log + + if (-not $qnaKb) { + $retryAttemptsRemaining = $retryAttemptsRemaining - 1 + Write-Host $retryAttemptsRemaining + Start-Sleep -s $retryDelaySeconds + $retryDelaySeconds += $retryDelayIncrease + + if ($retryAttemptsRemaining -lt 0) { + Write-Host "! Unable to create QnA KB." -ForegroundColor Cyan + } + else { + Write-Host "> Retrying ..." + Continue + } + } + else { + Break + } + } - if (-not $luisApp) { - Write-Host "! Could not deploy LUIS model. Review the log for more information." -ForegroundColor DarkRed + if (-not $qnaKb) { + Write-Host "! Could not deploy knowledgebase. Review the log for more information." -ForegroundColor DarkRed Write-Host "! Log: $($log)" -ForegroundColor DarkRed Return $null } else { - # train and publish luis app - $(luis train version --appId $luisApp.id --region $region --authoringKey $luisAuthoringKey --versionId $luisApp.activeVersion --wait - & luis publish version --appId $luisApp.id --region $region --authoringKey $luisAuthoringKey --versionId $luisApp.activeVersion --wait) 2>> $log | Out-Null + $qnaKb = $qnaKb | ConvertFrom-Json - Return $luisApp + # Publish QnA Maker knowledgebase + $(qnamaker publish kb --kbId $qnaKb.kbId --subscriptionKey $qnaSubscriptionKey) 2>> $log | Out-Null + + Return $qnaKb } } -function UpdateLUIS ($lu_file, $appId, $version, $region, $authoringKey, $subscriptionKey, $log) +function UpdateKB ($lu_file, $kbId, $qnaSubscriptionKey) { $id = $lu_file.BaseName - $outFile = "$($id).luis" + $outFile = "$($id).qna" $outFolder = $lu_file.DirectoryName - $luisApp = luis get application --appId $appId --region $region --authoringKey $authoringKey | ConvertFrom-Json - # Parse LU file Write-Host "> Parsing $($id) LU file ..." - ludown parse toluis ` + ludown parse toqna ` --in $lu_file ` - --luis_culture $luisApp.culture ` --out_folder $outFolder ` --out $outFile - - Write-Host "> Getting current versions ..." - # Get list of current versions - $versions = luis list versions ` - --appId $appId ` - --region $region ` - --authoringKey $authoringKey | ConvertFrom-Json - - # If the current version exists - if ($versions | Where { $_.version -eq $version }) - { - # delete any old backups - if ($versions | Where { $_.version -eq "backup" }) - { - Write-Host "> Deleting old backup version ..." - luis delete version ` - --appId $appId ` - --versionId "backup" ` - --region $region ` - --authoringKey $authoringKey ` - --force --wait | Out-Null - } - - # rename the active version to backup - Write-Host "> Saving current version as backup ..." - luis rename version ` - --appId $appId ` - --versionId $version ` - --region $region ` - --newVersionId backup ` - --authoringKey $authoringKey ` - --subscriptionKey $subscriptionKey ` - --wait | Out-Null - } - - # import the new 0.1 version from the .luis file - Write-Host "> Importing new version ..." - luis import version ` - --appId $appId ` - --versionId $version ` - --region $region ` - --authoringKey $authoringKey ` - --subscriptionKey $subscriptionKey ` - --in "$(Join-Path $outFolder $outFile)" ` - --wait | ConvertFrom-Json - - # train and publish luis app - $(luis train version --appId $appId --region $region --authoringKey $authoringKey --versionId $version --wait - & luis publish version --appId $appId --region $region --authoringKey $authoringKey --versionId $version --wait) 2>> $log | Out-Null -} -function RunLuisGen($lu_file, $outName, $outFolder) { - $id = $lu_file.BaseName - $luisFolder = $lu_file.DirectoryName - $luisFile = Join-Path $luisFolder "$($id).luis" + Write-Host "> Replacing $($id) QnA kb ..." + qnamaker replace kb ` + --in $(Join-Path $outFolder $outFile) ` + --kbId $kbId ` + --subscriptionKey $qnaSubscriptionKey - luisgen $luisFile -cs "$($outName)Luis" -o $outFolder -} \ No newline at end of file + # Publish QnA Maker knowledgebase + $(qnamaker publish kb --kbId $kbId --subscriptionKey $qnaSubscriptionKey) 2>&1 | Out-Null +} diff --git a/skills/src/csharp/experimental/musicskill/Deployment/Scripts/update_cognitive_models.ps1 b/skills/src/csharp/experimental/musicskill/Deployment/Scripts/update_cognitive_models.ps1 index d435017c30..33ce888873 100644 --- a/skills/src/csharp/experimental/musicskill/Deployment/Scripts/update_cognitive_models.ps1 +++ b/skills/src/csharp/experimental/musicskill/Deployment/Scripts/update_cognitive_models.ps1 @@ -24,7 +24,7 @@ else { Write-Host "> Getting config file ..." $languageMap = @{ } -$config = Get-Content -Raw -Path $configFile | ConvertFrom-Json +$config = Get-Content -Encoding utf8 -Raw -Path $configFile | ConvertFrom-Json $config.cognitiveModels.PSObject.Properties | Foreach-Object { $languageMap[$_.Name] = $_.Value } foreach ($langCode in $languageMap.Keys) { @@ -42,7 +42,7 @@ foreach ($langCode in $languageMap.Keys) { Write-Host "> Updating local $($luisApp.id).lu file ..." luis export version ` - --appId $luisApp.appid ` + --appId $luisApp.appId ` --versionId $luisApp.version ` --region $luisApp.authoringRegion ` --authoringKey $luisApp.authoringKey | ludown refresh ` @@ -76,7 +76,7 @@ foreach ($langCode in $languageMap.Keys) { (dispatch add ` --type "luis" ` --name $luisApp.name ` - --id $luisApp.appid ` + --id $luisApp.appId ` --region $luisApp.authoringRegion ` --intentName "l_$($luisApp.id)" ` --dispatch $(Join-Path $dispatchFolder $langCode "$($dispatch.name).dispatch") ` @@ -117,7 +117,7 @@ foreach ($langCode in $languageMap.Keys) { $lu = Get-Item -Path $(Join-Path $luisFolder $langCode "$($luisApp.id).lu") UpdateLUIS ` -lu_file $lu ` - -appId $luisApp.appid ` + -appId $luisApp.appId ` -version $luisApp.version ` -region $luisApp.authoringRegion ` -authoringKey $luisApp.authoringKey ` diff --git a/skills/src/csharp/experimental/newsskill/Deployment/Scripts/deploy.ps1 b/skills/src/csharp/experimental/newsskill/Deployment/Scripts/deploy.ps1 index 2ec874cf98..42e2c12e50 100644 --- a/skills/src/csharp/experimental/newsskill/Deployment/Scripts/deploy.ps1 +++ b/skills/src/csharp/experimental/newsskill/Deployment/Scripts/deploy.ps1 @@ -187,7 +187,7 @@ if ($outputs) # Update appsettings.json Write-Host "> Updating appsettings.json ..." if (Test-Path $(Join-Path $projDir appsettings.json)) { - $settings = Get-Content $(Join-Path $projDir appsettings.json) | ConvertFrom-Json + $settings = Get-Content -Encoding utf8 $(Join-Path $projDir appsettings.json) | ConvertFrom-Json } else { $settings = New-Object PSObject @@ -196,7 +196,7 @@ if ($outputs) $settings | Add-Member -Type NoteProperty -Force -Name 'microsoftAppId' -Value $appId $settings | Add-Member -Type NoteProperty -Force -Name 'microsoftAppPassword' -Value $appPassword foreach ($key in $outputMap.Keys) { $settings | Add-Member -Type NoteProperty -Force -Name $key -Value $outputMap[$key].value } - $settings | ConvertTo-Json -depth 100 | Out-File $(Join-Path $projDir appsettings.json) + $settings | ConvertTo-Json -depth 100 | Out-File -Encoding utf8 $(Join-Path $projDir appsettings.json) if ($outputs.qnaMaker.value.key) { $qnaSubscriptionKey = $outputs.qnaMaker.value.key } @@ -206,6 +206,13 @@ if ($outputs) # Deploy cognitive models 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)'" + # Summary + Write-Host "Summary of the deployed resources:" -ForegroundColor Yellow + + Write-Host "- Resource Group: $($resourceGroup)" -ForegroundColor Yellow + + Write-Host "- Bot Web App: $($outputs.botWebAppName.value)`n" -ForegroundColor Yellow + # Publish bot Invoke-Expression "& '$(Join-Path $PSScriptRoot 'publish.ps1')' -name $($outputs.botWebAppName.value) -resourceGroup $($resourceGroup) -projFolder '$($projDir)'" diff --git a/skills/src/csharp/experimental/newsskill/Deployment/Scripts/deploy_cognitive_models.ps1 b/skills/src/csharp/experimental/newsskill/Deployment/Scripts/deploy_cognitive_models.ps1 index ddd21d0b3f..1d5c73b58f 100644 --- a/skills/src/csharp/experimental/newsskill/Deployment/Scripts/deploy_cognitive_models.ps1 +++ b/skills/src/csharp/experimental/newsskill/Deployment/Scripts/deploy_cognitive_models.ps1 @@ -297,4 +297,4 @@ foreach ($language in $languageArr) } # Write out config to file -$settings | ConvertTo-Json -depth 100 | Out-File $(Join-Path $outFolder "cognitivemodels.json" ) \ No newline at end of file +$settings | ConvertTo-Json -depth 100 | Out-File -Encoding utf8 $(Join-Path $outFolder "cognitivemodels.json" ) \ No newline at end of file diff --git a/skills/src/csharp/experimental/newsskill/Deployment/Scripts/update_cognitive_models.ps1 b/skills/src/csharp/experimental/newsskill/Deployment/Scripts/update_cognitive_models.ps1 index dd371f067b..33ce888873 100644 --- a/skills/src/csharp/experimental/newsskill/Deployment/Scripts/update_cognitive_models.ps1 +++ b/skills/src/csharp/experimental/newsskill/Deployment/Scripts/update_cognitive_models.ps1 @@ -24,7 +24,7 @@ else { Write-Host "> Getting config file ..." $languageMap = @{ } -$config = Get-Content -Raw -Path $configFile | ConvertFrom-Json +$config = Get-Content -Encoding utf8 -Raw -Path $configFile | ConvertFrom-Json $config.cognitiveModels.PSObject.Properties | Foreach-Object { $languageMap[$_.Name] = $_.Value } foreach ($langCode in $languageMap.Keys) { diff --git a/skills/src/csharp/experimental/restaurantbooking/Deployment/Scripts/deploy.ps1 b/skills/src/csharp/experimental/restaurantbooking/Deployment/Scripts/deploy.ps1 index 2ec874cf98..42e2c12e50 100644 --- a/skills/src/csharp/experimental/restaurantbooking/Deployment/Scripts/deploy.ps1 +++ b/skills/src/csharp/experimental/restaurantbooking/Deployment/Scripts/deploy.ps1 @@ -187,7 +187,7 @@ if ($outputs) # Update appsettings.json Write-Host "> Updating appsettings.json ..." if (Test-Path $(Join-Path $projDir appsettings.json)) { - $settings = Get-Content $(Join-Path $projDir appsettings.json) | ConvertFrom-Json + $settings = Get-Content -Encoding utf8 $(Join-Path $projDir appsettings.json) | ConvertFrom-Json } else { $settings = New-Object PSObject @@ -196,7 +196,7 @@ if ($outputs) $settings | Add-Member -Type NoteProperty -Force -Name 'microsoftAppId' -Value $appId $settings | Add-Member -Type NoteProperty -Force -Name 'microsoftAppPassword' -Value $appPassword foreach ($key in $outputMap.Keys) { $settings | Add-Member -Type NoteProperty -Force -Name $key -Value $outputMap[$key].value } - $settings | ConvertTo-Json -depth 100 | Out-File $(Join-Path $projDir appsettings.json) + $settings | ConvertTo-Json -depth 100 | Out-File -Encoding utf8 $(Join-Path $projDir appsettings.json) if ($outputs.qnaMaker.value.key) { $qnaSubscriptionKey = $outputs.qnaMaker.value.key } @@ -206,6 +206,13 @@ if ($outputs) # Deploy cognitive models 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)'" + # Summary + Write-Host "Summary of the deployed resources:" -ForegroundColor Yellow + + Write-Host "- Resource Group: $($resourceGroup)" -ForegroundColor Yellow + + Write-Host "- Bot Web App: $($outputs.botWebAppName.value)`n" -ForegroundColor Yellow + # Publish bot Invoke-Expression "& '$(Join-Path $PSScriptRoot 'publish.ps1')' -name $($outputs.botWebAppName.value) -resourceGroup $($resourceGroup) -projFolder '$($projDir)'" diff --git a/skills/src/csharp/experimental/restaurantbooking/Deployment/Scripts/deploy_cognitive_models.ps1 b/skills/src/csharp/experimental/restaurantbooking/Deployment/Scripts/deploy_cognitive_models.ps1 index ddd21d0b3f..1d5c73b58f 100644 --- a/skills/src/csharp/experimental/restaurantbooking/Deployment/Scripts/deploy_cognitive_models.ps1 +++ b/skills/src/csharp/experimental/restaurantbooking/Deployment/Scripts/deploy_cognitive_models.ps1 @@ -297,4 +297,4 @@ foreach ($language in $languageArr) } # Write out config to file -$settings | ConvertTo-Json -depth 100 | Out-File $(Join-Path $outFolder "cognitivemodels.json" ) \ No newline at end of file +$settings | ConvertTo-Json -depth 100 | Out-File -Encoding utf8 $(Join-Path $outFolder "cognitivemodels.json" ) \ No newline at end of file diff --git a/skills/src/csharp/experimental/restaurantbooking/Deployment/Scripts/update_cognitive_models.ps1 b/skills/src/csharp/experimental/restaurantbooking/Deployment/Scripts/update_cognitive_models.ps1 index dd371f067b..33ce888873 100644 --- a/skills/src/csharp/experimental/restaurantbooking/Deployment/Scripts/update_cognitive_models.ps1 +++ b/skills/src/csharp/experimental/restaurantbooking/Deployment/Scripts/update_cognitive_models.ps1 @@ -24,7 +24,7 @@ else { Write-Host "> Getting config file ..." $languageMap = @{ } -$config = Get-Content -Raw -Path $configFile | ConvertFrom-Json +$config = Get-Content -Encoding utf8 -Raw -Path $configFile | ConvertFrom-Json $config.cognitiveModels.PSObject.Properties | Foreach-Object { $languageMap[$_.Name] = $_.Value } foreach ($langCode in $languageMap.Keys) { diff --git a/skills/src/csharp/experimental/weatherskill/Deployment/Scripts/deploy.ps1 b/skills/src/csharp/experimental/weatherskill/Deployment/Scripts/deploy.ps1 index 2ec874cf98..42e2c12e50 100644 --- a/skills/src/csharp/experimental/weatherskill/Deployment/Scripts/deploy.ps1 +++ b/skills/src/csharp/experimental/weatherskill/Deployment/Scripts/deploy.ps1 @@ -187,7 +187,7 @@ if ($outputs) # Update appsettings.json Write-Host "> Updating appsettings.json ..." if (Test-Path $(Join-Path $projDir appsettings.json)) { - $settings = Get-Content $(Join-Path $projDir appsettings.json) | ConvertFrom-Json + $settings = Get-Content -Encoding utf8 $(Join-Path $projDir appsettings.json) | ConvertFrom-Json } else { $settings = New-Object PSObject @@ -196,7 +196,7 @@ if ($outputs) $settings | Add-Member -Type NoteProperty -Force -Name 'microsoftAppId' -Value $appId $settings | Add-Member -Type NoteProperty -Force -Name 'microsoftAppPassword' -Value $appPassword foreach ($key in $outputMap.Keys) { $settings | Add-Member -Type NoteProperty -Force -Name $key -Value $outputMap[$key].value } - $settings | ConvertTo-Json -depth 100 | Out-File $(Join-Path $projDir appsettings.json) + $settings | ConvertTo-Json -depth 100 | Out-File -Encoding utf8 $(Join-Path $projDir appsettings.json) if ($outputs.qnaMaker.value.key) { $qnaSubscriptionKey = $outputs.qnaMaker.value.key } @@ -206,6 +206,13 @@ if ($outputs) # Deploy cognitive models 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)'" + # Summary + Write-Host "Summary of the deployed resources:" -ForegroundColor Yellow + + Write-Host "- Resource Group: $($resourceGroup)" -ForegroundColor Yellow + + Write-Host "- Bot Web App: $($outputs.botWebAppName.value)`n" -ForegroundColor Yellow + # Publish bot Invoke-Expression "& '$(Join-Path $PSScriptRoot 'publish.ps1')' -name $($outputs.botWebAppName.value) -resourceGroup $($resourceGroup) -projFolder '$($projDir)'" diff --git a/skills/src/csharp/experimental/weatherskill/Deployment/Scripts/deploy_cognitive_models.ps1 b/skills/src/csharp/experimental/weatherskill/Deployment/Scripts/deploy_cognitive_models.ps1 index ddd21d0b3f..1d5c73b58f 100644 --- a/skills/src/csharp/experimental/weatherskill/Deployment/Scripts/deploy_cognitive_models.ps1 +++ b/skills/src/csharp/experimental/weatherskill/Deployment/Scripts/deploy_cognitive_models.ps1 @@ -297,4 +297,4 @@ foreach ($language in $languageArr) } # Write out config to file -$settings | ConvertTo-Json -depth 100 | Out-File $(Join-Path $outFolder "cognitivemodels.json" ) \ No newline at end of file +$settings | ConvertTo-Json -depth 100 | Out-File -Encoding utf8 $(Join-Path $outFolder "cognitivemodels.json" ) \ No newline at end of file diff --git a/skills/src/csharp/experimental/weatherskill/Deployment/Scripts/update_cognitive_models.ps1 b/skills/src/csharp/experimental/weatherskill/Deployment/Scripts/update_cognitive_models.ps1 index dd371f067b..33ce888873 100644 --- a/skills/src/csharp/experimental/weatherskill/Deployment/Scripts/update_cognitive_models.ps1 +++ b/skills/src/csharp/experimental/weatherskill/Deployment/Scripts/update_cognitive_models.ps1 @@ -24,7 +24,7 @@ else { Write-Host "> Getting config file ..." $languageMap = @{ } -$config = Get-Content -Raw -Path $configFile | ConvertFrom-Json +$config = Get-Content -Encoding utf8 -Raw -Path $configFile | ConvertFrom-Json $config.cognitiveModels.PSObject.Properties | Foreach-Object { $languageMap[$_.Name] = $_.Value } foreach ($langCode in $languageMap.Keys) { diff --git a/skills/src/csharp/phoneskill/phoneskill/Deployment/Scripts/deploy.ps1 b/skills/src/csharp/phoneskill/phoneskill/Deployment/Scripts/deploy.ps1 index 78cbf4e5fc..42e2c12e50 100644 --- a/skills/src/csharp/phoneskill/phoneskill/Deployment/Scripts/deploy.ps1 +++ b/skills/src/csharp/phoneskill/phoneskill/Deployment/Scripts/deploy.ps1 @@ -81,7 +81,8 @@ if (-not $appId) { --display-name $name ` --password `"$($appPassword)`" ` --available-to-other-tenants ` - --reply-urls 'https://token.botframework.com/.auth/web/redirect') + --reply-urls 'https://token.botframework.com/.auth/web/redirect' ` + --output json) # Retrieve AppId if ($app) { @@ -101,7 +102,7 @@ $timestamp = Get-Date -f MMddyyyyHHmmss # Create resource group Write-Host "> Creating resource group ..." -(az group create --name $resourceGroup --location $location) 2>> $logFile | Out-Null +(az group create --name $resourceGroup --location $location --output json) 2>> $logFile | Out-Null # Deploy Azure services (deploys LUIS, QnA Maker, Content Moderator, CosmosDB) if ($parametersFile) { @@ -110,7 +111,8 @@ if ($parametersFile) { --resource-group $resourcegroup ` --template-file "$(Join-Path $PSScriptRoot '..' 'Resources' 'template.json')" ` --parameters "@$($parametersFile)" ` - --parameters name=$name microsoftAppId=$appId microsoftAppPassword="`"$($appPassword)`"" + --parameters name=$name microsoftAppId=$appId microsoftAppPassword="`"$($appPassword)`"" ` + --output json if ($validation) { $validation >> $logFile @@ -123,7 +125,8 @@ if ($parametersFile) { --resource-group $resourceGroup ` --template-file "$(Join-Path $PSScriptRoot '..' 'Resources' 'template.json')" ` --parameters "@$($parametersFile)" ` - --parameters name=$name microsoftAppId=$appId microsoftAppPassword="`"$($appPassword)`"" + --parameters name=$name microsoftAppId=$appId microsoftAppPassword="`"$($appPassword)`"" ` + --output json } else { Write-Host "! Template is not valid with provided parameters. Review the log for more information." -ForegroundColor DarkRed @@ -139,7 +142,8 @@ else { $validation = az group deployment validate ` --resource-group $resourcegroup ` --template-file "$(Join-Path $PSScriptRoot '..' 'Resources' 'template.json')" ` - --parameters name=$name microsoftAppId=$appId microsoftAppPassword="`"$($appPassword)`"" + --parameters name=$name microsoftAppId=$appId microsoftAppPassword="`"$($appPassword)`"" ` + --output json if ($validation) { $validation >> $logFile @@ -151,7 +155,8 @@ else { --name $timestamp ` --resource-group $resourceGroup ` --template-file "$(Join-Path $PSScriptRoot '..' 'Resources' 'template.json')" ` - --parameters name=$name microsoftAppId=$appId microsoftAppPassword="`"$($appPassword)`"" + --parameters name=$name microsoftAppId=$appId microsoftAppPassword="`"$($appPassword)`"" ` + --output json } else { Write-Host "! Template is not valid with provided parameters. Review the log for more information." -ForegroundColor DarkRed @@ -167,7 +172,8 @@ else { $outputs = (az group deployment show ` --name $timestamp ` --resource-group $resourceGroup ` - --query properties.outputs) 2>> $logFile + --query properties.outputs ` + --output json) 2>> $logFile # If it succeeded then we perform the remainder of the steps if ($outputs) @@ -181,7 +187,7 @@ if ($outputs) # Update appsettings.json Write-Host "> Updating appsettings.json ..." if (Test-Path $(Join-Path $projDir appsettings.json)) { - $settings = Get-Content $(Join-Path $projDir appsettings.json) | ConvertFrom-Json + $settings = Get-Content -Encoding utf8 $(Join-Path $projDir appsettings.json) | ConvertFrom-Json } else { $settings = New-Object PSObject @@ -190,7 +196,7 @@ if ($outputs) $settings | Add-Member -Type NoteProperty -Force -Name 'microsoftAppId' -Value $appId $settings | Add-Member -Type NoteProperty -Force -Name 'microsoftAppPassword' -Value $appPassword foreach ($key in $outputMap.Keys) { $settings | Add-Member -Type NoteProperty -Force -Name $key -Value $outputMap[$key].value } - $settings | ConvertTo-Json -depth 100 | Out-File $(Join-Path $projDir appsettings.json) + $settings | ConvertTo-Json -depth 100 | Out-File -Encoding utf8 $(Join-Path $projDir appsettings.json) if ($outputs.qnaMaker.value.key) { $qnaSubscriptionKey = $outputs.qnaMaker.value.key } @@ -200,6 +206,13 @@ if ($outputs) # Deploy cognitive models 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)'" + # Summary + Write-Host "Summary of the deployed resources:" -ForegroundColor Yellow + + Write-Host "- Resource Group: $($resourceGroup)" -ForegroundColor Yellow + + Write-Host "- Bot Web App: $($outputs.botWebAppName.value)`n" -ForegroundColor Yellow + # Publish bot Invoke-Expression "& '$(Join-Path $PSScriptRoot 'publish.ps1')' -name $($outputs.botWebAppName.value) -resourceGroup $($resourceGroup) -projFolder '$($projDir)'" @@ -208,7 +221,7 @@ if ($outputs) else { # Check for failed deployments - $operations = (az group deployment operation list -g $resourceGroup -n $timestamp) 2>> $logFile | Out-Null + $operations = (az group deployment operation list -g $resourceGroup -n $timestamp --output json) 2>> $logFile | Out-Null if ($operations) { $operations = $operations | ConvertFrom-Json diff --git a/skills/src/csharp/phoneskill/phoneskill/Deployment/Scripts/deploy_cognitive_models.ps1 b/skills/src/csharp/phoneskill/phoneskill/Deployment/Scripts/deploy_cognitive_models.ps1 index e3dfbfcd60..1d5c73b58f 100644 --- a/skills/src/csharp/phoneskill/phoneskill/Deployment/Scripts/deploy_cognitive_models.ps1 +++ b/skills/src/csharp/phoneskill/phoneskill/Deployment/Scripts/deploy_cognitive_models.ps1 @@ -61,21 +61,21 @@ if (-not $luisAuthoringKey) { } if (-not $luisAccountName) { - $luisAccountName = Read-Host "? LUIS Service Name (exising service in Azure required)" + $luisAccountName = Read-Host "? LUIS Service Name (existing service in Azure required)" } if (-not $resourceGroup) { $resourceGroup = $name - $rgExists = az group exists -n $resourceGroup + $rgExists = az group exists -n $resourceGroup --output json if ($rgExists -eq "false") { - $resourceGroup = Read-Host "? LUIS Service Resource Group (exising service in Azure required)" + $resourceGroup = Read-Host "? LUIS Service Resource Group (existing service in Azure required)" } } if (-not $luisSubscriptionKey) { - $keys = az cognitiveservices account keys list --name $luisAccountName --resource-group $resourceGroup | ConvertFrom-Json + $keys = az cognitiveservices account keys list --name $luisAccountName --resource-group $resourceGroup --output json | ConvertFrom-Json if ($keys) { $luisSubscriptionKey = $keys.key1 @@ -98,8 +98,8 @@ else { $useQna = $true } -$azAccount = az account show | ConvertFrom-Json -$azAccessToken = $(Invoke-Expression "az account get-access-token") | ConvertFrom-Json +$azAccount = az account show --output json | ConvertFrom-Json +$azAccessToken = $(Invoke-Expression "az account get-access-token --output json") | ConvertFrom-Json # Get languages $languageArr = $languages -split "," @@ -181,10 +181,10 @@ foreach ($language in $languageArr) $config.languageModels += @{ id = $lu.BaseName name = $luisApp.name - appid = $luisApp.id - authoringkey = $luisAuthoringKey + appId = $luisApp.id + authoringKey = $luisAuthoringKey authoringRegion = $luisAuthoringRegion - subscriptionkey = $luisSubscriptionKey + subscriptionKey = $luisSubscriptionKey version = $luisApp.activeVersion region = $luisAccountRegion } @@ -283,10 +283,10 @@ foreach ($language in $languageArr) $config.dispatchModel = @{ type = "dispatch" name = $dispatchApp.name - appid = $dispatchApp.appId - authoringkey = $luisauthoringkey + appId = $dispatchApp.appId + authoringKey = $luisauthoringkey authoringRegion = $luisAuthoringRegion - subscriptionkey = $luisSubscriptionKey + subscriptionKey = $luisSubscriptionKey region = $luisAccountRegion } } @@ -297,4 +297,4 @@ foreach ($language in $languageArr) } # Write out config to file -$settings | ConvertTo-Json -depth 100 | Out-File $(Join-Path $outFolder "cognitivemodels.json" ) \ No newline at end of file +$settings | ConvertTo-Json -depth 100 | Out-File -Encoding utf8 $(Join-Path $outFolder "cognitivemodels.json" ) \ No newline at end of file diff --git a/skills/src/csharp/phoneskill/phoneskill/Deployment/Scripts/luis_functions.ps1 b/skills/src/csharp/phoneskill/phoneskill/Deployment/Scripts/luis_functions.ps1 index 3096c24a54..0da139daa8 100644 --- a/skills/src/csharp/phoneskill/phoneskill/Deployment/Scripts/luis_functions.ps1 +++ b/skills/src/csharp/phoneskill/phoneskill/Deployment/Scripts/luis_functions.ps1 @@ -30,8 +30,8 @@ function DeployLUIS ($name, $lu_file, $region, $luisAuthoringKey, $language, $lo } else { # train and publish luis app - $(luis train version --appId $luisApp.id --authoringKey $luisAuthoringKey --versionId $luisApp.activeVersion --wait - & luis publish version --appId $luisApp.id --authoringKey $luisAuthoringKey --versionId $luisApp.activeVersion --wait) 2>> $log | Out-Null + $(luis train version --appId $luisApp.id --region $region --authoringKey $luisAuthoringKey --versionId $luisApp.activeVersion --wait + & luis publish version --appId $luisApp.id --region $region --authoringKey $luisAuthoringKey --versionId $luisApp.activeVersion --wait) 2>> $log | Out-Null Return $luisApp } @@ -100,7 +100,7 @@ function UpdateLUIS ($lu_file, $appId, $version, $region, $authoringKey, $subscr # train and publish luis app $(luis train version --appId $appId --region $region --authoringKey $authoringKey --versionId $version --wait - & luis publish version --appId $appId --region $region --authoringKey $authoringKey --versionId $version --wait) 2>&1 | Out-Null + & luis publish version --appId $appId --region $region --authoringKey $authoringKey --versionId $version --wait) 2>> $log | Out-Null } function RunLuisGen($lu_file, $outName, $outFolder) { diff --git a/skills/src/csharp/phoneskill/phoneskill/Deployment/Scripts/update_cognitive_models.ps1 b/skills/src/csharp/phoneskill/phoneskill/Deployment/Scripts/update_cognitive_models.ps1 index 827dee559a..33ce888873 100644 --- a/skills/src/csharp/phoneskill/phoneskill/Deployment/Scripts/update_cognitive_models.ps1 +++ b/skills/src/csharp/phoneskill/phoneskill/Deployment/Scripts/update_cognitive_models.ps1 @@ -24,7 +24,7 @@ else { Write-Host "> Getting config file ..." $languageMap = @{ } -$config = Get-Content -Raw -Path $configFile | ConvertFrom-Json +$config = Get-Content -Encoding utf8 -Raw -Path $configFile | ConvertFrom-Json $config.cognitiveModels.PSObject.Properties | Foreach-Object { $languageMap[$_.Name] = $_.Value } foreach ($langCode in $languageMap.Keys) { @@ -42,7 +42,7 @@ foreach ($langCode in $languageMap.Keys) { Write-Host "> Updating local $($luisApp.id).lu file ..." luis export version ` - --appId $luisApp.appid ` + --appId $luisApp.appId ` --versionId $luisApp.version ` --region $luisApp.authoringRegion ` --authoringKey $luisApp.authoringKey | ludown refresh ` @@ -76,7 +76,7 @@ foreach ($langCode in $languageMap.Keys) { (dispatch add ` --type "luis" ` --name $luisApp.name ` - --id $luisApp.appid ` + --id $luisApp.appId ` --region $luisApp.authoringRegion ` --intentName "l_$($luisApp.id)" ` --dispatch $(Join-Path $dispatchFolder $langCode "$($dispatch.name).dispatch") ` @@ -117,11 +117,17 @@ foreach ($langCode in $languageMap.Keys) { $lu = Get-Item -Path $(Join-Path $luisFolder $langCode "$($luisApp.id).lu") UpdateLUIS ` -lu_file $lu ` - -appId $luisApp.appid ` + -appId $luisApp.appId ` -version $luisApp.version ` -region $luisApp.authoringRegion ` -authoringKey $luisApp.authoringKey ` -subscriptionKey $app.subscriptionKey + + if ($useLuisGen) { + Write-Host "> Running LuisGen for $($luisApp.id) app ..." + $luPath = $(Join-Path $luisFolder $langCode "$($luisApp.id).lu") + RunLuisGen -lu_file $(Get-Item $luPath) -outName "$($luisApp.id)" -outFolder $lgOutFolder + } } # Update each knowledgebase based on local LU files diff --git a/skills/src/csharp/pointofinterestskill/pointofinterestskill/Deployment/Scripts/deploy.ps1 b/skills/src/csharp/pointofinterestskill/pointofinterestskill/Deployment/Scripts/deploy.ps1 index 2ec874cf98..42e2c12e50 100644 --- a/skills/src/csharp/pointofinterestskill/pointofinterestskill/Deployment/Scripts/deploy.ps1 +++ b/skills/src/csharp/pointofinterestskill/pointofinterestskill/Deployment/Scripts/deploy.ps1 @@ -187,7 +187,7 @@ if ($outputs) # Update appsettings.json Write-Host "> Updating appsettings.json ..." if (Test-Path $(Join-Path $projDir appsettings.json)) { - $settings = Get-Content $(Join-Path $projDir appsettings.json) | ConvertFrom-Json + $settings = Get-Content -Encoding utf8 $(Join-Path $projDir appsettings.json) | ConvertFrom-Json } else { $settings = New-Object PSObject @@ -196,7 +196,7 @@ if ($outputs) $settings | Add-Member -Type NoteProperty -Force -Name 'microsoftAppId' -Value $appId $settings | Add-Member -Type NoteProperty -Force -Name 'microsoftAppPassword' -Value $appPassword foreach ($key in $outputMap.Keys) { $settings | Add-Member -Type NoteProperty -Force -Name $key -Value $outputMap[$key].value } - $settings | ConvertTo-Json -depth 100 | Out-File $(Join-Path $projDir appsettings.json) + $settings | ConvertTo-Json -depth 100 | Out-File -Encoding utf8 $(Join-Path $projDir appsettings.json) if ($outputs.qnaMaker.value.key) { $qnaSubscriptionKey = $outputs.qnaMaker.value.key } @@ -206,6 +206,13 @@ if ($outputs) # Deploy cognitive models 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)'" + # Summary + Write-Host "Summary of the deployed resources:" -ForegroundColor Yellow + + Write-Host "- Resource Group: $($resourceGroup)" -ForegroundColor Yellow + + Write-Host "- Bot Web App: $($outputs.botWebAppName.value)`n" -ForegroundColor Yellow + # Publish bot Invoke-Expression "& '$(Join-Path $PSScriptRoot 'publish.ps1')' -name $($outputs.botWebAppName.value) -resourceGroup $($resourceGroup) -projFolder '$($projDir)'" diff --git a/skills/src/csharp/pointofinterestskill/pointofinterestskill/Deployment/Scripts/deploy_cognitive_models.ps1 b/skills/src/csharp/pointofinterestskill/pointofinterestskill/Deployment/Scripts/deploy_cognitive_models.ps1 index ddd21d0b3f..1d5c73b58f 100644 --- a/skills/src/csharp/pointofinterestskill/pointofinterestskill/Deployment/Scripts/deploy_cognitive_models.ps1 +++ b/skills/src/csharp/pointofinterestskill/pointofinterestskill/Deployment/Scripts/deploy_cognitive_models.ps1 @@ -297,4 +297,4 @@ foreach ($language in $languageArr) } # Write out config to file -$settings | ConvertTo-Json -depth 100 | Out-File $(Join-Path $outFolder "cognitivemodels.json" ) \ No newline at end of file +$settings | ConvertTo-Json -depth 100 | Out-File -Encoding utf8 $(Join-Path $outFolder "cognitivemodels.json" ) \ No newline at end of file diff --git a/skills/src/csharp/pointofinterestskill/pointofinterestskill/Deployment/Scripts/update_cognitive_models.ps1 b/skills/src/csharp/pointofinterestskill/pointofinterestskill/Deployment/Scripts/update_cognitive_models.ps1 index dd371f067b..33ce888873 100644 --- a/skills/src/csharp/pointofinterestskill/pointofinterestskill/Deployment/Scripts/update_cognitive_models.ps1 +++ b/skills/src/csharp/pointofinterestskill/pointofinterestskill/Deployment/Scripts/update_cognitive_models.ps1 @@ -24,7 +24,7 @@ else { Write-Host "> Getting config file ..." $languageMap = @{ } -$config = Get-Content -Raw -Path $configFile | ConvertFrom-Json +$config = Get-Content -Encoding utf8 -Raw -Path $configFile | ConvertFrom-Json $config.cognitiveModels.PSObject.Properties | Foreach-Object { $languageMap[$_.Name] = $_.Value } foreach ($langCode in $languageMap.Keys) { diff --git a/skills/src/csharp/todoskill/todoskill/Deployment/Scripts/deploy.ps1 b/skills/src/csharp/todoskill/todoskill/Deployment/Scripts/deploy.ps1 index 2ec874cf98..42e2c12e50 100644 --- a/skills/src/csharp/todoskill/todoskill/Deployment/Scripts/deploy.ps1 +++ b/skills/src/csharp/todoskill/todoskill/Deployment/Scripts/deploy.ps1 @@ -187,7 +187,7 @@ if ($outputs) # Update appsettings.json Write-Host "> Updating appsettings.json ..." if (Test-Path $(Join-Path $projDir appsettings.json)) { - $settings = Get-Content $(Join-Path $projDir appsettings.json) | ConvertFrom-Json + $settings = Get-Content -Encoding utf8 $(Join-Path $projDir appsettings.json) | ConvertFrom-Json } else { $settings = New-Object PSObject @@ -196,7 +196,7 @@ if ($outputs) $settings | Add-Member -Type NoteProperty -Force -Name 'microsoftAppId' -Value $appId $settings | Add-Member -Type NoteProperty -Force -Name 'microsoftAppPassword' -Value $appPassword foreach ($key in $outputMap.Keys) { $settings | Add-Member -Type NoteProperty -Force -Name $key -Value $outputMap[$key].value } - $settings | ConvertTo-Json -depth 100 | Out-File $(Join-Path $projDir appsettings.json) + $settings | ConvertTo-Json -depth 100 | Out-File -Encoding utf8 $(Join-Path $projDir appsettings.json) if ($outputs.qnaMaker.value.key) { $qnaSubscriptionKey = $outputs.qnaMaker.value.key } @@ -206,6 +206,13 @@ if ($outputs) # Deploy cognitive models 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)'" + # Summary + Write-Host "Summary of the deployed resources:" -ForegroundColor Yellow + + Write-Host "- Resource Group: $($resourceGroup)" -ForegroundColor Yellow + + Write-Host "- Bot Web App: $($outputs.botWebAppName.value)`n" -ForegroundColor Yellow + # Publish bot Invoke-Expression "& '$(Join-Path $PSScriptRoot 'publish.ps1')' -name $($outputs.botWebAppName.value) -resourceGroup $($resourceGroup) -projFolder '$($projDir)'" diff --git a/skills/src/csharp/todoskill/todoskill/Deployment/Scripts/deploy_cognitive_models.ps1 b/skills/src/csharp/todoskill/todoskill/Deployment/Scripts/deploy_cognitive_models.ps1 index ddd21d0b3f..1d5c73b58f 100644 --- a/skills/src/csharp/todoskill/todoskill/Deployment/Scripts/deploy_cognitive_models.ps1 +++ b/skills/src/csharp/todoskill/todoskill/Deployment/Scripts/deploy_cognitive_models.ps1 @@ -297,4 +297,4 @@ foreach ($language in $languageArr) } # Write out config to file -$settings | ConvertTo-Json -depth 100 | Out-File $(Join-Path $outFolder "cognitivemodels.json" ) \ No newline at end of file +$settings | ConvertTo-Json -depth 100 | Out-File -Encoding utf8 $(Join-Path $outFolder "cognitivemodels.json" ) \ No newline at end of file diff --git a/skills/src/csharp/todoskill/todoskill/Deployment/Scripts/update_cognitive_models.ps1 b/skills/src/csharp/todoskill/todoskill/Deployment/Scripts/update_cognitive_models.ps1 index dd371f067b..33ce888873 100644 --- a/skills/src/csharp/todoskill/todoskill/Deployment/Scripts/update_cognitive_models.ps1 +++ b/skills/src/csharp/todoskill/todoskill/Deployment/Scripts/update_cognitive_models.ps1 @@ -24,7 +24,7 @@ else { Write-Host "> Getting config file ..." $languageMap = @{ } -$config = Get-Content -Raw -Path $configFile | ConvertFrom-Json +$config = Get-Content -Encoding utf8 -Raw -Path $configFile | ConvertFrom-Json $config.cognitiveModels.PSObject.Properties | Foreach-Object { $languageMap[$_.Name] = $_.Value } foreach ($langCode in $languageMap.Keys) { diff --git a/templates/Skill-Template/csharp/Sample/SkillSample/Deployment/Scripts/deploy_cognitive_models.ps1 b/templates/Skill-Template/csharp/Sample/SkillSample/Deployment/Scripts/deploy_cognitive_models.ps1 index ddd21d0b3f..1d5c73b58f 100644 --- a/templates/Skill-Template/csharp/Sample/SkillSample/Deployment/Scripts/deploy_cognitive_models.ps1 +++ b/templates/Skill-Template/csharp/Sample/SkillSample/Deployment/Scripts/deploy_cognitive_models.ps1 @@ -297,4 +297,4 @@ foreach ($language in $languageArr) } # Write out config to file -$settings | ConvertTo-Json -depth 100 | Out-File $(Join-Path $outFolder "cognitivemodels.json" ) \ No newline at end of file +$settings | ConvertTo-Json -depth 100 | Out-File -Encoding utf8 $(Join-Path $outFolder "cognitivemodels.json" ) \ No newline at end of file diff --git a/templates/Skill-Template/csharp/Template/Skill/Deployment/Scripts/deploy_cognitive_models.ps1 b/templates/Skill-Template/csharp/Template/Skill/Deployment/Scripts/deploy_cognitive_models.ps1 index ddf72e0705..1d5c73b58f 100644 --- a/templates/Skill-Template/csharp/Template/Skill/Deployment/Scripts/deploy_cognitive_models.ps1 +++ b/templates/Skill-Template/csharp/Template/Skill/Deployment/Scripts/deploy_cognitive_models.ps1 @@ -9,7 +9,7 @@ Param( [string] $luisSubscriptionKey, [string] $qnaSubscriptionKey, [string] $resourceGroup, - [switch] $useDispatch = $false, + [switch] $useDispatch, [string] $languages = "en-us", [string] $outFolder = $(Get-Location), [string] $logFile = $(Join-Path $PSScriptRoot .. "deploy_cognitive_models_log.txt")