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
> When you choose **Allow Site Recovery to manage**, the setting is applied to all VMs in the vault.
66
67
67
68
> [!NOTE]
68
69
> Either option notifies you of the automation account used for managing updates. If you're using this feature in a vault for the first time, a new automation account is created by default. Alternately, you can customize the setting, and choose an existing automation account. Once defined, all subsequent actions to enable replication in the same vault will use that selected automation account. Currently, the drop-down menu will only list automation accounts that are in the same Resource Group as the vault.
69
70
71
+
**For a custom automation account, use the following script:**
72
+
70
73
> [!IMPORTANT]
71
-
> The following script needs to be run in the context of an automation account.
72
-
For a custom automation account, use the following script:
74
+
> Run the following script in the context of an automation account. This script leverages System Assigned Managed Identities as its authentication type.
@@ -495,3 +491,8 @@ If you can't enable automatic updates, see the following common errors and recom
495
491
496
492
> [!NOTE]
497
493
> After you renew the certificate, refresh the page to display the current status.
494
+
495
+
## Next steps
496
+
497
+
[Learn more](./how-to-migrate-run-as-accounts-managed-identity.md) on how to migrate the authentication type of the Automation accounts to Managed Identities.
title: Migrate from a Run As account to a managed identity
3
+
description: This article describes how to migrate from a Run As account to a managed identity in Azure Site Recovery.
4
+
author: ankitaduttaMSFT
5
+
ms.service: site-recovery
6
+
ms.author: ankitadutta
7
+
ms.topic: how-to
8
+
ms.date: 02/23/2023
9
+
---
10
+
11
+
# Migrate from a Run As account to Managed Identities
12
+
13
+
> [!IMPORTANT]
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. For more information, see [migrating from an existing Run As accounts to managed identity](/articles/automation/automation-managed-identity-faq.md).
15
+
> - Delaying the feature has a direct impact on our support burden, as it would cause upgrades of mobility agent to fail.
16
+
17
+
This article shows you how to migrate your runbooks to use a Managed Identities for Azure Site Recovery. 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
+
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.
20
+
21
+
## Prerequisites
22
+
23
+
Before you migrate from a Run As account to a managed identity, ensure that you have the appropriate roles to create a system-assigned identity for your automation account and to assign it the Contributor role in the corresponding recovery services vault.
24
+
25
+
## Benefits of managed identities
26
+
27
+
Here are some of the benefits of using managed identities:
28
+
29
+
-**Credentials access** - You don't need to manage credentials.
30
+
-**Simplified authentication** - You can use managed identities to authenticate to any resource that supports Azure AD authentication including your own applications.
31
+
-**Cost effective** - Managed identities can be used at no extra cost.
32
+
-**Double encryption** - Managed identity is also used to encrypt/decrypt data and metadata using the customer-managed key stored in Azure Key Vault, providing double encryption.
33
+
34
+
> [!NOTE]
35
+
> Managed identities for Azure resources is the new name for the service formerly known as Managed Service Identity (MSI).
36
+
37
+
## Migrate from an existing Run As account to a managed identity
38
+
39
+
### Configure managed identities
40
+
41
+
You can configure your managed identities through:
42
+
43
+
- Azure portal
44
+
- Azure CLI
45
+
- your Azure Resource Manager (ARM) template
46
+
47
+
> [!NOTE]
48
+
> 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
+
50
+
51
+
### From Azure portal
52
+
53
+
**To migrate your Azure Automation account authentication type from a Run As to a managed identity authentication, follow these steps:**
54
+
55
+
1. In the [Azure portal](https://portal.azure.com), select the recovery services vault for which you want to migrate the runbooks.
56
+
57
+
1. On the homepage of your recovery services vault page, do the following:
58
+
1. On the left pane, under **Manage**, select **Site Recovery infrastructure**.
59
+
:::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.":::
60
+
1. Under **For Azure virtual machines**, select **Extension update settings**.
61
+
This page details the authentication type for the automation account that is being used to manage the Site Recovery extensions.
62
+
63
+
1. On this page, select **Migrate** to migrate the authentication type for your automation accounts to use Managed Identities.
64
+
65
+
:::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.":::
66
+
67
+
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.
68
+
69
+
When you successfully migrate from a Run As to a Managed Identities account, the following changes are reflected on the Automation Run As Accounts :
70
+
71
+
- System Assigned Managed Identity is enabled for the account (if not already enabled).
72
+
- The **Contributor** role permission is assigned to the Recovery Services vault’s subscription.
73
+
- The script that updates the mobility agent to use Managed Identity based authentication is updated.
74
+
75
+
76
+
### Link an existing managed identity account to vault
77
+
78
+
To link an existing managed identity Automation account to your Recovery Services vault. Follow these steps:
79
+
80
+
#### Enable the managed identity for the vault
81
+
82
+
1. Go to the automation account that you have selected. Under **Account settings**, select **Identity**.
83
+
84
+
:::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.":::
85
+
86
+
1. Under the **System assigned**, change the **Status** to **On** and select **Save**.
87
+
88
+
An Object ID is generated. The vault is now registered with Azure Active
89
+
Directory.
90
+
:::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.":::
91
+
92
+
1. Go back to your recovery services vault. On the left pane, select the **Access control (IAM)** option.
93
+
:::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.":::
94
+
1. Select **Add** > **Add role assignment** > **Contributor** to open the **Add role assignment** page.
95
+
1. On the **Add role assignment** page, ensure to select **Managed identity**.
96
+
1. Select the **Select members**. In the **Select managed identities** pane, do the following:
97
+
1. In the **Select** field, enter the name of the managed identity automation account.
98
+
1. In the **Managed identity** field, select **All system-assigned managed identities**.
-[Implementing managed identities for Microsoft Azure Resources](https://www.pluralsight.com/courses/microsoft-azure-resources-managed-identities-implementing).
0 commit comments