-
Notifications
You must be signed in to change notification settings - Fork 3.2k
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
Use TokenCredential for Cosmos tests #33956
Conversation
test/EFCore.Cosmos.FunctionalTests/TestUtilities/CosmosTestStore.cs
Outdated
Show resolved
Hide resolved
@@ -223,10 +226,50 @@ private async Task CreateFromFile(DbContext context) | |||
} | |||
} | |||
|
|||
private static readonly ArmClient _armClient = new(TestEnvironment.TokenCredential); | |||
|
|||
public async Task<bool> EnsureCreatedAsync(DbContext context, CancellationToken cancellationToken = default) |
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.
Why do we have to fall out of EF code completely here. Is there not a way to use CreateDatabaseIfNotExistsAsync
or fix it so it can be used?
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.
To do that we'd need to take a dependency on Azure.ResourceManager.CosmosDB
and take resource group, subscription id, account name and AzureLocation as additional options.
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.
@AndriySvyryd Do we have an issue for that?
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.
@dotnet-policy-service rerun |
74fe0e4
to
2e8e1d7
Compare
We need to use
Azure.ResourceManager.CosmosDB
to create and delete databases because these operations aren't supported by the data-plane Cosmos SDK with Managed Identities