Skip to content

Commit 7cf36ec

Browse files
committed
add azure cli extensions in deployment scripts
Signed-off-by: Jianguo Ma <[email protected]>
1 parent ec2a293 commit 7cf36ec

File tree

2 files changed

+32
-18
lines changed

2 files changed

+32
-18
lines changed

asset-manager/scripts/deploy-to-azure.cmd

Lines changed: 16 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -78,15 +78,6 @@ if not defined SubscriptionId (
7878
)
7979
echo Using Subscription ID: !SubscriptionId!
8080

81-
rem Create resource group
82-
echo Creating resource group...
83-
cmd /c az group create --name %ResourceGroupName% --location %Location%
84-
if %ERRORLEVEL% neq 0 (
85-
echo Failed to create resource group. Exiting.
86-
exit /b 1
87-
)
88-
echo Resource group created.
89-
9081
rem Register Microsoft.DBforPostgreSQL provider and wait until completion
9182
echo Registering Microsoft.DBforPostgreSQL provider...
9283
cmd /c az provider register --namespace Microsoft.DBforPostgreSQL --wait
@@ -96,6 +87,22 @@ if %ERRORLEVEL% neq 0 (
9687
)
9788
echo Microsoft.DBforPostgreSQL provider registration completed.
9889

90+
rem Add Azure CLI extensions
91+
echo Adding/upgrading Azure CLI extensions...
92+
cmd /c az extension add --name containerapp --upgrade
93+
cmd /c az extension add --name rdbms-connect --upgrade
94+
cmd /c az extension add --name serviceconnector-passwordless --upgrade
95+
echo Azure CLI extensions added/upgraded.
96+
97+
rem Create resource group
98+
echo Creating resource group...
99+
cmd /c az group create --name %ResourceGroupName% --location %Location%
100+
if %ERRORLEVEL% neq 0 (
101+
echo Failed to create resource group. Exiting.
102+
exit /b 1
103+
)
104+
echo Resource group created.
105+
99106
rem Create Azure PostgreSQL server with Microsoft Entra authentication enabled and database
100107
echo Creating Azure PostgreSQL server with Microsoft Entra authentication and database...
101108
cmd /c az postgres flexible-server create ^

asset-manager/scripts/deploy-to-azure.sh

Lines changed: 16 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -70,15 +70,6 @@ if [ -z "$SubscriptionId" ]; then
7070
fi
7171
echo "Using Subscription ID: $SubscriptionId"
7272

73-
# Create resource group
74-
echo "Creating resource group..."
75-
az group create --name "$ResourceGroupName" --location "$Location"
76-
if [ $? -ne 0 ]; then
77-
echo "Failed to create resource group. Exiting."
78-
exit 1
79-
fi
80-
echo "Resource group created."
81-
8273
# Register Microsoft.DBforPostgreSQL provider and wait until completion
8374
echo "Registering Microsoft.DBforPostgreSQL provider..."
8475
az provider register --namespace Microsoft.DBforPostgreSQL --wait
@@ -88,6 +79,22 @@ if [ $? -ne 0 ]; then
8879
fi
8980
echo "Microsoft.DBforPostgreSQL provider registration completed."
9081

82+
# Add Azure CLI extensions
83+
echo "Adding/upgrading Azure CLI extensions..."
84+
az extension add --name containerapp --upgrade
85+
az extension add --name rdbms-connect --upgrade
86+
az extension add --name serviceconnector-passwordless --upgrade
87+
echo "Azure CLI extensions added/upgraded."
88+
89+
# Create resource group
90+
echo "Creating resource group..."
91+
az group create --name "$ResourceGroupName" --location "$Location"
92+
if [ $? -ne 0 ]; then
93+
echo "Failed to create resource group. Exiting."
94+
exit 1
95+
fi
96+
echo "Resource group created."
97+
9198
# Create Azure PostgreSQL server with Microsoft Entra authentication enabled and database
9299
echo "Creating Azure PostgreSQL server with Microsoft Entra authentication and database..."
93100
az postgres flexible-server create \

0 commit comments

Comments
 (0)