hashicorp-vault-plugin icon indicating copy to clipboard operation
hashicorp-vault-plugin copied to clipboard

Feature Request: Azure Secrets

Open dwizzle204 opened this issue 3 years ago • 0 comments

Add ability to generate dynamic credentials to use in build step

node {
    def secrets = [
        [path: 'azure/creds/myazurerole', engineVersion: azure, secretValues: [
            [client_id: 'myID', client_secret: 'mySecret'],
           ]],
    ]

    def configuration = [vaultUrl: 'http://my-very-other-vault-url.com',
                         vaultCredentialId: 'my-vault-cred-id',
                         engineVersion: azure]
    // inside this block your credentials will be available as env variables
    withVault([configuration: configuration, vaultSecrets: secrets]) {
        sh 'az login --service-principal -u ${env.myID} -p ${env.mySecret} --tenant 202020200202
    }
}

dwizzle204 avatar Nov 20 '20 03:11 dwizzle204