Skip to content

Commit bc9da5b

Browse files
committed
Store Locator small fix
1 parent 852e227 commit bc9da5b

1 file changed

Lines changed: 13 additions & 13 deletions

File tree

Static/storelocator/deploy.ps1

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ if ($Help.IsPresent) {
3939
DisplayHelp
4040
}
4141

42-
echo "Starting..."
42+
Write-Output "Starting..."
4343

4444
try {
4545
# Generate a random suffix for the Cosmos DB and Web App
@@ -53,15 +53,15 @@ try {
5353
$webappname = "web-$Name$suffix"
5454

5555
# Create a resource group
56-
echo "- Creating a Resource Group named '$group' in the '$Location' location..."
56+
Write-Output "- Creating a Resource Group named '$group' in the '$Location' location..."
5757
az group create --name $group --location $Location | Out-Null
5858

5959
# Create Azure Maps account
60-
echo "- Creating an Azure Maps account named '$azuremaps'..."
60+
Write-Output "- Creating an Azure Maps account named '$azuremaps'..."
6161
az maps account create -g $group --account-name $azuremaps --sku G2 --kind Gen2 --accept-tos | Out-Null
6262

6363
# Create Azure Cosmos DB
64-
echo "- Creating an Azure Cosmos DB server named '$cosmosdb'..."
64+
Write-Output "- Creating an Azure Cosmos DB server named '$cosmosdb'..."
6565
az cosmosdb create -g $group --name $cosmosdb --locations regionName=$Location --capabilities EnableServerless | Out-Null
6666

6767
#echo "- Creating a database named '$DatabaseName'..."
@@ -71,12 +71,12 @@ try {
7171
$connectionString = $(az cosmosdb keys list -g $group --name $cosmosdb --type connection-strings --query 'connectionStrings[0].connectionString' -o tsv)
7272

7373
# Create Webserver and Website
74-
echo "Creating a Webserver plan named '$webserverplan' for the Website '$webappname'..."
74+
Write-Output "- Creating a Webserver plan named '$webserverplan' for the Website '$webappname'..."
7575
az appservice plan create -g $group -n $webserverplan --location $Location | Out-Null
7676
az webapp create -g $group -p $webserverplan -n $webappname -r "dotnet:8" | Out-Null
7777

7878
# Use managed identities
79-
echo "- Utilizing managed identities for Azure Maps..."
79+
Write-Output "- Utilizing managed identities for Azure Maps..."
8080
az webapp identity assign -n $webappname -g $group | Out-Null
8181

8282
Start-Sleep -Seconds 5
@@ -90,10 +90,10 @@ try {
9090
$azuremaps = (az maps account show -n $azuremaps -g $group --query 'properties.uniqueId' --output tsv)
9191

9292
# Creating AD App registration
93-
echo "- Creating an Azure AD App registration..."
93+
Write-Output "- Creating an Azure AD App registration..."
9494
az ad app create --display-name "Azure Maps Store Locator for $webappname" --web-redirect-uris https://$webappname.azurewebsites.net/signin-oidc https://localhost:7074/signin-oidc --enable-access-token-issuance true --enable-id-token-issuance true --sign-in-audience AzureADMyOrg | Out-Null
9595

96-
echo "- Storing App Settings..."
96+
Write-Output "- Storing App Settings..."
9797
$clinetId = (az ad app list --display-name "Azure Maps Store Locator for $webappname" --query '[0].appId' -o tsv)
9898
$tenantId = (az account show --query 'tenantId' -o tsv)
9999
$email = (az rest --method get --url 'https://graph.microsoft.com/v1.0/me' --query 'userPrincipalName' -o tsv)
@@ -102,15 +102,15 @@ try {
102102
az webapp config appsettings set -g $group -n $webappname --settings AzureMaps:ClientId=$azuremaps AzureMaps:TokenUrl=/api/azuremaps/token Database:Name=$DatabaseName Database:ConnectionString=$connectionString AzureAd:Instance=https://login.microsoftonline.com/ AzureAd:Domain=$domain AzureAd:TenantId=$tenantId AzureAd:ClientId=$clinetId AzureAd:CallbackPath=/signin-oidc | Out-Null
103103

104104
# Deploy Azure Maps Store Locator
105-
echo "- Initiating the deployment of the Store Locator website..."
106-
iwr "https://samples.azuremaps.com/storelocator/storelocator.zip" -o storelocator$suffix.zip
105+
Write-Output "- Initiating the deployment of the Store Locator website..."
106+
Invoke-WebRequest "https://samples.azuremaps.com/storelocator/storelocator.zip" -OutFile storelocator$suffix.zip
107107
az webapp deployment source config-zip -g $group -n $webappname --src storelocator$suffix.zip | Out-Null
108108
Remove-Item storelocator$suffix.zip | Out-Null
109109

110110
# Done
111-
echo "Open https://$webappname.azurewebsites.net/ to access your Store Locator."
112-
echo "Done! Your Azure Maps Store Locator infrastructure and website are ready."
111+
Write-Output "Open https://$webappname.azurewebsites.net/ to access your Store Locator."
112+
Write-Output "Done! Your Azure Maps Store Locator infrastructure and website are ready."
113113
}
114114
catch {
115-
echo "An error occurred: $($_.Exception.Message)"
115+
Write-Output "An error occurred: $($_.Exception.Message)"
116116
}

0 commit comments

Comments
 (0)