azure-sdk-for-java: [BUG] Spring Boot Application hangs during startup while retrieving Key Vault secrets

Describe the bug Spring Boot Application hangs during startup while retrieving secrets from Key Vault. Similar to following issues:

https://github.com/microsoft/azure-spring-boot/issues/909 https://github.com/microsoft/azure-spring-boot/issues/853

Exception or Stack Trace No error/exceptions shown

*** Reproduce Steps***

  1. Create a spring boot project
  2. Add maven dependencies as shown below
  3. Create a SecretClient Bean by providing credential from MenagedIdentityCredential.
@Bean
    public ManagedIdentityCredential createAzureMSICredential() {
        return new ManagedIdentityCredentialBuilder().clientId(properties.getClientId()).build();
    }
 @Bean
    public SecretClient secretClient() {
        return new SecretClientBuilder().vaultUrl(properties.getUri())
                .credential(msi)
                .buildClient();
    }
  1. Use secret client to get secret.
KeyVaultSecret secret = secretClient.getSecret(properties.getKey());

Expected behavior Expected to have secrets retrieved successfully and continue the spring boot startup.

Setup (please complete the following information):

  • Spring Boot: 2.2.5.RELEASE
  • Project Maven related dependencies:
       <dependency>
            <groupId>com.azure</groupId>
            <artifactId>azure-identity</artifactId>
            <version>1.1.0</version>
        </dependency>
        <dependency>
            <groupId>com.azure</groupId>
            <artifactId>azure-security-keyvault-secrets</artifactId>
            <version>4.2.0</version>
        </dependency>

Information Checklist Kindly make sure that you have added all the following information above and checkoff the required fields otherwise we will treat the issuer as an incomplete report

  • Bug Description Added
  • Repro Steps Added
  • Setup information Added

About this issue

  • Original URL
  • State: closed
  • Created 4 years ago
  • Reactions: 3
  • Comments: 19 (7 by maintainers)

Commits related to this issue

Most upvoted comments

Hi @vcolin7 - thanks for the reply! I created a new ticket here: https://github.com/Azure/azure-sdk-for-java/issues/17617