Aspire and Dapr bindings via Aspire.Hosting.Testing #14249
Unanswered
Tom Boon (tomboon)
asked this question in
Q&A
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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?
All reactions