Skip to content
This repository was archived by the owner on Jun 30, 2022. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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 @@ -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
Expand All @@ -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 }

Expand All @@ -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)'"

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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" )
$settings | ConvertTo-Json -depth 100 | Out-File -Encoding utf8 $(Join-Path $outFolder "cognitivemodels.json" )
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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 }

Expand All @@ -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)'"

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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" )
$settings | ConvertTo-Json -depth 100 | Out-File -Encoding utf8 $(Join-Path $outFolder "cognitivemodels.json" )
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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 }

Expand All @@ -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)'"

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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" )
$settings | ConvertTo-Json -depth 100 | Out-File -Encoding utf8 $(Join-Path $outFolder "cognitivemodels.json" )
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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 }

Expand All @@ -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)'"

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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" )
$settings | ConvertTo-Json -depth 100 | Out-File -Encoding utf8 $(Join-Path $outFolder "cognitivemodels.json" )
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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 }

Expand All @@ -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)'"

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand All @@ -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)"
}
}

Expand Down Expand Up @@ -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
}
Expand Down Expand Up @@ -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
}
}
Expand All @@ -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" )
$settings | ConvertTo-Json -depth 100 | Out-File -Encoding utf8 $(Join-Path $outFolder "cognitivemodels.json" )
Loading