ERROR c.a.identity.ClientSecretCredential - Azure Identity => ERROR in getToken() call for scopes [https://vault.azure.net/.default]: clientSecret is null or empty
This is the methoud i am using to create datasource private DataSource createDataSourceForTenant(String realmID) { try { // Construct secret IDs String passwordSecretId = String.format(PASSWORD_SECRET_NAME_FORMAT, environment, realmID); String serverSecretId = String.format(SERVER_SECRET_NAME_FORMAT, environment, realmID);
// Retrieve secrets
KeyVaultSecret passwordSecret = secretClient.getSecret(passwordSecretId);
KeyVaultSecret serverSecret = secretClient.getSecret(serverSecretId);
// Extract credentials
String password = passwordSecret.getValue();
String server = serverSecret.getValue();
LOGGER.info("Retrieved credentials for TM DB - Server: {}, Password: [PROTECTED]", server);
// Create JDBC URL assuming a standard format
String jdbcUrl = String.format("jdbc:sqlserver://%s:1433;databaseName=%s", server, TM_DB);
HikariConfig config = new HikariConfig();
config.setJdbcUrl(jdbcUrl);
config.setUsername(USERNAME);
config.setPassword(password);
return new HikariDataSource(config);
} catch (Exception e) {
LOGGER.error("Failed to create DataSource for realmID: {}", realmID, e);
throw new RuntimeException("Failed to create DataSource", e);
}
}
I am getting this Exception can you please look into this issue,i took secrets generated by code by debugging and tried in Azure i am getting secret names correctly but still not able to get values 12:39:15.202 [reactor-http-nio-1] ERROR c.a.identity.ClientSecretCredential - Azure Identity => ERROR in getToken() call for scopes [https://vault.azure.net/.default]: clientSecret is null or empty 12:39:16.297 [reactor-http-nio-1] ERROR c.a.identity.ClientSecretCredential - Azure Identity => ERROR in getToken() call for scopes [https://vault.azure.net/.default]: clientSecret is null or empty 12:39:18.161 [reactor-http-nio-1] ERROR c.a.identity.ClientSecretCredential - Azure Identity => ERROR in getToken() call for scopes [https://vault.azure.net/.default]: clientSecret is null or empty 12:39:21.707 [reactor-http-nio-1] ERROR c.a.identity.ClientSecretCredential - Azure Identity => ERROR in getToken() call for scopes [https://vault.azure.net/.default]: clientSecret is null or empty 12:39:21.708 [reactor-http-nio-1] WARN c.a.s.k.secrets.SecretAsyncClient - Failed to get secret - tms-archive-dev-tms-db-password-be4f579f-43b4-4095-87d3-e15c3219fad9 Max retries 3 times exceeded. Error Details: clientSecret is null or empty
@billwert @g2vinay
Thank you for your feedback. Tagging and routing to the team member best able to assist.
Hello @Aranipavan123!
I have a few questions:
- What version of
azure-identityare you using? - Where and how are you constructing the
ClientSecretCredentialthat you're giving to yourSecretClient? - What is the full callstack?
Hi @Aranipavan123. Thank you for opening this issue and giving us the opportunity to assist. To help our team better understand your issue and the details of your scenario please provide a response to the question asked above or the information requested above. This will help us more accurately address your issue.
Hi @Aranipavan123, we're sending this friendly reminder because we haven't heard back from you in 7 days. We need more information about this issue to help address it. Please be sure to give us your input. If we don't hear back from you within 14 days of this comment the issue will be automatically closed. Thank you!