Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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
Enable External Durable Client Managed Identity Support #2856
Enable External Durable Client Managed Identity Support #2856
Changes from 6 commits
bcae802
aeff250
cbda2b6
9d4384f
e386417
0c6ed16
064b5dd
0716f93
File filter
Filter by extension
Conversations
Jump to
There are no files selected for viewing
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.
I'm a bit confused about this. Some questions:
(1) Are there other connection strings with prefix "AzureWebJobs" that aren't "AzureWebJobsStorage"?
(2) Why is it that we only apply this logic to connections with the "AzureWebJobs" prefix?
(3) How do we know the "name" parameter doesn't already include the "AzureWebJobs" prefix :) ?
Thanks!
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.
@davidmrdavid That's a good question, it's a little confusing here. This is a special case that is quite hard to explain and let me know if anything is unclear to you.
This is a scenario that specially for using a durable client in Functions App. When the Functions app started, the Functions Host will look for
AzureWebJobsStorage
(side note: this is the default value, the connection name could be others, eg: MyCustomeStorage, but functions host will alwasy look for one with AzureWebJobs prefix, in this case it will be AzureWebJobsMyCustomeStorage) especially . If there is no such a value, the host will fail. So we have to check the connection name withAzureWebJobs
first so that the host can start successfully. Once the Host successfully started, then the method creating the external durable client will be called. In here, it will only look for connection name asxxx
especially with no prefix.So to answer the second question, this is the only scenario that we need a prefix check, only at Functions the configuration always starts with AzureWebJobs so we don't need to check other prefix.
For (3), if it already includes, then the prefix name will be like
AzureWebJobsAzureWebJobsStorage
. And thus the section it look for will be null ( checking bythe methodIfExists()
), and thus the Resolve will look for the name itself with no prefix.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.
Our
WebJobsConnectionInfoProvider
which is for the internal durable client also use this strategy. You can check it here . And it said that this logic is basically from the function host which is here .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.
Can we add a comment including the information in this thread? I'm mostly looking for a comment that explains why we added the code in the
Resolve
method.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.
Just added the comments inside Resolve method. Let me know if it isn't clear to you :)