-
Notifications
You must be signed in to change notification settings - Fork 308
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
Adds Azurite support #410
Adds Azurite support #410
Conversation
This should be part of the azure package. Thanks for the contribution! |
This is very cool but we should model this into the |
Thanks for the comments. I've integrated it i Example AppHost var builder = DistributedApplication.CreateBuilder(args);
var azurite = builder.AddAzureStorage("azurite")
.UseEmulator();
var blob = azurite.AddBlobs("blobs");
var queue = azurite.AddQueues("queues");
var table = azurite.AddTables("tables");
builder.AddProject<Projects.Web>("web")
.WithReference(blob)
.WithReference(queue)
.WithReference(table);
builder.Build().Run(); Example web api using Azure.Data.Tables;
using Azure.Storage.Blobs;
using Azure.Storage.Queues;
var builder = WebApplication.CreateBuilder(args);
builder.AddAzureTableService("tables");
builder.AddAzureBlobService("blobs");
builder.AddAzureQueueService("queues");
var app = builder.Build();
app.MapGet("/tables", (TableServiceClient client) => client.Query());
app.MapGet("/blobs", (BlobServiceClient client) => client.GetBlobContainers());
app.MapGet("/queues", (QueueServiceClient client) => client.GetQueues());
app.Run(); |
This is beautiful, but you have to resolve some merge conflicts 😄 |
Agreed. This looks pretty good. I'm somewhat uncomfortable with the In terms of verbs applied to extension methods we now have
|
Good point @mitchdenny. I think Use or As would apply here. UseEmulator/AsEmulator, I think I prefer Use |
There are some more merge conflicts to fix because of the rename but they shouldn't affect you much. 2 changes you should make:
That will allow you to skip provisioning storage when the emulator is changed. Lets get this merged soon! Sorry for the churn. |
- Adds ShouldProvision to IAzureResourceProvisioner, which returns true by default. Will return false if Azurite is used for Azure storage
03cad06
to
0096dd5
Compare
@davidfowl Thanks for the review comments. I've rebased, fixed merge conflicts and addressed your feedback comments. Starting AppHost with AzureProvisioning on will now yield the following logs if emulator is used.
|
Very clean, this is a high quality PR 😄. Thanks! |
I toyed a little with creating resources and thought Azurite would be good for local dev.