Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -52,8 +52,8 @@ fi
# Get the name of the Azure Key Vault Secrets Provider identity from the resourceId
KV_IDENTITY_NAME=$(basename $KV_IDENTITY_RESOURCE_ID)

# Assign the Key Vault Secrets User role to the managed identity on the key vault
ROLE="Key Vault Secrets User"
# Assign the Key Vault Administrator role to the managed identity on the node resource group
ROLE="Key Vault Administrator"
Comment thread
paolosalvatori marked this conversation as resolved.
MANAGED_IDENTITY_NAME="$KV_IDENTITY_NAME"
PRINCIPAL_ID="$KV_IDENTITY_OBJECT_ID"
SCOPE_ID="$KEY_VAULT_ID"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -98,8 +98,9 @@ else
exit
fi

# Assign the Key Vault Secrets User role to the managed identity on the key vault
ROLE="Key Vault Secrets User"
# Assign the Key Vault Administrator role to the managed identity on the node resource group
ROLE="Key Vault Administrator"
PRINCIPAL_ID="$PRINCIPAL_ID"
Comment thread
paolosalvatori marked this conversation as resolved.
SCOPE_ID="$KEY_VAULT_ID"
SCOPE_NAME="$KEY_VAULT_NAME"
SCOPE_TYPE="key vault"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -92,24 +92,24 @@ fi
echo "Ensuring firewall rule [$FIREWALL_RULE_NAME] exists on PostgreSQL flexible server [$PG_SERVER_NAME]..."
az postgres flexible-server firewall-rule create \
--resource-group "$RESOURCE_GROUP_NAME" \
--name "$PG_SERVER_NAME" \
--rule-name "$FIREWALL_RULE_NAME" \
--server-name "$PG_SERVER_NAME" \
--name "$FIREWALL_RULE_NAME" \
--start-ip-address 0.0.0.0 \
--end-ip-address 255.255.255.255 \
--only-show-errors 1>/dev/null

# Create the PostgreSQL database
echo "Checking if PostgreSQL database [$PG_DATABASE_NAME] exists..."
az postgres flexible-server db show \
--database-name "$PG_DATABASE_NAME" \
--name "$PG_DATABASE_NAME" \
--server-name "$PG_SERVER_NAME" \
--resource-group "$RESOURCE_GROUP_NAME" \
--only-show-errors &>/dev/null

if [[ $? != 0 ]]; then
echo "Creating PostgreSQL database [$PG_DATABASE_NAME]..."
az postgres flexible-server db create \
--database-name "$PG_DATABASE_NAME" \
--name "$PG_DATABASE_NAME" \
--server-name "$PG_SERVER_NAME" \
--resource-group "$RESOURCE_GROUP_NAME" \
--charset UTF8 \
Expand Down