Azure.ResourceManager.ServiceBus
1.1.0-beta.1
See the version list below for details.
dotnet add package Azure.ResourceManager.ServiceBus --version 1.1.0-beta.1
NuGet\Install-Package Azure.ResourceManager.ServiceBus -Version 1.1.0-beta.1
<PackageReference Include="Azure.ResourceManager.ServiceBus" Version="1.1.0-beta.1" />
paket add Azure.ResourceManager.ServiceBus --version 1.1.0-beta.1
#r "nuget: Azure.ResourceManager.ServiceBus, 1.1.0-beta.1"
// Install Azure.ResourceManager.ServiceBus as a Cake Addin
#addin nuget:?package=Azure.ResourceManager.ServiceBus&version=1.1.0-beta.1&prerelease
// Install Azure.ResourceManager.ServiceBus as a Cake Tool
#tool nuget:?package=Azure.ResourceManager.ServiceBus&version=1.1.0-beta.1&prerelease
Microsoft Azure Service Bus management client library for .NET
Microsoft Azure Service Bus is a fully managed enterprise message broker with message queues and publish-subscribe topics (in a namespace).
This library supports managing Microsoft Azure Service Bus resources.
This library follows the new Azure SDK guidelines, and provides many core capabilities:
- Support MSAL.NET, Azure.Identity is out of box for supporting MSAL.NET.
- Support [OpenTelemetry](https://opentelemetry.io/) for distributed tracing.
- HTTP pipeline with custom policies.
- Better error-handling.
- Support uniform telemetry across all languages.
Getting started
Install the package
Install the Microsoft Azure Service Bus management library for .NET with NuGet:
dotnet add package Azure.ResourceManager.ServiceBus
Prerequisites
- You must have an Microsoft Azure subscription.
Authenticate the Client
To create an authenticated client and start interacting with Microsoft Azure resources, see the quickstart guide here.
Key concepts
Key concepts of the Microsoft Azure SDK for .NET can be found here.
Documentation
Documentation is available to help you learn how to use this package:
Examples
Create a namespace
Before creating a namespace, we need to have a resource group.
ArmClient armClient = new ArmClient(new DefaultAzureCredential());
SubscriptionResource subscription = await armClient.GetDefaultSubscriptionAsync();
string rgName = "myRgName";
AzureLocation location = AzureLocation.WestUS2;
ArmOperation<ResourceGroupResource> operation = await subscription.GetResourceGroups().CreateOrUpdateAsync(WaitUntil.Completed, rgName, new ResourceGroupData(location));
ResourceGroupResource resourceGroup = operation.Value;
Then we can create a namespace inside this resource group.
string namespaceName = "myNamespace";
ServiceBusNamespaceCollection namespaceCollection = resourceGroup.GetServiceBusNamespaces();
AzureLocation location = AzureLocation.EastUS2;
ServiceBusNamespaceResource serviceBusNamespace = (await namespaceCollection.CreateOrUpdateAsync(WaitUntil.Completed, namespaceName, new ServiceBusNamespaceData(location))).Value;
Get all namespaces in a resource group
ServiceBusNamespaceCollection namespaceCollection = resourceGroup.GetServiceBusNamespaces();
await foreach (ServiceBusNamespaceResource serviceBusNamespace in namespaceCollection.GetAllAsync())
{
Console.WriteLine(serviceBusNamespace.Id.Name);
}
Get a namespace
ServiceBusNamespaceCollection namespaceCollection = resourceGroup.GetServiceBusNamespaces();
ServiceBusNamespaceResource serviceBusNamespace = await namespaceCollection.GetAsync("myNamespace");
Console.WriteLine(serviceBusNamespace.Id.Name);
Delete a namespace
ServiceBusNamespaceCollection namespaceCollection = resourceGroup.GetServiceBusNamespaces();
ServiceBusNamespaceResource serviceBusNamespace = await namespaceCollection.GetAsync("myNamespace");
await serviceBusNamespace.DeleteAsync(WaitUntil.Completed);
More code samples for using the management library for .NET can be found in the following locations
Troubleshooting
- File an issue via GitHub Issues.
- Check previous questions or ask new ones on Stack Overflow using Azure and .NET tags.
Next steps
For more information about Microsoft Azure SDK, see this website.
Contributing
For details on contributing to this repository, see the contributing guide.
This project welcomes contributions and suggestions. Most contributions require you to agree to a Contributor License Agreement (CLA) declaring that you have the right to, and actually do, grant us the rights to use your contribution. For details, visit https://cla.microsoft.com.
When you submit a pull request, a CLA-bot will automatically determine whether you need to provide a CLA and decorate the PR appropriately (for example, label, comment). Follow the instructions provided by the bot. You'll only need to do this action once across all repositories using our CLA.
This project has adopted the Microsoft Open Source Code of Conduct. For more information, see the Code of Conduct FAQ or contact opencode@microsoft.com with any other questions or comments.
Product | Versions |
---|---|
.NET | net5.0 net5.0-windows net6.0 net6.0-android net6.0-ios net6.0-maccatalyst net6.0-macos net6.0-tvos net6.0-windows net7.0 net7.0-android net7.0-ios net7.0-maccatalyst net7.0-macos net7.0-tvos net7.0-windows |
.NET Core | netcoreapp2.0 netcoreapp2.1 netcoreapp2.2 netcoreapp3.0 netcoreapp3.1 |
.NET Standard | netstandard2.0 netstandard2.1 |
.NET Framework | net461 net462 net463 net47 net471 net472 net48 net481 |
MonoAndroid | monoandroid |
MonoMac | monomac |
MonoTouch | monotouch |
Tizen | tizen40 tizen60 |
Xamarin.iOS | xamarinios |
Xamarin.Mac | xamarinmac |
Xamarin.TVOS | xamarintvos |
Xamarin.WatchOS | xamarinwatchos |
-
.NETStandard 2.0
- Azure.Core (>= 1.27.0)
- Azure.ResourceManager (>= 1.3.2)
- System.Text.Json (>= 4.7.2)
NuGet packages (3)
Showing the top 3 NuGet packages that depend on Azure.ResourceManager.ServiceBus:
Package | Downloads |
---|---|
Shims.WindowsAzure.ServiceBus
A path forward for WindowsAzure.ServiceBus users moving to modern .NET |
|
Cybtans.Messaging.AzureServiceBus
Azure Service Buss message queue implementation |
|
IglooSoftware.Sdk.EventSourcing
Igloo Event Sourcing SDK for services. |
GitHub repositories
This package is not used by any popular GitHub repositories.
Version | Downloads | Last updated |
---|---|---|
1.1.0-beta.2 | 218 | 2/14/2023 |
1.1.0-beta.1 | 191 | 1/12/2023 |
1.0.0 | 79,082 | 7/21/2022 |
1.0.0-beta.4 | 1,958 | 4/8/2022 |
1.0.0-beta.3 | 249 | 3/31/2022 |
1.0.0-beta.2 | 573 | 12/28/2021 |
1.0.0-beta.1 | 2,936 | 12/2/2021 |