How to create a minimum Aspire project that uses Service Bus and Event Hub emulators with a Function App.
Assuming the dotnet CLI is already installed.
mkdir test; cd test
dotnet new install Aspire.ProjectTemplates
dotnet new aspire-starter
dotnet new gitignore
dotnet sln migrate
dotnet dev-certs https --trust
dotnet run --project .\test.AppHost\test.AppHost.csprojAssuming the Aspire CLI is already installed.
aspire update --self
aspire update
aspire add azure-servicebus
aspire add azure-eventhubsUpdate the AppHost.cs to add Event Hubs and Service Bus emulators.
winget install Microsoft.Azure.FunctionsCoreTools
aspire add azure-functions
mkdir test.Function; cd .\test.Function\
func new --template "ServiceBusQueueTrigger" --name "TestServiceBusQueueTrigger" --worker-runtime dotnet-isolated
cd ..; dotnet sln add .\test.Function\test_Function.csproj
dotnet reference add .\test.Function\test_Function.csproj --project .\test.AppHost\test.AppHost.csproj