Giter Site home page Giter Site logo

[QUERY] Issue with running spring boot application on azure spring apps with key vault configuration by using service principal identity about azure-sdk-for-java HOT 4 OPEN

kirankumar994 avatar kirankumar994 commented on June 26, 2024
[QUERY] Issue with running spring boot application on azure spring apps with key vault configuration by using service principal identity

from azure-sdk-for-java.

Comments (4)

github-actions avatar github-actions commented on June 26, 2024

@chenrujun @moarychan @Netyyyy @saragluna

from azure-sdk-for-java.

github-actions avatar github-actions commented on June 26, 2024

Thank you for your feedback. Tagging and routing to the team member best able to assist.

from azure-sdk-for-java.

saragluna avatar saragluna commented on June 26, 2024

@kirankumar994 are you using the com.azure.spring spring-cloud-azure-starter-keyvault to retrieve the kv property source, instead of using the kv secret client and get the secret by yourself?

from azure-sdk-for-java.

kirankumar994 avatar kirankumar994 commented on June 26, 2024

Hi @saragluna , here is the dependency I am using.

<dependency> <groupId>com.azure.spring</groupId> <artifactId>spring-cloud-azure-starter-keyvault</artifactId> <version>5.11.0</version> </dependency>

But, as I mentioned in the above I am able to run the application on my local by configurin the bean in my Reactive Mongo config as below

`@Bean
public SecretClient createSecretClient() {

   ClientSecretCredential clientSecretCredential = new ClientSecretCredentialBuilder()
            .clientId(clientId)
            .clientSecret(clientSecret)
            .tenantId(tenantId)
            .build();

    // Azure SDK client builders accept the credential as a parameter.
   return new SecretClientBuilder()
            .vaultUrl(keyVaultEndpoint)
            .credential(clientSecretCredential)
            .buildClient();
}`

The clientId, secret and tenantId are reading from the application properties file. I am not facing any issue on my local. Here is the following I am trying to do.
- Keeping clientId, secret and tenantId in the application properties file and reading in the above code. The application is up and runnin after I login with az login service principal.
- Later, I copied the same properties in the azure spring apps environment variables and tried to deploy the application on azure spring apps, then it is failing to start the application and throwing the below exception.

 java.lang.IllegalStateException: Failed to configure KeyVault property source

I would like to know what I am doing wrong here. Thank you in advance.

from azure-sdk-for-java.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.