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/site-recovery/how-to-migrate-run-as-accounts-managed-identity.md
+68-16Lines changed: 68 additions & 16 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -5,19 +5,18 @@ author: ankitaduttaMSFT
5
5
ms.service: site-recovery
6
6
ms.author: ankitadutta
7
7
ms.topic: how-to
8
-
ms.date: 01/19/2023
8
+
ms.date: 02/21/2023
9
9
---
10
10
11
-
# Manage identities
11
+
# Migrate from a Run As account to Managed Identities
12
12
13
13
> [!IMPORTANT]
14
14
> - Azure Automation Run As Account will retire on September 30, 2023 and will be replaced with Managed Identities. Before that date, you'll need to start migrating your runbooks to use [managed identities](/articles/automation/automation-security-overview.md#managed-identities). For more information, see [migrating from an existing Run As accounts to managed identity](/articles/automation/migrate-run-as-accounts-managed-identity?tabs=run-as-account#sample-scripts).
15
15
> - Delaying the feature has a direct impact on our support burden, as it would cause upgrades of mobility agent to fail.
16
16
17
17
This article shows you how to migrate a Managed Identities for Azure Site Recovery applications. Azure Automation Accounts are used by Azure Site Recovery customers to auto-update the agents of their protected virtual machines. Site Recovery creates Azure Automation Run As Accounts when you enable replication via the IaaS VM Blade and Recovery Services Vault.
18
18
19
-
On Azure, managed identities eliminate the need for developers having to manage credentials by providing an identity for the Azure resource
20
-
in Azure Active Directory (Azure AD) and using it to obtain Azure AD tokens.
19
+
On Azure, managed identities eliminate the need for developers having to manage credentials by providing an identity for the Azure resource in Azure Active Directory (Azure AD) and using it to obtain Azure AD tokens.
21
20
22
21
## Prerequisites
23
22
@@ -33,32 +32,88 @@ Before you migrate from a Run As account to a managed identity:
33
32
1. Assign the same role to the managed identity to access the Azure resources that match the Run As account. Follow the steps in [Check the role assignment for the Azure Automation Run As account](../automation/manage-run-as-account.md#check-role-assignment-for-azure-automation-run-as-account).
34
33
35
34
Ensure that you don't assign high-privilege permissions like contributor or owner to the Run As account. Follow the role-based access control (RBAC) guidelines to limit the permissions from the default contributor permissions assigned to a Run As account by using [this script](../automation/manage-run-as-account.md#limit-run-as-account-permissions).
35
+
36
+
## Benefits of managed identities
37
+
38
+
Here are some of the benefits of using managed identities:
39
+
40
+
- You don't need to manage credentials. Credentials aren’t even accessible to you.
41
+
- You can use managed identities to authenticate to any resource that supports [Azure AD authentication](../authentication/overview-authentication.md), including your own applications.
42
+
- Managed identities can be used at no extra cost.
43
+
44
+
> [!NOTE]
45
+
> Managed identities for Azure resources is the new name for the service formerly known as Managed Service Identity (MSI).
46
+
47
+
## Migrate from an existing Run As account to a managed identity
36
48
37
-
## Configure managed identities
49
+
###Configure managed identities
38
50
39
51
You can configure your managed identities through:
40
52
41
53
- Azure portal
42
54
- Azure CLI
43
55
- your Azure Resource Manager (ARM) template
44
56
45
-
When a managed identity is added, deleted, or modified on a running container app, the app doesn't automatically restart and a new revision isn't created.
46
-
47
57
> [!NOTE]
48
58
> For more information about migration cadence and the support timeline for Run As account creation and certificate renewal, see the [frequently asked questions](../automation/automation-managed-identity-faq.md).
49
59
50
-
> [!NOTE]
51
-
> When adding a managed identity to a container app deployed before April 11, 2022, you must create a new revision.
52
-
53
-
## Migrate from an existing Run As account to a managed identity
54
60
55
61
### Portal experience
56
62
57
-
-
63
+
**To migrate your Azure Automation account authentication type from a Run As to a managed identity authentication, follow these steps:**
64
+
65
+
1. In the [Azure portal](https://portal.azure.com), navigate and select the recovery services vault that you want to migrate.
66
+
67
+
1. On the homepage of your recovery services vault page, do the following:
68
+
1. On the left pane, under the **Manage** section, select **Site Recovery infrastructure**.
69
+
:::image type="content" source="./media/how-to-migrate-from-run-as-to-managed-identities/manage-section.png" alt-text="Screenshot of the **Site Recovery infrastructure** page.":::
70
+
1. Under the **For Azure virtual machines** section, select **Extension update settings**.
71
+
This page details the authentication type for the automation account that is being used to manage the Site Recovery extensions.
72
+
73
+
1. On this page, select the **Migrate** option to migrate the authentication type for your automation accounts to use Managed Identities.
74
+
75
+
:::image type="content" source="./media/how-to-migrate-from-run-as-to-managed-identities/extension-update-settings.png" alt-text="Screenshot of the Create Recovery Services vault page.":::
76
+
77
+
1. After the successful migration of your automation account, the authentication type for the linked account details on the **Extension update settings** page is updated.
78
+
79
+
When you successfully migrate from a Run As to a Managed Identities account, the following changes are reflected on the Automation Run As Accounts :
80
+
81
+
- System Assigned Managed Identity is enabled for the account (if not already enabled).
82
+
- The **Contributor** role permission is assigned to the Recovery Services vault’s subscription.
83
+
- The script that updates the mobility agent to use Managed Identity based authentication is updated.
84
+
85
+
86
+
### Link an existing managed identity account to vault
87
+
88
+
You can link an existing managed identity Automation account to your Recovery Services vault. To do so, follow these steps:
89
+
90
+
#### Enable the managed identity for the vault
91
+
92
+
1. Go to your selected managed identity automation account. Under under **Account settings**, select **Identity**.
93
+
94
+
:::image type="content" source="./media/how-to-migrate-from-run-as-to-managed-identities/mi-automation-account.png" alt-text="Screenshot that shows the identity settings page.":::
95
+
96
+
1. Under the **System assigned** section, change the **Status** to **On** and select **Save**.
97
+
98
+
An Object ID is generated. The vault is now registered with Azure Active
99
+
Directory.
100
+
:::image type="content" source="./media/hybrid-how-to-enable-replication-private-endpoints/enable-managed-identity-in-vault.png" alt-text="Screenshot that shows the system identity settings page.":::
101
+
102
+
1. Navigate back to your recovery services vault. On the left pane, select the **Access control (IAM)** option.
103
+
:::image type="content" source="./media/how-to-migrate-from-run-as-to-managed-identities/add-mi-iam.png" alt-text="Screenshot that shows IAM settings page.":::
104
+
1. Select **Add** > **Add role assignment** > **Contributor** to open the **Add role assignment** page.
105
+
1. On the **Add role assignment** page, ensure that the **Managed identity** option is selected.
106
+
1. Select the **Select members** option. This opens the **Select managed identities** pane. On this pane do the following:
107
+
1. In the **Select** field, paste the name of the managed identity automation account.
108
+
1. In the **Managed identity** field, select **All system-assigned managed identities**.
The following examples of runbook scripts fetch the Resource Manager resources by using the Run As account (service principal) and the managed identity.
116
+
The following examples of runbook scripts fetch the Resource Manager resources by using the Run As account (service principal) and the managed identity. You would notice the difference in runbook code at the beginning of the runbook, where it authenticates against the resource.
62
117
63
118
# [Run As account](#tab/run-as-account)
64
119
@@ -166,9 +221,6 @@ foreach ($ResourceGroup in $ResourceGroups)
-[Using a system-assigned managed identity for an Azure Automation account](../automation/enable-managed-identity-for-automation).
170
-
-[Using a user-assigned managed identity for an Azure Automation account](../automation/add-user-assigned-identity).
171
-
-[Connecting from your application to resources without handling credentials](../active-directory/managed-identities-azure-resources/overview-for-developers?tabs=portal%2Cdotnet)
172
224
-[Implementing managed identities for Microsoft Azure Resources](https://www.pluralsight.com/courses/microsoft-azure-resources-managed-identities-implementing).
173
225
-[FAQ for migrating from a Run As account to a managed identity](../automation/automation-managed-identity-faq).
174
226
-[FAQ for Managed Identities](../active-directory/managed-identities-azure-resources/managed-identities-faq.md)
0 commit comments