-
Notifications
You must be signed in to change notification settings - Fork 206
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Support for AAD Audience in connection string (for sovereign cloud) & bump in autoconfigure version #4121
base: main
Are you sure you want to change the base?
Conversation
@@ -353,6 +359,13 @@ public ConnectionString getConnectionString() { | |||
return connectionString; | |||
} | |||
|
|||
public String getAadAudienceWithScope() { | |||
if (connectionString == null) { | |||
return APPLICATIONINSIGHTS_AUTHENTICATION_SCOPE; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This line was added because ConsumptionPlanEnabledTest & RunTimeAttachWithDelayedConnectionStringTest were failing without this check. This raises a few questions ~
- Are azure functions w/ consumption plan enabled supported in sovereign clouds? If so, would the connection string always be set with some delay? Or is it still possible in azure function consumption plans to not set the connection string with a delay?
- I noticed in these tests that the connection string is still null by the time the http pipelines are being created. Is there a need to refactor code such that http pipelines shouldn't be created unless the connection string is set to some value, or to be able to handle dynamic config for http pipeline somehow?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The runtime attachment is related to https://learn.microsoft.com/en-us/azure/azure-monitor/app/java-spring-boot#enabling-programmatically.
The connection string can be configured at runtime (programmatically) with -javaagent or the runtime attachment.
With Azure function, the connection string retrieval is delayed:
Line 90 in d89b256
runtimeConfig.connectionString = getAndLogAtDebug("APPLICATIONINSIGHTS_CONNECTION_STRING"); |
About question 1, I don't know.
About 2, it may have several options. The place where the connection string is set at runtime (programmatic configuration or Azure function):
Line 121 in d89b256
updateConnectionString(runtimeConfig.connectionString); |
Fix # .
Note: Don't merge until this related change from the autoconfigure module is released.
This PR incorporates connection string parsing changes from the autoconfigure module to use the AAD audience that is either provided via the connection string (or a default audience if that isn't provided). This is applicable for sovereign cloud scenarios where customers may be using AAD auth - the LazyHttpClient would use the provided audience when creating a new http pipeline, and all calls to quickpulse/breeze/profiler would be made with that audience.
Tested in sovereign cloud environment via a local build.
For significant contributions please make sure you have completed the following items: