Skip to content

Commit 9e2d887

Browse files
committed
Added the note to Service Bus MSI article
1 parent bbccecb commit 9e2d887

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

articles/service-bus-messaging/service-bus-managed-service-identity.md

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
title: Managed identities for Azure resources with Service Bus
33
description: This article describes how to use managed identities to access with Azure Service Bus entities (queues, topics, and subscriptions).
44
ms.topic: article
5-
ms.date: 07/22/2024
5+
ms.date: 02/11/2025
66
---
77

88
# Authenticate a managed identity with Microsoft Entra ID to access Azure Service Bus resources
@@ -69,6 +69,11 @@ az role assignment create \
6969

7070
For more information about how built-in roles are defined, see [Understand role definitions](../role-based-access-control/role-definitions.md#control-and-data-actions). For information about creating Azure custom roles, see [Azure custom roles](../role-based-access-control/custom-roles.md).
7171

72+
> [!NOTE]
73+
> If the source service or app doesn't restart after the access to a Service Bus entity is disabled by removing the source's managed identity from the Service Bus RBAC role, the source app may continue to send/receive messages to/from the Service Bus entity until the token expires (default token validity is 24 hours). This behavior is by design.
74+
>
75+
> Therefore, after you remove the source's managed identity from the RBAC role, restart the source app or service to immediately expire the token and prevent it from sending messages to or receiving messages from the Service Bus entity.
76+
7277
## Using SDKs
7378

7479
In .NET, the [ServiceBusClient](/dotnet/api/azure.messaging.servicebus.servicebusclient) object is initialized by using a constructor that takes a fully qualified namespace and a `TokenCredential`. The `DefaultAzureCredential` derives from `TokenCredential`, which automatically uses the managed identity configured for the app. The flow of the managed identity context to Service Bus and the authorization handshake are automatically handled by the token credential. It's a simpler model than using SAS.
@@ -87,7 +92,7 @@ For complete step-by-step instructions to send and receive messages using a mana
8792
- [Python](service-bus-python-how-to-use-queues.md)
8893

8994
> [!NOTE]
90-
> The managed identity works only inside the Azure environment, on App services, Azure VMs, and scale sets. For .NET applications, the Microsoft.Azure.Services.AppAuthentication library, which is used by the Service Bus NuGet package, provides an abstraction over this protocol and supports a local development experience. This library also allows you to test your code locally on your development machine, using your user account from Visual Studio, Azure CLI 2.0 or Active Directory Integrated Authentication. For more on local development options with this library, see [Service-to-service authentication to Azure Key Vault using .NET](/dotnet/api/overview/azure/service-to-service-authentication).
95+
> The managed identity works only inside the Azure environment, on App services, Azure VMs, and scale sets. For .NET applications, the Microsoft.Azure.Services.AppAuthentication library, which is used by the Service Bus NuGet package, provides an abstraction over this protocol and supports a local development experience. This library also allows you to test your code locally on your development machine, using your user account from Visual Studio, Azure CLI 2.0, or Active Directory Integrated Authentication. For more on local development options with this library, see [Service-to-service authentication to Azure Key Vault using .NET](/dotnet/api/overview/azure/service-to-service-authentication).
9196
9297

9398
## Next steps

0 commit comments

Comments
 (0)