Skip to content

Commit

Permalink
Adding logging for getting a token from Azure to assist with troubles…
Browse files Browse the repository at this point in the history
…hooting (#1094)
  • Loading branch information
jcrichlake authored May 14, 2024
1 parent df2186f commit 9cbca55
Showing 1 changed file with 7 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,9 @@

import com.azure.core.credential.TokenRequestContext;
import com.azure.identity.DefaultAzureCredentialBuilder;
import gov.hhs.cdc.trustedintermediary.wrappers.Logger;
import gov.hhs.cdc.trustedintermediary.wrappers.database.DatabaseCredentialsProvider;
import javax.inject.Inject;

/**
* AzureDatabaseCredentialsProvider is a class responsible for providing credentials for a database
Expand All @@ -19,8 +21,13 @@ public static AzureDatabaseCredentialsProvider getInstance() {

private AzureDatabaseCredentialsProvider() {}

@Inject Logger logger;

@Override
public String getPassword() {

logger.logInfo("Fetching credentials from Azure");

return new DefaultAzureCredentialBuilder()
.build()
.getTokenSync(
Expand Down

0 comments on commit 9cbca55

Please sign in to comment.