but there is only the AddAzureServiceBus(this IDistributedApplicationBuilder builder, string name, Action<IResourceBuilder<AzureServiceBusResource>, ResourceModuleConstruct, ServiceBusNamespace>? configureResource) overload. If I use this code
that does not work. I'm not sure how AssignProperty works because if I set a breakpoint inside the
configureResource the serviceBusNamespace.Properties.DisableLocalAuth is still null. After azd up local auth is still disabled. I guess the AssignProperty works different. But if I use this myself
(✓) Done: Resource group: rg-production
(✓) Done: Log Analytics workspace: law-08154711
(✓) Done: Key Vault: kvd08154711
(✓) Done: Container Registry: acr08154711
(✓) Done: Container Apps Environment: cae-08154711
|= | Creating/Updating resources
ERROR: error executing step command 'provision': deployment failed: error deploying infrastructure: deploying to subscription:
Deployment Error Details:
DotNetComponentOperationError: Failed to provision component 'aspire-dashboard'. Error details: Cannot modify DotNet Component with name 'aspire-dashboard' because another modification is in progress..
TraceID: 08154711
Local Auth is needed for development as well
var serviceBus = builder.ExecutionContext.IsPublishMode
? builder.AddAzureServiceBus("messaging")
: builder.AddConnectionString("messaging"); <-- needs local auth
otherwise you'll get errors like this
System.UnauthorizedAccessException: 'LocalAuthDisabled: Authorization failed because SAS authentication has been disabled for the namespace. TrackingId:08154711, SystemTracker:NoSystemTracker, Timestamp:2024-09-17T06:11:38
Status: 401 (Unauthorized)
Currently I am using a post deploy hook and az servicebus namespace update to reenable it but it would be great to have an way to do this with c#
make KEDA scale rules available without local auth
Risks
I'm not 100% certain but the default a while back was local auth enabled by default Now it's disabled by default which is propably a good thing. But being able to enable local auth should be possible.
Background and Motivation
The Aspire.Hosting.Azure.ServiceBus integration
disables local auth
but I need local auth for my KEDA scale rule on a different container.
The documentation is a bit outdated since it mentions this way to configure azure service bus
but there is only the
AddAzureServiceBus(this IDistributedApplicationBuilder builder, string name, Action<IResourceBuilder<AzureServiceBusResource>, ResourceModuleConstruct, ServiceBusNamespace>? configureResource)
overload. If I use this codethat does not work. I'm not sure how
AssignProperty
works because if I set a breakpoint inside the configureResource theserviceBusNamespace.Properties.DisableLocalAuth
is still null. Afterazd up
local auth is still disabled. I guess theAssignProperty
works different. But if I use this myselfI get an error during deployment
Local Auth is needed for development as well
otherwise you'll get errors like this
Currently I am using a post deploy hook and
az servicebus namespace update
to reenable it but it would be great to have an way to do this with c#Proposed API
Bring back the settings overload mentioned here
Usage Examples
Alternative Designs
use the fluent interface
or
or (but that's in the scope of the aspire team)
Risks
I'm not 100% certain but the default a while back was
local auth enabled by default
Now it's disabled by default which is propably a good thing. But being able to enable local auth should be possible.