Skip to content

Commit edaeb71

Browse files
committed
tweaks
1 parent 2d31781 commit edaeb71

File tree

4 files changed

+66
-91
lines changed

4 files changed

+66
-91
lines changed

articles/storage/common/migrate-azure-credentials.md

Lines changed: 16 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -82,19 +82,17 @@ After making these code changes, run your application locally. The new configura
8282

8383
Once your application is configured to use passwordless connections and runs locally, the same code can authenticate to Azure services after it's deployed to Azure. The sections that follow explain how to configure a deployed application to connect to Azure Blob Storage using a managed identity.
8484

85-
#### Create a managed identity
85+
#### Create the managed identity
8686

8787
[!INCLUDE [create-managed-identity](../../../includes/passwordless/migration-guide/create-user-assigned-managed-identity.md)]
8888

89-
After the resource is created, select **Go to resource** to view the details of the managed identity.
90-
9189
#### Associate the managed identity with your web app
9290

9391
You need to configure your web app to use the managed identity you created. Assign the identity to your app using either the Azure portal or the Azure CLI.
9492

9593
# [Azure Portal](#tab/azure-portal-associate)
9694

97-
Complete the following steps to use the Azure portal to associate an identity with your app. These steps apply to the following Azure services:
95+
Complete the following steps in the Azure portal to associate an identity with your app. These same steps apply to the following Azure services:
9896

9997
* Azure Spring Apps
10098
* Azure Container Apps
@@ -103,7 +101,7 @@ Complete the following steps to use the Azure portal to associate an identity wi
103101

104102
1. Navigate to the overview page of your web app.
105103
1. Select **Identity** from the left navigation.
106-
1. On the Identity page, switch to the **User assigned** tab.
104+
1. On the **Identity** page, switch to the **User assigned** tab.
107105
1. Select **+ Add** to open the **Add user assigned managed identity** flyout.
108106
1. Select the subscription you used previously to create the identity.
109107
1. Search for the **MigrationIdentity** by name and select it from the search results.
@@ -175,23 +173,23 @@ If you connected your services using the Service Connector you don't need to com
175173

176174
#### Update the application code
177175

178-
You need to configure your application code to look for the specific managed identity you created when it is deployed to Azure. Explicitly setting the managed identity for the app also prevents other environment identities from accidentally being detected and used automatically.
176+
You need to configure your application code to look for the specific managed identity you created when it is deployed to Azure. In some scenarios, explicitly setting the managed identity for the app also prevents other environment identities from accidentally being detected and used automatically.
179177

180178
1. On the managed identity overview page, copy the client ID value to your clipboard.
181179
1. Update the `DefaultAzureCredential` object in the `Program.cs` file of your app to specify this managed identity client ID.
182180

183-
```csharp
184-
// TODO: Update the <your-storage-account-name> and <your-managed-identity-client-id> placeholders
185-
var blobServiceClient = new BlobServiceClient(
186-
new Uri("https://<your-storage-account-name>.blob.core.windows.net"),
187-
new DefaultAzureCredential(
188-
new DefaultAzureCredentialOptions()
189-
{
190-
ManagedIdentityClientId = "<your-managed-identity-client-id>"
191-
}));
192-
```
193-
194-
You will need to redeploy your code to Azure after making this change in order for the configuration updates to be applied.
181+
```csharp
182+
// TODO: Update the <your-storage-account-name> and <your-managed-identity-client-id> placeholders
183+
var blobServiceClient = new BlobServiceClient(
184+
new Uri("https://<your-storage-account-name>.blob.core.windows.net"),
185+
new DefaultAzureCredential(
186+
new DefaultAzureCredentialOptions()
187+
{
188+
ManagedIdentityClientId = "<your-managed-identity-client-id>"
189+
}));
190+
```
191+
192+
3. Redeploy your code to Azure after making this change in order for the configuration updates to be applied.
195193

196194
#### Test the app
197195

includes/passwordless/migration-guide/associate-managed-identity-cli.md

Lines changed: 2 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11
Use the following Azure CLI commands to associate an identity with your app:
22

3-
# [Azure App Service](#tab/app-service-identity)
4-
53
Retrieve the ID of the managed identity you created using the [az identity show](/cli/azure/identity) command. Copy the output value to use in the next step.
64

75
```azurecli
86
az identity show --name MigrationIdentity -g <your-identity-resource-group-name> --query id
97
```
108

9+
# [Azure App Service](#tab/app-service-identity)
10+
1111
You can assign a managed identity to an Azure App Service instance with the [az webapp identity assign](/cli/azure/webapp/identity) command.
1212

1313
```azurecli
@@ -19,12 +19,6 @@ az webapp identity assign \
1919

2020
# [Azure Spring Apps](#tab/spring-apps-identity)
2121

22-
Retrieve the ID of the managed identity you created using the [az identity show](/cli/azure/identity) command. Copy the output value to use in the next step.
23-
24-
```azurecli
25-
az identity show --name MigrationIdentity -g <your-identity-resource-group-name> --query id
26-
```
27-
2822
You can assign a managed identity to an Azure Spring Apps instance with the [az spring app identity assign](/cli/azure/spring/app/identity) command.
2923

3024
```azurecli
@@ -37,13 +31,6 @@ az spring app identity assign \
3731

3832
# [Azure Container Apps](#tab/container-apps-identity)
3933

40-
Retrieve the ID of the managed identity you created using the [az identity show](/cli/azure/identity) command. Copy the output value to use in the next step.
41-
42-
```azurecli
43-
az identity show --name MigrationIdentity -g <your-identity-resource-group-name> --query id
44-
```
45-
You can assign a managed identity to an Azure Container Apps instance with the [az container app identity assign](/cli/azure/containerapp/identity) command.
46-
4734
```azurecli
4835
az containerapp identity assign \
4936
--resource-group <resource-group-name> \
@@ -53,12 +40,6 @@ az containerapp identity assign \
5340

5441
# [Azure virtual machines](#tab/virtual-machines-identity)
5542

56-
Retrieve the ID of the managed identity you created using the [az identity show](/cli/azure/identity) command. Copy the output value to use in the next step.
57-
58-
```azurecli
59-
az identity show --name MigrationIdentity -g <your-identity-resource-group-name> --query id
60-
```
61-
6243
You can assign a managed identity to a virtual machine with the [az vm identity assign](/cli/azure/vm/identity) command.
6344

6445
```azurecli
@@ -70,12 +51,6 @@ az vm identity assign \
7051

7152
# [Azure Kubernetes Service](#tab/aks-identity)
7253

73-
Retrieve the ID of the managed identity you created using the [az identity show](/cli/azure/identity) command. Copy the output value to use in the next step.
74-
75-
```azurecli
76-
az identity show --name MigrationIdentity -g <your-identity-resource-group-name> --query id
77-
```
78-
7954
You can assign a managed identity to an Azure Kubernetes Service (AKS) instance with the [az aks update](/cli/azure/aks) command.
8055

8156
```azurecli

includes/passwordless/migration-guide/create-user-assigned-managed-identity.md

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
You can create a user-assigned managed identity using the Azure portal or the Azure CLI. Your application uses the identity to authenticate to other services.
1+
You can create a user-assigned managed identity using the Azure portal or the Azure CLI. Your application uses the identity to authenticate to other services.
22

33
# [Azure portal](#tab/azure-portal-create)
44

@@ -9,14 +9,16 @@ You can create a user-assigned managed identity using the Azure portal or the Az
99
* **Resource Group**: Select your desired resource group.
1010
* **Region**: Select a region near your location.
1111
* **Name**: Enter a recognizable name for your identity, such as *MigrationIdentity*.
12-
1. Select **Review & Create** at the bottom of the page.
12+
1. Select **Review + create** at the bottom of the page.
1313
1. When the validation checks finish, select **Create**. Azure creates a new user-assigned identity.
1414

15-
:::image type="content" source="../../../articles/storage/common/media/create-managed-identity-portal-small.png" alt-text="A screenshot showing how to create a user assigned managed identity." lightbox="../../../articles/storage/common/media/create-managed-identity-portal.png" :::
15+
After the resource is created, select **Go to resource** to view the details of the managed identity.
1616

17+
:::image type="content" source="../../../articles/storage/common/media/create-managed-identity-portal-small.png" alt-text="A screenshot showing how to create a user assigned managed identity." lightbox="../../../articles/storage/common/media/create-managed-identity-portal.png" :::
18+
1719
# [Azure CLI](#tab/azure-cli-create)
1820

19-
Use the `az identity create` command to create a managed identity:
21+
Use the `az identity create` command to create a user-assigned managed identity:
2022

2123
```azurecli
2224
az identity create --name MigrationIdentity --resource-group <your-resource-group>
Lines changed: 42 additions & 42 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
You can use Service Connector to create a connection between an Azure compute hosting environment and a target service using the Azure CLI. The service connector CLI commands automatically assign the proper role to your identity, as explained in the [portal instructions](#create-the-managed-identity-using-the-azure-portal).
1+
You can use Service Connector to create a connection between an Azure compute hosting environment and a target service using the Azure CLI. The service connector CLI commands automatically assign the proper role to your identity.
22

33
1. Retrieve the client-id of the managed identity you created using the `az identity show` command. Copy the value for later use.
44

@@ -8,45 +8,45 @@ You can use Service Connector to create a connection between an Azure compute ho
88
99
1. Use the appropriate CLI command to establish the service connection:
1010
11-
# [Azure App Service](#tab/app-service-connector)
12-
13-
If you're using an Azure App Service, use the `az webapp connection` command:
14-
15-
```azurecli
16-
az webapp connection create storage-blob \
17-
--resource-group <resource-group-name> \
18-
--name <webapp-name> \
19-
--target-resource-group <target-resource-group-name> \
20-
--account <target-storage-account-name> \
21-
--user-identity "client-id=<your-identity-client-id>" "subs-id=<your-subscription-id>"
22-
```
23-
24-
# [Azure Spring](#tab/spring-connector)
25-
26-
If you're using Azure Spring Apps, use `the az spring-cloud connection` command:
27-
28-
```azurecli
29-
az spring-cloud connection create storage-blob \
30-
--resource-group <resource-group-name> \
31-
--service <service-instance-name> \
32-
--app <app-name> \
33-
--deployment <deployment-name> \
34-
--target-resource-group <target-resource-group> \
35-
--account <target-storage-account-name> \
36-
--user-identity "client-id=<your-identity-client-id>" "subs-id=<your-subscription-id>"
37-
```
38-
39-
# [Azure Container Apps](#tab/container-apps-connector)
40-
41-
If you're using Azure Container Apps, use the `az containerapp connection` command:
42-
43-
```azurecli
44-
az containerapp connection create storage-blob \
45-
--resource-group <resource-group-name> \
46-
--name <containerapp-name> \
47-
--target-resource-group <target-resource-group-name> \
48-
--account <target-storage-account-name> \
49-
--user-identity "client-id=<your-identity-client-id>" "subs-id=<your-subscription-id>"
50-
```
11+
# [Azure App Service](#tab/app-service-connector)
12+
13+
If you're using an Azure App Service, use the `az webapp connection` command:
14+
15+
```azurecli
16+
az webapp connection create storage-blob \
17+
--resource-group <resource-group-name> \
18+
--name <webapp-name> \
19+
--target-resource-group <target-resource-group-name> \
20+
--account <target-storage-account-name> \
21+
--user-identity "client-id=<your-identity-client-id>" "subs-id=<your-subscription-id>"
22+
```
23+
24+
# [Azure Spring](#tab/spring-connector)
25+
26+
If you're using Azure Spring Apps, use `the az spring-cloud connection` command:
27+
28+
```azurecli
29+
az spring-cloud connection create storage-blob \
30+
--resource-group <resource-group-name> \
31+
--service <service-instance-name> \
32+
--app <app-name> \
33+
--deployment <deployment-name> \
34+
--target-resource-group <target-resource-group> \
35+
--account <target-storage-account-name> \
36+
--user-identity "client-id=<your-identity-client-id>" "subs-id=<your-subscription-id>"
37+
```
38+
39+
# [Azure Container Apps](#tab/container-apps-connector)
40+
41+
If you're using Azure Container Apps, use the `az containerapp connection` command:
42+
43+
```azurecli
44+
az containerapp connection create storage-blob \
45+
--resource-group <resource-group-name> \
46+
--name <containerapp-name> \
47+
--target-resource-group <target-resource-group-name> \
48+
--account <target-storage-account-name> \
49+
--user-identity "client-id=<your-identity-client-id>" "subs-id=<your-subscription-id>"
50+
```
5151
52-
---
52+
---

0 commit comments

Comments
 (0)