Skip to content

Instantly share code, notes, and snippets.

@apc-kamezaki
Created August 8, 2021 11:50
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save apc-kamezaki/12015fa6e93b93cc4e6536e67f975147 to your computer and use it in GitHub Desktop.
Save apc-kamezaki/12015fa6e93b93cc4e6536e67f975147 to your computer and use it in GitHub Desktop.
Deploy postgresql using getSecret()
@description('key vault name')
param keyVaultName string
@description('secret name for db admin user')
param userSecretName string
@description('secret name for db admin password')
param passwordSecretName string
resource kv 'Microsoft.KeyVault/vaults@2019-09-01' existing = {
name: keyVaultName
}
resource pgsql 'Microsoft.DBForPostgreSQL/servers@2017-12-01' = {
name: name
location: location
sku: {
...
}
properties: {
createMode: 'Default'
administratorLogin: kv.getSecret(userSecretName)
administratorLoginPassword: kv.getSecret(passwordSecretName)
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment