Azure.ResourceManager.ServiceBus 1.0.0-beta.2

Prefix Reserved
This is a prerelease version of Azure.ResourceManager.ServiceBus.
There is a newer version of this package available.
See the version list below for details.
dotnet add package Azure.ResourceManager.ServiceBus --version 1.0.0-beta.2                
NuGet\Install-Package Azure.ResourceManager.ServiceBus -Version 1.0.0-beta.2                
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="Azure.ResourceManager.ServiceBus" Version="1.0.0-beta.2" />                
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add Azure.ResourceManager.ServiceBus --version 1.0.0-beta.2                
#r "nuget: Azure.ResourceManager.ServiceBus, 1.0.0-beta.2"                
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
// Install Azure.ResourceManager.ServiceBus as a Cake Addin
#addin nuget:?package=Azure.ResourceManager.ServiceBus&version=1.0.0-beta.2&prerelease

// Install Azure.ResourceManager.ServiceBus as a Cake Tool
#tool nuget:?package=Azure.ResourceManager.ServiceBus&version=1.0.0-beta.2&prerelease                

Azure Azure.ResourceManager.ServiceBus Management client library for .NET

This package follows the new Azure SDK guidelines which provide a number of core capabilities that are shared amongst all Azure SDKs, including the intuitive Azure Identity library, an HTTP Pipeline with custom policies, error-handling, distributed tracing, and much more.

Getting started

Install the package

Install the Azure Azure.ResourceManager.ServiceBus management library for .NET with NuGet:

Install-Package Azure.ResourceManager.ServiceBus -Version 1.0.0-beta.2 

Prerequisites

Set up a way to authenticate to Azure with Azure Identity.

Some options are:

More information and different authentication approaches using Azure Identity can be found in this document.

Authenticate the Client

The default option to create an authenticated client is to use DefaultAzureCredential. Since all management APIs go through the same endpoint, in order to interact with resources, only one top-level ArmClient has to be created.

To authenticate to Azure and create an ArmClient, do the following:

using Azure.Identity;

ArmClient armClient = new ArmClient(new DefaultAzureCredential());

Additional documentation for the Azure.Identity.DefaultAzureCredential class can be found in this document.

Key concepts

Key concepts of the Azure .NET SDK 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());
Subscription subscription = await armClient.GetDefaultSubscriptionAsync();
string rgName = "myRgName";
Location location = Location.WestUS2;
ResourceGroupCreateOrUpdateOperation operation = await subscription.GetResourceGroups().CreateOrUpdateAsync(rgName, new ResourceGroupData(location));
ResourceGroup resourceGroup = operation.Value;

Then we can create a namespace inside this resource group.

string namespaceName = "myNamespace";
ServiceBusNamespaceCollection namespaceCollection = resourceGroup.GetServiceBusNamespaces();
Location location = Location.EastUS2;
ServiceBusNamespace serviceBusNamespace = (await namespaceCollection.CreateOrUpdateAsync(namespaceName, new ServiceBusNamespaceData(location))).Value;

Get all namespaces in a resource group

ServiceBusNamespaceCollection namespaceCollection = resourceGroup.GetServiceBusNamespaces();
await foreach (ServiceBusNamespace serviceBusNamespace in namespaceCollection.GetAllAsync())
{
    Console.WriteLine(serviceBusNamespace.Id.Name);
}

Get a namespace

ServiceBusNamespaceCollection namespaceCollection = resourceGroup.GetServiceBusNamespaces();
ServiceBusNamespace serviceBusNamespace = await namespaceCollection.GetAsync("myNamespace");
Console.WriteLine(serviceBusNamespace.Id.Name);

Try to get a namespace if it exists

ServiceBusNamespaceCollection namespaceCollection = resourceGroup.GetServiceBusNamespaces();
ServiceBusNamespace serviceBusNamespace = await namespaceCollection.GetIfExistsAsync("foo");
if (serviceBusNamespace != null)
{
    Console.WriteLine("namespace 'foo' exists");
}
if (await namespaceCollection.ExistsAsync("bar"))
{
    Console.WriteLine("namespace 'bar' exists");
}

Delete a namespace

ServiceBusNamespaceCollection namespaceCollection = resourceGroup.GetServiceBusNamespaces();
ServiceBusNamespace serviceBusNamespace = await namespaceCollection.GetAsync("myNamespace");
await serviceBusNamespace.DeleteAsync();

For more detailed examples, take a look at samples we have available.

Troubleshooting

Next steps

For more information on Azure SDK, please refer to 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 (e.g., label, comment). Simply follow the instructions provided by the bot. You will only need to do this 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 additional questions or comments.

Product Compatible and additional computed target framework versions.
.NET net5.0 was computed.  net5.0-windows was computed.  net6.0 was computed.  net6.0-android was computed.  net6.0-ios was computed.  net6.0-maccatalyst was computed.  net6.0-macos was computed.  net6.0-tvos was computed.  net6.0-windows was computed.  net7.0 was computed.  net7.0-android was computed.  net7.0-ios was computed.  net7.0-maccatalyst was computed.  net7.0-macos was computed.  net7.0-tvos was computed.  net7.0-windows was computed.  net8.0 was computed.  net8.0-android was computed.  net8.0-browser was computed.  net8.0-ios was computed.  net8.0-maccatalyst was computed.  net8.0-macos was computed.  net8.0-tvos was computed.  net8.0-windows was computed. 
.NET Core netcoreapp2.0 was computed.  netcoreapp2.1 was computed.  netcoreapp2.2 was computed.  netcoreapp3.0 was computed.  netcoreapp3.1 was computed. 
.NET Standard netstandard2.0 is compatible.  netstandard2.1 was computed. 
.NET Framework net461 was computed.  net462 was computed.  net463 was computed.  net47 was computed.  net471 was computed.  net472 was computed.  net48 was computed.  net481 was computed. 
MonoAndroid monoandroid was computed. 
MonoMac monomac was computed. 
MonoTouch monotouch was computed. 
Tizen tizen40 was computed.  tizen60 was computed. 
Xamarin.iOS xamarinios was computed. 
Xamarin.Mac xamarinmac was computed. 
Xamarin.TVOS xamarintvos was computed. 
Xamarin.WatchOS xamarinwatchos was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages (9)

Showing the top 5 NuGet packages that depend on Azure.ResourceManager.ServiceBus:

Package Downloads
IglooSoftware.Sdk.EventSourcing

Igloo Event Sourcing SDK for services.

Zerra.CQRS.AzureServiceBus

Azure Service Bus implementations of producer and consumer for commands and events in the CQRS Zerra Framework.

ModularPipelines.Azure

Helpers for interacting with Azure.

GKAR.MessageBroker.Core

Solução para unificar as regras e configurações necessárias da mensageria para os diversos projetos da empresa GKAR.

Signals.Aspects.CommunicationChannels.ServiceBus

Package Description

GitHub repositories (3)

Showing the top 3 popular GitHub repositories that depend on Azure.ResourceManager.ServiceBus:

Repository Stars
elsa-workflows/elsa-core
A .NET workflows library
Azure/azure-sdk-for-net
This repository is for active development of the Azure SDK for .NET. For consumers of the SDK we recommend visiting our public developer docs at https://learn.microsoft.com/dotnet/azure/ or our versioned developer docs at https://azure.github.io/azure-sdk-for-net.
thomhurst/ModularPipelines
Write your pipelines in C# !
Version Downloads Last updated
1.1.0-beta.7 6,147 5/7/2024
1.1.0-beta.6 855 4/29/2024
1.1.0-beta.5 3,081 3/26/2024
1.1.0-beta.4 5,868 11/24/2023
1.1.0-beta.3 58,230 6/1/2023
1.1.0-beta.2 4,266 2/14/2023
1.1.0-beta.1 314 1/12/2023
1.0.1 266,158 3/26/2024
1.0.0 969,460 7/21/2022
1.0.0-beta.4 3,346 4/8/2022
1.0.0-beta.3 402 3/31/2022
1.0.0-beta.2 717 12/28/2021
1.0.0-beta.1 6,692 12/2/2021