jenkinsci / azure-keyvault-plugin

Jenkins plugin for Azure Keyvault
https://plugins.jenkins.io/azure-keyvault/
MIT License
14 stars 21 forks source link

unable to authenticate to azure key vault using managed service identities #252

Closed apeterson-dmigs closed 5 months ago

apeterson-dmigs commented 5 months ago

hello, i have been trying to connect my jenkins instance to one of my azure key vaults using a managed service identity. after entering the required key vault url and managed service identity credentials, i get a message saying that "manage service authentication is unavailable". i am running my jenkins instance on localhost. the details of the error are given in the image below:

Screenshot 2024-05-22 160820

timja commented 5 months ago

Are you running your Jenkins in Azure?

apeterson-dmigs commented 5 months ago

i am running my jenkins instance in an azure vm. the azure vm isn't running in the same resource group as the key vault instance and the managed identity, which themselves are in the same resource group.

timja commented 5 months ago

Is the managed identity assigned to the Jenkins VM?

apeterson-dmigs commented 5 months ago

you're right, it isn't. that was the issue.

for future ref, make sure the UAMSI has access to the desired AKV and (if using an azure vm), make sure to assign the UAMSI to the VM with jenkins running on it. it will work even if the VM is in a different resource group to the UAMSI and AKV.