You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: articles/storage/common/multiple-identity-scenarios.md
+11-11Lines changed: 11 additions & 11 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -65,15 +65,15 @@ The following steps demonstrate how to configure an app to use a system-assigned
65
65
66
66
1. Choose **+ Add** and then **Add role assignment**.
67
67
68
-
:::image type="content" source="media/assign-role-system-identity.png" alt-text="Screenshot showing how to assign a system-assigned managed identity.":::
68
+
:::image type="content" source="media/assign-role-system-identity.png" alt-text="Screenshot showing how to locate the Azure portal section for assigning a role to a system-assigned managed identity.":::
69
69
70
70
1. In the **Role** search box, search for *Storage Blob Data Contributor*, which grants permissions to perform read and write operations on blob data. You can assign whatever role is appropriate for your use case. Select the *Storage Blob Data Contributor* from the list and choose **Next**.
71
71
72
72
1. On the **Add role assignment** screen, for the **Assign access to** option, select **Managed identity**. Then choose **+Select members**.
73
73
74
-
1. In the flyout, search for the managed identity you created by entering the name of your app service. Select the system-assigned identity, and then choose **Select** to close the flyout menu.
74
+
1. In the flyout, search for the managed identity you created by entering the name of your App Service. Select the system-assigned identity, and then choose **Select** to close the flyout menu.
75
75
76
-
:::image type="content" source="media/migration-select-identity.png" alt-text="Screenshot showing how to select a system-assigned managed identity.":::
76
+
:::image type="content" source="media/migration-select-identity.png" alt-text="Screenshot showing how to assign a role to a system-assigned managed identity in the Azure portal.":::
77
77
78
78
1. Select **Next** a couple times until you're able to select **Review + assign** to finish the role assignment.
79
79
@@ -102,7 +102,7 @@ You can also enable access to Azure resources for local development by assigning
102
102
dotnet add package Azure.Storage.Blobs
103
103
```
104
104
105
-
1. Instantiate service clients for the services your app will connect to. The following code sample interacts with Blob Storage and Service Bus using the corresponding service clients.
105
+
1. Instantiate service clients for the Azure services to which your app will connect. The following code sample interacts with Blob Storage and Service Bus using the corresponding service clients.
106
106
107
107
```csharp
108
108
using Azure.Identity;
@@ -153,7 +153,7 @@ You can also enable access to Azure resources for local development by assigning
153
153
</dependencies>
154
154
```
155
155
156
-
1. Instantiate service clients for the services your app will connect to. The following code sample interacts with Blob Storage and Service Bus using the corresponding service clients.
156
+
1. Instantiate service clients for the Azure services to which your app will connect. The following code sample interacts with Blob Storage and Service Bus using the corresponding service clients.
157
157
158
158
```java
159
159
class Demo {
@@ -239,7 +239,7 @@ You can also enable access to Azure resources for local development by assigning
1. Instantiate service clients for the services your app will connect to. The following code sample interacts with Blob Storage and Service Bus using the corresponding service clients.
242
+
1. Instantiate service clients for the Azure services to which your app will connect. The following code sample interacts with Blob Storage and Service Bus using the corresponding service clients.
243
243
244
244
```javascript
245
245
import { DefaultAzureCredential } from "@azure/identity";
@@ -275,7 +275,7 @@ You can also enable access to Azure resources for local development by assigning
1. Instantiate service clients for the services your app will connect to. The following code sample interacts with Blob Storage and Service Bus using the corresponding service clients.
278
+
1. Instantiate service clients for the Azure services to which your app will connect. The following code sample interacts with Blob Storage and Service Bus using the corresponding service clients.
279
279
280
280
```python
281
281
from azure.identity import DefaultAzureCredential
@@ -304,22 +304,22 @@ You can also enable access to Azure resources for local development by assigning
304
304
305
305
---
306
306
307
-
When this code runs locally, `DefaultAzureCredential` searches a credential chain for the first available credentials. If the `Managed_Identity_Client_ID` is null locally, it will automatically use the credentials from your local Azure CLI or Visual Studio sign-in. You can read more about this process in the [Azure Identity library overview](/dotnet/api/overview/azure/Identity-readme#defaultazurecredential).
307
+
When this code runs locally, `DefaultAzureCredential` searches its credential chain for the first available credentials. If the `Managed_Identity_Client_ID` is null locally, it automatically uses the credentials from your local Azure CLI or Visual Studio sign-in. You can read more about this process in the [Azure Identity library overview](/dotnet/api/overview/azure/Identity-readme#defaultazurecredential).
308
308
309
309
When the application is deployed to Azure, `DefaultAzureCredential` automatically retrieves the `Managed_Identity_Client_ID` variable from the App Service environment. That value becomes available when a managed identity is associated with your app.
310
310
311
311
This overall process ensures that your app can run securely locally and in Azure without the need for any code changes.
312
312
313
313
## Connect multiple apps using multiple managed identities
314
314
315
-
Although the apps in the previous example all shared the same service access requirements, real-world environments are often more nuanced. Consider a scenario where multiple apps connect to the same storage accounts, but two of the apps also access different services or databases.
315
+
Although the apps in the previous example shared the same service access requirements, real-world environments are often more nuanced. Consider a scenario where multiple apps connect to the same storage accounts, but two of the apps also access different services or databases.
To configure this setup in your code, ensure your application registers separate service clients to connect to each storage account or database. Reference the correct managed identity client IDs for each service when configuring `DefaultAzureCredential`. The following code sample configures these Azure service connections:
320
320
321
321
* Two connections to separate storage accounts using a shared user-assigned managed identity
322
-
* A connection to Azure Cosmos DB and Azure SQL services using a second user-assigned managed identity. This managed identity is shared when the Azure SQL client driver allows for it; see the code comments for more details.
322
+
* A connection to Azure Cosmos DB and Azure SQL services using a second user-assigned managed identity. This managed identity is shared when the Azure SQL client driver allows for it. For more information, see the code comments.
323
323
324
324
### [.NET](#tab/csharp)
325
325
@@ -715,7 +715,7 @@ To configure this setup in your code, ensure your application registers separate
715
715
716
716
---
717
717
718
-
You can also associate a user-assigned managed identity and a system-assigned managed identity to a resource simultaneously. This can be useful in scenarios where all of the apps require access to the same shared services, but one of the apps also has a very specific dependency on an additional service. Using a system-assigned managed identity also ensures that the identity tied to that specific app is deleted when the app is deleted, which can help keep your environment clean.
718
+
You can also associate a user-assigned managed identity and a system-assigned managed identity to a resource simultaneously. This can be useful in scenarios where all of the apps require access to the same shared services, but one of the apps also has a specific dependency on an additional service. Using a system-assigned managed identity also ensures that the identity tied to that specific app is deleted when the app is deleted, which can help keep your environment clean.
0 commit comments