Allows to add Azure Service Bus
services.AddAzureServiceBusSender(
Configuration["AzureServiceBusOptions:ConnectionString"],
options => Configuration.Bind("AzureServiceBusOptions", options)
)
with appsettings.json
{
"AzureServiceBusOptions": {
"ConnectionString": "Endpoint=sb://{name}.servicebus.windows.net/;SharedAccessKeyName=RootManageSharedAccessKey;SharedAccessKey=YourAccessKey",
"Queues": {
"exampleQueue": "example.servicebus.queue"
}
}
}
Allows to add Azure Service Bus with Managed Identity
services.AddAzureServiceBusSender(
Configuration["AzureServiceBusOptions:FullyQualifiedNamespace"],
new ManagedIdentityCredential(),
options => Configuration.Bind("AzureServiceBusOptions", options)
)
with appsettings.json
{
"AzureServiceBusOptions": {
"FullyQualifiedNamespace": "{name}.servicebus.windows.net",
"Queues": {
"exampleQueue": "example.servicebus.queue"
}
}
}