Skip to content

Commit 68f0235

Browse files
committed
Enable pgaadauth extension, add Private DNS dependsOn, fix firewall CLI syntax, and fail on SQL errors
1 parent d340d87 commit 68f0235

2 files changed

Lines changed: 2 additions & 1 deletion

File tree

cloud-infrastructure/cluster/grant-database-permissions.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ echo "$(date +"%Y-%m-%dT%H:%M:%S") Granting $MANAGED_IDENTITY_NAME (Client ID: $
2525
# and grant it the necessary permissions. The pgaadauth_create_principal function handles
2626
# Entra ID principal creation in Azure Database for PostgreSQL Flexible Server.
2727
ENTRA_USER=$(az postgres flexible-server microsoft-entra-admin list --resource-group $CLUSTER_RESOURCE_GROUP_NAME --server-name $POSTGRES_SERVER_NAME --query "[0].principalName" --output tsv)
28-
PGPASSWORD=$ACCESS_TOKEN psql "host=$POSTGRES_HOST dbname=$DATABASE_NAME user='$ENTRA_USER' sslmode=require" << EOF
28+
PGPASSWORD=$ACCESS_TOKEN psql -v ON_ERROR_STOP=1 "host=$POSTGRES_HOST dbname=$DATABASE_NAME user='$ENTRA_USER' sslmode=require" << EOF
2929
DO \$\$
3030
BEGIN
3131
IF NOT EXISTS (SELECT FROM pg_catalog.pg_roles WHERE rolname = '$MANAGED_IDENTITY_NAME') THEN

cloud-infrastructure/modules/postgresql-flexible-server.bicep

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,7 @@ resource privateEndpoint 'Microsoft.Network/privateEndpoints@2025-01-01' = {
6060
location: location
6161
tags: tags
6262
properties: {
63+
customNetworkInterfaceName: '${name}-postgres'
6364
subnet: {
6465
id: subnetId
6566
}

0 commit comments

Comments
 (0)