-
Notifications
You must be signed in to change notification settings - Fork 494
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
CosmosClientOptions: Add ApplicationPreferredRegions #1305
Conversation
|
||
[TestMethod] | ||
[ExpectedException(typeof(ArgumentException))] | ||
public void VerifyLimitToEndpointSettingsWithPreferredRegions() |
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 is probably outside the scope of this PR but is there any way to validate the SDK is following the order provided?
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.
Good question, I believe it depends on the error. I've seen logic in the ClientRetryPolicy which should honor the order but other that are actively not honoring it. I am not familiar with why it works like that.
@kirillg FYR we are adding preferred locations as explicit specification. |
Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Tests/DotNetSDKAPI.json
Outdated
Show resolved
Hide resolved
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.
Please follow the required format. [Internal] Category: (Add|Fix) Description
Pull Request Template
Description
The most common use case for global availability is for applications to specify
ApplicationRegion
inCosmosClientOptions
.ApplicationRegion
defines where is the current application running and lets the SDK populate the list of preferred regions based on availability (which regions the account is available on) and distance (closest regions first).There are however, some situations where the application might want to manually specify the order of preference.
This PR adds the
CosmosClientOptions.ApplicationPreferredRegions
to enable these scenarios as an alternative toApplicationRegion
. Both cannot be set.Type of change
Closing issues
Closes #1306