Get started with azure key vault. Setup instructions, features, and configuration details inside. Refer to the official documentation for the latest updates.
The setup steps covers the use of the managed version of the Azure Key Vault as secrets manager but
for the non-managed follow only the steps related to the Airflow server and CLI.
It if possible to use different Principals for OpenMetadata Server and the Ingestion. In that case the server needs higher privileges - Key Vault Secrets Officer - to be able to create/read/update secrets in the Vault.While the Airflow part only needs to read the secrets hence the role Key Vault Secrets Officer.
We have to set up the secret manager provider we want to use, that in our case is azure-kv, and the credentials.The changes to be done in openmetadata.yaml file of the OpenMetadata server are:
---secretsManagerConfiguration: secretsManager: managed-azure-kv # or env var SECRET_MANAGER. For non-managed use 'azure-kv'. prefix: ${SECRET_MANAGER_PREFIX:-""} # Define the secret key ID as <prefix>-<clusterName>-<key> tags: ${SECRET_MANAGER_TAGS:-[]} # Add tags to the created resource. Format is `[key1:value1,key2:value2,...]` parameters: enabled: true vaultName: ${OM_SM_VAULT_NAME:-""}pipelineServiceClientConfiguration: secretsManagerLoader: ${PIPELINE_SERVICE_CLIENT_SECRETS_MANAGER_LOADER:-airflow}
For Helm Values, you will need to add PIPELINE_SERVICE_CLIENT_SECRETS_MANAGER_LOADER as part of extraEnvs. This will look like below -
---secretsManagerConfiguration: secretsManager: managed-azure-kv # or env var SECRET_MANAGER. For non-managed use 'azure-kv'. prefix: ${SECRET_MANAGER_PREFIX:-""} # Define the secret key ID as <prefix>-<clusterName>-<key> tags: ${SECRET_MANAGER_TAGS:-[]} # Add tags to the created resource. Format is `[key1:value1,key2:value2,...]` parameters: enabled: true clientId: ${OM_SM_CLIENT_ID:-""} clientSecret: ${OM_SM_CLIENT_SECRET:-""} tenantId: ${OM_SM_TENANT_ID:-""} vaultName: ${OM_SM_VAULT_NAME:-""}pipelineServiceClientConfiguration: secretsManagerLoader: ${PIPELINE_SERVICE_CLIENT_SECRETS_MANAGER_LOADER:-airflow}
For Helm Values, you will need to add PIPELINE_SERVICE_CLIENT_SECRETS_MANAGER_LOADER as part of extraEnvs. This will look like below -
After updating the configuration files, we are ready to migrate the secrets and restart both services.In order to ensure that the current sensitive information is properly migrated to the Secrets Manager, you need to
run the following command:
./bootstrap/openmetadata-ops.sh migrate-secrets
Make sure you are running it with the same environment variables required by the server.If everything goes as planned, all the data would be displayed using the parameters names which starts with
openmetadata-... in your Key Vault console.Note: If we want to change the starting path for our secrets names from openmetadata to a different one, we have
to change the property clusterName in our openmetadata.yaml. Also, if you inform the prefix value, it will be
added before the clusterName, i.e., <prefix>-<clusterName>-<key>You can inform the tags as well as a list of strings [key1:value1,key2:value2,...]. These tags will be added
to the created secret.
After enabling the Secret Manager, we also have to make a slight change in our workflows YAML files. In the
workflowConfig we have to add the secret manager configuration: