Skip to content

Commit 23d110e

Browse files
authored
Run az account set --subscription at provision (#128)
1 parent fa3ad62 commit 23d110e

File tree

2 files changed

+8
-0
lines changed

2 files changed

+8
-0
lines changed

scripts/setup_credential.ps1

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,10 @@ $plainPassword = [System.Runtime.InteropServices.Marshal]::PtrToStringAuto($BSTR
5353

5454
$resourceGroupName = azd env get-value AZURE_RESOURCE_GROUP
5555
$containerAppName = azd env get-value SERVICE_API_NAME
56+
$subscriptionId = azd env get-value AZURE_SUBSCRIPTION_ID
57+
58+
az account set --subscription $subscriptionId
59+
Write-Host "🎯 Active Subscription: $(az account show --query '[name, id]' --output tsv)"
5660

5761

5862
Write-Host "Setup username and password in the secrets..."

scripts/setup_credential.sh

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,10 @@ done
3232
# Get resource group and container app name from azd
3333
resourceGroupName=$(azd env get-value AZURE_RESOURCE_GROUP)
3434
containerAppName=$(azd env get-value SERVICE_API_NAME)
35+
subscriptionId=$(azd env get-value AZURE_SUBSCRIPTION_ID)
36+
37+
az account set --subscription $subscriptionId
38+
echo "🎯 Active Subscription: $(az account show --query '[name, id]' --output tsv)"
3539

3640
echo "Setup username and password in the secrets..."
3741

0 commit comments

Comments
 (0)