クイック スタート: Azure Service Bus キュー (.NET) からメッセージを送受信する

このクイックスタートでは、次の手順を実行します。

  1. Azure Portal を使用して Service Bus 名前空間を作成する。

  2. Azure Portal を使用して Service Bus キューを作成する。

  3. キューに一連のメッセージを送信するための .NET コンソール アプリケーションを作成する。

  4. それらのメッセージをキューから受信する .NET コンソール アプリケーションを作成する。

    注意

    このクイックスタートでは、メッセージのバッチを Service Bus キューに送信し、それらを受信するという簡単なシナリオを実装するステップバイステップの手順を説明します。 .NET クライアント ライブラリの概要については、「Azure Service Bus client library for .NET」 (.NET 用 Azure Service Bus クライアント ライブラリ) を参照してください。 その他のサンプルについては、GitHub の Service Bus .NET サンプルを参照してください。

前提条件

このサービスを初めて使用する場合は、このクイックスタートを実行する前に、[Service Bus の概要](service-bus-messaging-overview.md)に関する記事を参照してください。

  • Azure サブスクリプション。 Azure Service Bus など、Azure の各種サービスを使用するには、サブスクリプションが必要です。 Azure アカウントを持っていない場合、無料試用版でサインアップできます。
  • Visual Studio 2022. サンプル アプリケーションでは、C# 10 で導入された新機能を利用しています。 前のバージョンの C# 言語で Service Bus クライアント ライブラリを使用することもできますが、構文は異なる場合があります。 最新の構文を使用するには、.NET 6.0 以降をインストールし、言語バージョンを latest に設定することをお勧めします。 Visual Studio を使用している場合、Visual Studio 2022 より前のバージョンには、C# 10 プロジェクトをビルドするために必要なツールとの互換性がありません。

Azure Portal での名前空間の作成

Azure の Service Bus メッセージング エンティティを使用するには、Azure 全体で一意となる名前を備えた名前空間を最初に作成しておく必要があります。 名前空間により、ご利用のアプリケーション内に Service Bus リソース (キュー、トピックなど) 用のスコープ コンテナーが提供されます。

名前空間を作成するには:

  1. Azure portal にサインインします。

  2. [すべてのサービス] ページに移動します。

  3. 左側のナビゲーション バーで、カテゴリの一覧から [統合] を選択し、[Service Bus] 上にマウス ポインターを置き、[Service Bus] タイルの [+] ボタンを選択します。

    Image showing selection of Create a resource, Integration, and then Service Bus in the menu.

  4. [名前空間の作成] ページの [基本] タブで、こちらの手順を実行します。

    1. [サブスクリプション] で、名前空間を作成する Azure サブスクリプションを選択します。

    2. [リソース グループ] で、名前空間を追加する既存のリソース グループを選択するか、新しいリソース グループを作成します。

    3. 名前空間の名前を入力します。 名前空間名は次の名前付け規則に従う必要があります。

      • この名前は Azure 全体で一意である必要があります。 その名前が使用できるかどうかがすぐに自動で確認されます。
      • 名前の長さは 6 ~ 50 文字である。
      • この名前には、文字、数字、ハイフン "-" のみを含めることができます。
      • 名前の先頭は文字、末尾は文字または数字にする必要があります。
      • 名前の末尾は “-sb“ または “-mgmt“ にはできません。
    4. [場所] で、名前空間をホストするリージョンを選択します。

    5. [価格レベル] で、名前空間の価格レベル (Basic、Standard、Premium) を選択します。 このクイック スタートでは、 [Standard] を選択します。

      重要

      トピックとサブスクリプションを使用する場合は、Standard または Premium を選択してください。 Basic 価格レベルでは、トピックとサブスクリプションはサポートされていません。

      [Premium] 価格レベルを選択した場合は、メッセージング ユニットの数を指定します。 Premium レベルでは、各ワークロードが分離した状態で実行されるように、CPU とメモリのレベルでリソースが分離されます。 このリソースのコンテナーをメッセージング ユニットと呼びます。 Premium 名前空間には、少なくとも 1 つのメッセージング ユニットがあります。 Service Bus の Premium 名前空間ごとに、1 個、2 個、4 個、8 個、または 16 個のメッセージング ユニットを選択できます。 詳細については、Service Bus の Premium メッセージングに関するページをご覧ください。

    6. ページ下部にある [確認と作成] を選択します。

      Image showing the Create a namespace page

    7. [確認および作成] ページで、設定を確認し、 [作成] を選択します。

  5. リソースのデプロイが成功したら、デプロイ ページで [リソースに移動] を選択します。

    Image showing the deployment succeeded page with the Go to resource link.

  6. Service Bus 名前空間のホーム ページが表示されます。

    Image showing the home page of the Service Bus namespace created.

Azure portal でキューを作成する

  1. [Service Bus 名前空間] ページで、左側のナビゲーション メニューの [キュー] を選択します。

  2. [キュー] ページで、ツール バーの [+ キュー] を選択します。

  3. キューの名前を入力し、他の値は既定値のままにします。

  4. ここで、 [作成] を選択します。

    Image showing creation of a queue in the portal

重要

Azure を初めて使用する場合は、接続文字列オプションの方が理解しやすいかもしれません。 [接続文字列] タブを選択すると、このクイックスタートで接続文字列を使用する手順が表示されます。 実際のアプリケーションと運用環境では、[パスワードレス] オプションを使用することをお勧めします。

Azure に対してアプリを認証する

このクイック スタートでは、Azure Service Bus に接続する 2 つの方法である、パスワードレス接続文字列について説明します。

最初のオプションでは、Microsoft Entra ID とロールベースのアクセス制御 (RBAC) でセキュリティ プリンシパルを使用して Service Bus 名前空間に接続する方法を示します。 コードや構成ファイル、または Azure Key Vault などのセキュリティで保護されたストレージに、ハードコーディングされた接続文字列を含める心配はありません。

2 番目のオプションでは、接続文字列を使用して Service Bus 名前空間に接続する方法を示します。 Azure を初めて使用する場合は、接続文字列オプションの方が理解しやすいかもしれません。 実際のアプリケーションと運用環境では、パスワードレス オプションを使用することをお勧めします。 詳細については、「認証と承認」を参照してください。 パスワードレス認証の詳細については、概要ページを参照してください。

Microsoft Entra ユーザーにロールを割り当てる

ローカルでの開発時には、Azure Service Bus に接続するユーザー アカウントに正しいアクセス許可があることを確認してください。 メッセージを送受信するには、Azure Service Bus データ所有者ロールが必要です。 このロールを自分に割り当てるには、ユーザー アクセス管理者ロール、または Microsoft.Authorization/roleAssignments/write アクションを含む別のロールが必要です。 Azure portal、Azure CLI、または Azure PowerShell を使用して、ユーザーに Azure RBAC ロールを割り当てることができます。 ロールの割り当てに使用できるスコープの詳細は、スコープの概要ページを参照してください。

次の例では、ユーザー アカウントに、Azure Service Bus Data Owner ロールを割り当てます。これにより、Azure Service Bus リソースへのフル アクセスが提供されます。 実際のシナリオでは、より安全な運用環境を実現するため、最小限の特権の原則に従って、必要な最小限のアクセス許可のみをユーザーに付与します。

Azure Service Bus 用の Azure 組み込みロール

Azure Service Bus の場合、名前空間およびそれに関連するすべてのリソースの Azure portal および Azure リソース管理 API による管理は、Azure RBAC モデルを使って既に保護されています。 Azure では、Service Bus 名前空間へのアクセスを承認するための次の Azure 組み込みロールが提供されています。

  • Azure Service Bus データ所有者:Service Bus 名前空間とそのエンティティ (キュー、トピック、サブスクリプション、およびフィルター) へのデータ アクセスが可能です。 このロールのメンバーは、キューまたはトピックやサブスクリプションとの間でメッセージを送受信できます。
  • Azure Service Bus データ送信者: このロールを使用して、Service Bus 名前空間とそのエンティティへの送信アクセスを許可します。
  • Azure Service Bus データ受信者: このロールを使用して、Service Bus 名前空間とそのエンティティへの受信アクセスを許可します。

カスタム ロールを作成する場合は、Service Bus 操作に必要な権限に関するページを参照してください。

Microsoft Entra ユーザーを Azure Service Bus 所有者ロールに追加する

Microsoft Entra ユーザー名を、Service Bus 名前空間レベルの Azure Service Bus データ所有者ロール に追加します。 これにより、ユーザー アカウントのコンテキストで実行されているアプリがキューまたはトピックにメッセージを送信し、キューまたはトピックのサブスクリプションからメッセージを受信できるようになります。

重要

ほとんどの場合、ロールの割り当てが Azure に反映されるまでの時間は 1、2 分です。 まれに、最大 8 分かかる場合があります。 初めてコードを実行したときに認証エラーを受け取る場合は、しばらく待ってから再試行してください。

  1. Azure portal で Service Bus 名前空間ページが開いていない場合は、メイン検索バーまたは左側のナビゲーションを使用して Service Bus 名前空間を見つけます。

  2. 概要ページで、左側のメニューから [アクセス制御 (IAM)] を選択します。

  3. [アクセス制御 (IAM)] ページで、[ロールの割り当て] タブを選びます。

  4. 上部のメニューから [+ 追加] を選択し、次に結果のドロップダウン メニューから [ロールの割り当ての追加] を選択します。

    A screenshot showing how to assign a role.

  5. 検索ボックスを使って、結果を目的のロールに絞り込みます。 この例では、Azure Service Bus Data Owner を検索して一致する結果を選択します。 [次へ] を選びます。

  6. [アクセスの割り当て先] で、[ユーザー、グループ、またはサービス プリンシパル] を選び、[+ メンバーの選択] を選びます。

  7. ダイアログで、自分の Microsoft Entra ユーザー名 (通常は user@domain メール アドレス) を検索し、ダイアログの下部にある [選択] を選びます。

  8. [レビューと割り当て] を選んで最終ページに移動し、もう一度 [レビューと割り当て] を行ってプロセスを完了します。

Visual Studio を起動して Azure にサインインする

次の手順を使用して、Service Bus 名前空間へのアクセスを承認できます。

  1. Visual Studio を起動します。 [作業の開始] ウィンドウが表示されたら、右側のウィンドウで [コードなしで続行] リンクを選択します。

  2. Visual Studio の右上隅にある [サインイン] ボタンを選びます。

    Screenshot showing a button to sign in to Azure using Visual Studio.

  3. 以前にロールを割り当てた Microsoft Entra アカウントを使用してサインインします。

    Screenshot showing the account selection.

キューへのメッセージの送信

このセクションでは、Service Bus キューにメッセージを送信する .NET コンソール アプリケーションを作成する方法を示します。

注意

このクイックスタートでは、メッセージのバッチを Service Bus キューに送信し、それらを受信するという簡単なシナリオを実装するステップバイステップの手順を説明します。 その他のシナリオや高度なシナリオのサンプルについては、GitHub の Service Bus .NET サンプルを参照してください。

コンソール アプリケーションの作成

  1. Visual Studio で、[ファイル] ->[新規作成] ->[プロジェクト] メニューを選択します。

  2. **[新しいプロジェクトの作成]** ダイアログ ボックスで、次の手順に従います。このダイアログ ボックスが表示されない場合は、メニューで **[ファイル]****[新規]****[プロジェクト]** の順に選択します。

    1. プログラミング言語として **[C#]** を選択します。

    2. アプリケーションの種類として [コンソール] を選択します。

    3. 結果の一覧から [コンソール アプリ] を選択します。

    4. 次に、 [次へ] を選択します。

      Image showing the Create a new project dialog box with C# and Console selected

  3. プロジェクト名に「QueueSender」、ソリューション名に「ServiceBusQueueQuickStart」と入力し、 [次へ] を選択します。

    Image showing the solution and project names in the Configure your new project dialog box

  4. [追加情報] ページで、 [作成] を選択してソリューションとプロジェクトを作成します。

NuGet パッケージをプロジェクトに追加する

  1. メニューから [ツール]>[NuGet パッケージ マネージャー]>[パッケージ マネージャー コンソール] の順に選択します。

  2. 次のコマンドを実行して、Azure.Messaging.ServiceBus NuGet パッケージをインストールします。

    Install-Package Azure.Messaging.ServiceBus
    
  3. 次のコマンドを実行して、Azure.Identity NuGet パッケージをインストールします。

    Install-Package Azure.Identity
    

キューにメッセージを送信するコードを追加する

  1. Program.cs の内容を以下のコードに置き換えます。 重要な手順の概要を以下のセクションに示します。コード コメントに追加情報が記載されています。

    重要

    Service Bus 名前空間とキューの名前を使用して、コード スニペットのプレースホルダー値 (<NAMESPACE-NAME><QUEUE-NAME>) を更新します。

    using Azure.Messaging.ServiceBus;
    using Azure.Identity;
    
    // name of your Service Bus queue
    // the client that owns the connection and can be used to create senders and receivers
    ServiceBusClient client;
    
    // the sender used to publish messages to the queue
    ServiceBusSender sender;
    
    // number of messages to be sent to the queue
    const int numOfMessages = 3;
    
    // The Service Bus client types are safe to cache and use as a singleton for the lifetime
    // of the application, which is best practice when messages are being published or read
    // regularly.
    //
    // Set the transport type to AmqpWebSockets so that the ServiceBusClient uses the port 443. 
    // If you use the default AmqpTcp, ensure that ports 5671 and 5672 are open.
    var clientOptions = new ServiceBusClientOptions
    { 
        TransportType = ServiceBusTransportType.AmqpWebSockets
    };
    //TODO: Replace the "<NAMESPACE-NAME>" and "<QUEUE-NAME>" placeholders.
    client = new ServiceBusClient(
        "<NAMESPACE-NAME>.servicebus.windows.net",
        new DefaultAzureCredential(),
        clientOptions);
    sender = client.CreateSender("<QUEUE-NAME>");
    
    // create a batch 
    using ServiceBusMessageBatch messageBatch = await sender.CreateMessageBatchAsync();
    
    for (int i = 1; i <= numOfMessages; i++)
    {
        // try adding a message to the batch
        if (!messageBatch.TryAddMessage(new ServiceBusMessage($"Message {i}")))
        {
            // if it is too large for the batch
            throw new Exception($"The message {i} is too large to fit in the batch.");
        }
    }
    
    try
    {
        // Use the producer client to send the batch of messages to the Service Bus queue
        await sender.SendMessagesAsync(messageBatch);
        Console.WriteLine($"A batch of {numOfMessages} messages has been published to the queue.");
    }
    finally
    {
        // Calling DisposeAsync on client types is required to ensure that network
        // resources and other unmanaged objects are properly cleaned up.
        await sender.DisposeAsync();
        await client.DisposeAsync();
    }
    
    Console.WriteLine("Press any key to end the application");
    Console.ReadKey();
    
  2. プロジェクトをビルドし、エラーがないことを確認します。

  3. プログラムを実行し、確認メッセージが表示されるまで待ちます。

    A batch of 3 messages has been published to the queue
    

    重要

    ほとんどの場合、ロールの割り当てが Azure に反映されるまでの時間は 1、2 分です。 まれに、最大で 8 分かかる場合があります。 初めてコードを実行したときに認証エラーを受け取る場合は、しばらく待ってから再試行してください。

  4. Azure portal で次の手順を実行します。

    1. 自分の Service Bus 名前空間に移動します。

    2. [概要] ページ中央下のペインでキューを選択します。

      Image showing the Service Bus Namespace page in the Azure portal with the queue selected.

    3. [要点] セクションの値に注目します。

      Image showing the number of messages received and the size of the queue.

    次の値に注目してください。

    • キューの [アクティブ] メッセージ数の値は、現在 3 です。 メッセージを取得せずにこの送信側アプリを実行するたびに、この値が 3 ずつ増えます。
    • アプリからキューにメッセージを追加するたびに、キューの [現在のサイズ] が増加します。
    • 下部の [メトリック] セクションの [メッセージ] グラフでは、キューに 3 つの受信メッセージがあることがわかります。

キューからメッセージを受け取る

このセクションでは、キューからメッセージを受信する .NET コンソール アプリケーションを作成します。

Note

このクイックスタートでは、メッセージのバッチを Service Bus キューに送信し、それらを受信するというシナリオを実装する手順を、順を追って説明します。 その他のシナリオや高度なシナリオのサンプルについては、GitHub の Service Bus .NET サンプルを参照してください。

受信側のプロジェクトを作成する

  1. ソリューション エクスプローラー ウィンドウで、 [ServiceBusQueueQuickStart] ソリューションを右クリックし、 [追加] をポイントして、 [新しいプロジェクト] を選択します。
  2. [コンソール アプリケーション] を選択し、 [次へ] を選択します。
  3. [プロジェクト名] に「QueueReceiver」と入力し、 [作成] を選択します。
  4. ソリューション エクスプローラー ウィンドウで、 [QueueReceiver] を右クリックし、 [Set as a Startup Project](スタートアップ プロジェクトとして設定) を選択します。

NuGet パッケージをプロジェクトに追加する

  1. メニューから [ツール]>[NuGet パッケージ マネージャー]>[パッケージ マネージャー コンソール] の順に選択します。

  2. [既定のプロジェクト][QueueReceiver] を選択します。

    Screenshot showing QueueReceiver project selected in the Package Manager Console.

  3. 次のコマンドを実行して、Azure.Messaging.ServiceBus NuGet パッケージをインストールします。

    Install-Package Azure.Messaging.ServiceBus
    
  4. 次のコマンドを実行して、Azure.Identity NuGet パッケージをインストールします。

    Install-Package Azure.Identity
    

キューからメッセージを受信するコードを追加する

このセクションでは、キューからメッセージを取得するコードを追加します。

  1. Program クラス内に、次のコードを追加します。

    using System.Threading.Tasks;
    using Azure.Identity;
    using Azure.Messaging.ServiceBus;
    
    // the client that owns the connection and can be used to create senders and receivers
    ServiceBusClient client;
    
    // the processor that reads and processes messages from the queue
    ServiceBusProcessor processor;
    
  2. Program クラスの末尾に次のメソッドを追加します。

    // handle received messages
    async Task MessageHandler(ProcessMessageEventArgs args)
    {
        string body = args.Message.Body.ToString();
        Console.WriteLine($"Received: {body}");
    
        // complete the message. message is deleted from the queue. 
        await args.CompleteMessageAsync(args.Message);
    }
    
    // handle any errors when receiving messages
    Task ErrorHandler(ProcessErrorEventArgs args)
    {
        Console.WriteLine(args.Exception.ToString());
        return Task.CompletedTask;
    }
    
  3. Program クラスの末尾に次のコードを追加します。 重要な手順の概要を以下のセクションに示します。コード コメントに追加情報が記載されています。

    • DefaultAzureCredential オブジェクトを使用して ServiceBusClient オブジェクトを作成します。 DefaultAzureCredential によって、Visual Studio サインインの資格情報が自動的に検出および使用されて、Azure Service Bus に対する認証が行われます。
    • `ServiceBusClient` オブジェクトで [CreateProcessor](/dotnet/api/azure.messaging.servicebus.servicebusclient.createprocessor) メソッドを呼び出し、指定した Service Bus キューに対して [ServiceBusProcessor](/dotnet/api/azure.messaging.servicebus.servicebusprocessor) オブジェクトを作成します。
    • ServiceBusProcessor オブジェクトの ProcessMessageAsync および ProcessErrorAsync の各イベントのハンドラーを指定します。
    • `ServiceBusProcessor` オブジェクトで [StartProcessingAsync](/dotnet/api/azure.messaging.servicebus.servicebusprocessor.startprocessingasync) を呼び出して、メッセージの処理を開始します。
    • ユーザーがキーを押して処理を終了すると、`ServiceBusProcessor` オブジェクトで [StopProcessingAsync](/dotnet/api/azure.messaging.servicebus.servicebusprocessor.stopprocessingasync) が呼び出されます。

    重要

    Service Bus 名前空間とキューの名前を使用して、コード スニペットのプレースホルダー値 (<NAMESPACE-NAME><QUEUE-NAME>) を更新します。

    // The Service Bus client types are safe to cache and use as a singleton for the lifetime
    // of the application, which is best practice when messages are being published or read
    // regularly.
    //
    // Set the transport type to AmqpWebSockets so that the ServiceBusClient uses port 443. 
    // If you use the default AmqpTcp, make sure that ports 5671 and 5672 are open.
    
    // TODO: Replace the <NAMESPACE-NAME> placeholder
    var clientOptions = new ServiceBusClientOptions()
    {
        TransportType = ServiceBusTransportType.AmqpWebSockets
    };
    client = new ServiceBusClient(
        "<NAMESPACE-NAME>.servicebus.windows.net",
        new DefaultAzureCredential(),
        clientOptions);
    
    // create a processor that we can use to process the messages
    // TODO: Replace the <QUEUE-NAME> placeholder
    processor = client.CreateProcessor("<QUEUE-NAME>", new ServiceBusProcessorOptions());
    
    try
    {
        // add handler to process messages
        processor.ProcessMessageAsync += MessageHandler;
    
        // add handler to process any errors
        processor.ProcessErrorAsync += ErrorHandler;
    
        // start processing 
        await processor.StartProcessingAsync();
    
        Console.WriteLine("Wait for a minute and then press any key to end the processing");
        Console.ReadKey();
    
        // stop processing 
        Console.WriteLine("\nStopping the receiver...");
        await processor.StopProcessingAsync();
        Console.WriteLine("Stopped receiving messages");
    }
    finally
    {
        // Calling DisposeAsync on client types is required to ensure that network
        // resources and other unmanaged objects are properly cleaned up.
        await processor.DisposeAsync();
        await client.DisposeAsync();
    }
    
  4. 完成した Program クラスは、次のコードになります。

    using System.Threading.Tasks;
    using Azure.Messaging.ServiceBus;
    using Azure.Identity;
    
    // the client that owns the connection and can be used to create senders and receivers
    ServiceBusClient client;
    
    // the processor that reads and processes messages from the queue
    ServiceBusProcessor processor;
    
    // The Service Bus client types are safe to cache and use as a singleton for the lifetime
    // of the application, which is best practice when messages are being published or read
    // regularly.
    //
    // Set the transport type to AmqpWebSockets so that the ServiceBusClient uses port 443.
    // If you use the default AmqpTcp, make sure that ports 5671 and 5672 are open.
    
    // TODO: Replace the <NAMESPACE-NAME> and <QUEUE-NAME> placeholders
    var clientOptions = new ServiceBusClientOptions() 
    {
        TransportType = ServiceBusTransportType.AmqpWebSockets
    };
    client = new ServiceBusClient("<NAMESPACE-NAME>.servicebus.windows.net", 
        new DefaultAzureCredential(), clientOptions);
    
    // create a processor that we can use to process the messages
    // TODO: Replace the <QUEUE-NAME> placeholder
    processor = client.CreateProcessor("<QUEUE-NAME>", new ServiceBusProcessorOptions());
    
    try
    {
        // add handler to process messages
        processor.ProcessMessageAsync += MessageHandler;
    
        // add handler to process any errors
        processor.ProcessErrorAsync += ErrorHandler;
    
        // start processing 
        await processor.StartProcessingAsync();
    
        Console.WriteLine("Wait for a minute and then press any key to end the processing");
        Console.ReadKey();
    
        // stop processing 
        Console.WriteLine("\nStopping the receiver...");
        await processor.StopProcessingAsync();
        Console.WriteLine("Stopped receiving messages");
    }
    finally
    {
        // Calling DisposeAsync on client types is required to ensure that network
        // resources and other unmanaged objects are properly cleaned up.
        await processor.DisposeAsync();
        await client.DisposeAsync();
    }
    
    // handle received messages
    async Task MessageHandler(ProcessMessageEventArgs args)
    {
        string body = args.Message.Body.ToString();
        Console.WriteLine($"Received: {body}");
    
        // complete the message. message is deleted from the queue. 
        await args.CompleteMessageAsync(args.Message);
    }
    
    // handle any errors when receiving messages
    Task ErrorHandler(ProcessErrorEventArgs args)
    {
        Console.WriteLine(args.Exception.ToString());
        return Task.CompletedTask;
    }
    
  5. プロジェクトをビルドし、エラーがないことを確認します。

  6. 受信側アプリを実行します。 受信メッセージが表示されます。 任意のキーを押して、受信側とアプリケーションを停止します。

    Wait for a minute and then press any key to end the processing
    Received: Message 1
    Received: Message 2
    Received: Message 3
    
    Stopping the receiver...
    Stopped receiving messages
    
  7. もう一度ポータルを確認します。 [アクティブ] メッセージ数に 0 と表示されていない場合は、数分待ってからページを最新の情報に更新します。

    • [アクティブ] メッセージ数と [現在のサイズ] の値が 0 になりました。

    • 下部の [メトリック] セクションの [メッセージ] グラフを見ると、このキューには 3 つの受信メッセージと 3 つの送信メッセージがあることがわかります。

      Screenshot showing active messages and size after receive.

リソースをクリーンアップする

Azure portal で Service Bus 名前空間に移動し、Azure portal で [削除] を選択して名前空間とその中のキューを削除します。

関連項目

次のドキュメントおよびサンプルを参照してください。

次のステップ