My pipeline in Azure DevOps do the following:
Bash script: to avoid problem that database cannot be removed( Azure PostgreSQL: it is not possible to remove database through Azure CLI )
Azure Key Vault: Obtain Key Vault variables for login to PostgreSQL database
- Azure CLI: Remove database using Azure CLI;
- NPM install: initialize NodeJS packages from package.json
- NPM run: start apply.js file which connects to PostgreSQL, create database, and apply schema using liquibase;
apply.js uses some environment variables like DB_HOST,DB_PASSWORD, DB_USER,
which are stored in Variable Group, however, the password in Key Vault is stored as postgres-password
variable. So, the problem is how to save KV postgres-admin-password
variable into common DB_PASSWORD
variable.
Is there any way to do this?