Accessing Azure Key Vault from ml-gradle project

53 Views Asked by At

I have set up a key vault that has an encrypted password and I want to use it from the Gradle MarkLogic project. Gradle properties hold the value of "username", but for security purposes, want to access the vault and use that as a "password".

1

There are 1 best solutions below

0
rjrudin On

Accessing data stored in external locations like Azure Key Vault is outside the scope of ml-gradle and most other Gradle plugins. Gradle plugins get all their configuration from Gradle's set of properties. So it's up to you to get data from your Azure Key Vault into Gradle's set of properties.

This shows how to use the Gradle credentials plugin - https://github.com/marklogic/ml-gradle/wiki/Encrypting-passwords - but I'm not sure that will help you, as you first need to find a way to programmatically obtain your Key Vault password.

The Gradle properties plugin also supports reading properties for a variety of sources - https://github.com/stevesaliman/gradle-properties-plugin - but again, you'd need to get your Key Vault password into one of those locations.

Perhaps https://github.com/microsoft/azure-gradle-plugins offers some support, but ultimately, you have to provide the password to Gradle in order for ml-gradle, or any other Gradle plugin, to have access to it.