You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I've been stuck on this problem for a while and can't seem to get it to work. I've run out of ideas and AI keeps hallucinating solutions that don't exist.
Context: dotnet 10, dotnet aspire, azurite, dapr 1.16.5, docker desktop. Dapr is installed on my machine via dapr cli.
In my dotnet Aspire Apphost:
// spin up Azurite Azure storage
var blobstorage = builder
.AddAzureStorage("storage")
.RunAsEmulator(azurite =>
azurite
.WithBlobPort(10000)
.WithQueuePort(10001)
.WithTablePort(10002)
.WithDataVolume());
// spin up my app with a dapr sidecar
builder
.AddProject<Projects.MyApp>("myapp")
.WithDaprSidecar(new DaprSidecarOptions
{
AppId = "myapp",
ResourcesPaths = [daprComponentsPath], // points to dir with dapr yamls
});
I define a dapr Azure BlobStorage binding component via yaml:
What works:
When I spin up dotnet Aspire locally this works fine. Ideally though, I don't want to hardcode the Azurite ports (10000, 10001, 10002). But that brings us to the problem below:
What doesn't work:
Using the Aspire.Hosting.Testing package I spin up my Aspire Apphost for running end-to-end tests using xunit. In this case, the binding doesn't work.
When asking the DaprClient in my app to use the binding, it can't find the azurite storage (host not available, ...).
My guess is that when running Aspire Apphost via testing, it runs more isolated (docker network or something?), and 127.0.0.1 will point to the dapr sidecar's own host instead of to Azurite.
I tried different approaches like
using a reference to an environment variable in my binding yaml (does not work because passing .WithEnvironment in Aspire sets the variable for MyApp but not for the sidecar)
waiting for Azurite resource to be ready and overwriting the yaml file (does not work because sidecar will have started by then, and does not hot reload yaml config)
trying to set dapr components after Aspire fully started via rest api (nice hallucination from AI but does not exist)
TL/DR: how can i set an Azurite endpoint in a dapr yaml config - when Azurite is loaded by Aspire AND that dapr yaml config is also needed by Aspire (for spinning up a dapr sidecar) ?
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
Uh oh!
There was an error while loading. Please reload this page.
-
Hello,
I've been stuck on this problem for a while and can't seem to get it to work. I've run out of ideas and AI keeps hallucinating solutions that don't exist.
Context: dotnet 10, dotnet aspire, azurite, dapr 1.16.5, docker desktop. Dapr is installed on my machine via dapr cli.
In my dotnet Aspire Apphost:
I define a dapr Azure BlobStorage binding component via yaml:
What works:
When I spin up dotnet Aspire locally this works fine. Ideally though, I don't want to hardcode the Azurite ports (10000, 10001, 10002). But that brings us to the problem below:
What doesn't work:
Using the Aspire.Hosting.Testing package I spin up my Aspire Apphost for running end-to-end tests using xunit. In this case, the binding doesn't work.
When asking the DaprClient in my app to use the binding, it can't find the azurite storage (host not available, ...).
My guess is that when running Aspire Apphost via testing, it runs more isolated (docker network or something?), and 127.0.0.1 will point to the dapr sidecar's own host instead of to Azurite.
I tried different approaches like
TL/DR: how can i set an Azurite endpoint in a dapr yaml config - when Azurite is loaded by Aspire AND that dapr yaml config is also needed by Aspire (for spinning up a dapr sidecar) ?
Any ideas on how to fix this?
Beta Was this translation helpful? Give feedback.
All reactions