-
Notifications
You must be signed in to change notification settings - Fork 519
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
Add support for CosmosDB vnext-preview emulator #7048
base: main
Are you sure you want to change the base?
Conversation
Added a new experimental API - RunAsPreviewEmulator. This will use the new Linux-based emulator, which starts faster. And it also has support for a built-in Data Explorer which can be enabled by calling WithDataExplorer on the emulator. Fix dotnet#5163
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.
Copilot reviewed 5 out of 9 changed files in this pull request and generated no comments.
Files not reviewed (4)
- src/Aspire.Hosting.Azure.CosmosDB/PublicAPI.Shipped.txt: Language not supported
- src/Aspire.Hosting.Azure.CosmosDB/PublicAPI.Unshipped.txt: Language not supported
- src/Aspire.Hosting.Azure.CosmosDB/AzureCosmosDBEmulatorConnectionString.cs: Evaluated as low risk
- src/Aspire.Hosting.Azure.CosmosDB/AzureCosmosDBEmulatorResource.cs: Evaluated as low risk
Comments suppressed due to low confidence (1)
playground/CosmosEndToEnd/CosmosEndToEnd.ApiService/Program.cs:23
- The partition key path was changed from
/Id
to/id
. If the partition key is case-sensitive, this change could lead to unexpected behavior or errors.
var container = (await db.CreateContainerIfNotExistsAsync("entries", "/id")).Container;
Also tagging @christopheranderson |
/// </remarks> | ||
public static IResourceBuilder<AzureCosmosDBEmulatorResource> WithDataExplorer(this IResourceBuilder<AzureCosmosDBEmulatorResource> builder, int? port = null) | ||
{ | ||
if (!builder.Resource.InnerResource.IsPreviewEmulator) |
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?
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.
Because it doesn't work in the latest
emulator. See Azure/azure-cosmos-db-emulator-docker#135.
Also fixing the EF CosmosDB code to specify the PartitionKey.
@Pilchie @christopheranderson - it looks like the vnext-preview emulator is failing to start in CI sometimes:
Have you ever seen this error before? |
Added a new experimental API - RunAsPreviewEmulator. This will use the new Linux-based emulator, which starts faster. And it also has support for a built-in Data Explorer which can be enabled by calling WithDataExplorer on the emulator.
Fix #5163
Checklist
<remarks />
and<code />
elements on your triple slash comments?breaking-change
template):doc-idea
template):