1

There are lots of questions and articles on how to do this with .NET, but how/is it possible to easily authenticate for local development through Azure AD shared secret credential using Java (Spring Boot specifically)?

For .NET, it is as easy as specifying the RunAs=CurrentUser property in the connection string to connect to the Azure Key Vault (per this article: https://learn.microsoft.com/en-us/azure/key-vault/service-to-service-authentication), connecting automatically (assuming my account is listed in the access policy for the key vault I want to access). Ideally, I would not want to use a thousand Java dependencies to do this, I could manually obtain a token to authenticate, but it would be nice to save developers the hassle of having to manually obtain a token from Azure every time we wanted to test things for local development.

Thanks!

J-man
  • 1,743
  • 3
  • 26
  • 50

1 Answers1

0

Here is an example os using MSICredentials Read Azure key vault secret through MSI in Java Just try using the AzureCliCredentials instead https://azure.github.io/azure-sdk-for-java/com/microsoft/azure/credentials/AzureCliCredentials.html

Piotr Gwiazda
  • 12,080
  • 13
  • 60
  • 91
  • @Piotr_Gwiazda, from what I understand, AzureCliCredentials makes use of a azure profile file (assumingly created by the Azure CLI or specific shell commands) and needs a client ID specified. From what I read on this site (https://github.com/Azure/azure-libraries-for-java/blob/master/AUTH.md#auth-file-formats) seems to experimental features and not fully supported. In addition, it seems specifying certain secrets is required and there is no way for Java to pass through my user credentials to the key vault automatically similar to how .NET does it? – J-man Jun 20 '19 at 13:59