I have some unit test code that connects to keyvault for reading various connect strings (ServiceBus, Redis, etc). Works fine when I manually run test code / key vault code in Visual Studio since my personal azure credentials are used by Visual Studio. However, I am pretty sure this will blow up when run as an automated test in Azure DevOps Pipeline due to the fact that DevOps Pipeline won't have permissions to KeyVault. What configuration needs to be done so that automated tests in DevOps pipline have read permissions to key vault?
1
votes
1 Answers
0
votes
you will need to add the managed identity of the azure dev ops to the allowed identities of the key vault. Don't know how to get those :(
Nevertheless... I think, if you need credentials from the vault, you should think about your test designs and maybe mock/stub them away. At least, when they are not integration tests.