Skip to content

Commit ec2a293

Browse files
committed
fix error: The subscription is not registered to use namespace 'Microsoft.DBforPostgreSQL'
Signed-off-by: Jianguo Ma <[email protected]>
1 parent 6b0e64f commit ec2a293

File tree

2 files changed

+18
-0
lines changed

2 files changed

+18
-0
lines changed

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

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -87,6 +87,15 @@ if %ERRORLEVEL% neq 0 (
8787
)
8888
echo Resource group created.
8989

90+
rem Register Microsoft.DBforPostgreSQL provider and wait until completion
91+
echo Registering Microsoft.DBforPostgreSQL provider...
92+
cmd /c az provider register --namespace Microsoft.DBforPostgreSQL --wait
93+
if %ERRORLEVEL% neq 0 (
94+
echo Failed to register Microsoft.DBforPostgreSQL provider. Exiting.
95+
exit /b 1
96+
)
97+
echo Microsoft.DBforPostgreSQL provider registration completed.
98+
9099
rem Create Azure PostgreSQL server with Microsoft Entra authentication enabled and database
91100
echo Creating Azure PostgreSQL server with Microsoft Entra authentication and database...
92101
cmd /c az postgres flexible-server create ^

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

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -79,6 +79,15 @@ if [ $? -ne 0 ]; then
7979
fi
8080
echo "Resource group created."
8181

82+
# Register Microsoft.DBforPostgreSQL provider and wait until completion
83+
echo "Registering Microsoft.DBforPostgreSQL provider..."
84+
az provider register --namespace Microsoft.DBforPostgreSQL --wait
85+
if [ $? -ne 0 ]; then
86+
echo "Failed to register Microsoft.DBforPostgreSQL provider. Exiting."
87+
exit 1
88+
fi
89+
echo "Microsoft.DBforPostgreSQL provider registration completed."
90+
8291
# Create Azure PostgreSQL server with Microsoft Entra authentication enabled and database
8392
echo "Creating Azure PostgreSQL server with Microsoft Entra authentication and database..."
8493
az postgres flexible-server create \

0 commit comments

Comments
 (0)