microsoft / azure-spring-boot

Spring Boot Starters for Azure services
MIT License
374 stars 460 forks source link

ClassNotFoundException: com.microsoft.azure.keyvault.authentication.KeyVaultCredentials #819

Closed jawwadfarooq closed 4 years ago

jawwadfarooq commented 4 years ago

Hi,

Environment

Summary

My project was initially using version 2.1.5 of azure-keyvault-secrets-spring-boot-starter but now when I have updated it to version 2.1.8 below exception is logged at runtime:

java.lang.ClassNotFoundException: com.microsoft.azure.keyvault.authentication.KeyVaultCredentials

Reproduce steps

Initially I had:

<dependency>
    <groupId>com.microsoft.azure</groupId>
    <artifactId>azure-keyvault-secrets-spring-boot-starter</artifactId>
    <version>2.1.5</version>
</dependency>

And the only change I did is:

<dependency>
    <groupId>com.microsoft.azure</groupId>
    <artifactId>azure-keyvault-secrets-spring-boot-starter</artifactId>
    <version>2.1.8</version>
</dependency>

Expected Results

Application should work and I must be be able to use: azure.keyvault.secret.keys

Actual Results

java.lang.ClassNotFoundException: com.microsoft.azure.keyvault.authentication.KeyVaultCredentials

superrdean commented 4 years ago

Hi @jawwadfarooq, sorry for the late response because of the Chinese New Year Public Holiday. There is a breaking change in 2.1.8. We update Keyvault SDK to azure-security-keyvault-secrets, in this SDK, it use azure-identity to do authentication, so KeyVaultCredentials is deprecated. If you update your version to 2.1.8. You can refer to the latest readme doc to configure your application. By the way, your issue is the same type with #822