Skip to content

Commit 8ba94b9

Browse files
committed
feedback incorporated
1 parent 4b1c3dc commit 8ba94b9

File tree

2 files changed

+46
-48
lines changed

2 files changed

+46
-48
lines changed

articles/automation/automation-managed-identity-faq.md

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ The following FAQ can help you migrate from a Run As account to a Managed identi
1515

1616
## How long will you support a Run As account?
1717

18-
Automation Run As accounts will be supported until *30 September 2023*. Moreover, starting 01 April 2023, creation of **new** Run As accounts in Azure Automation isn't possible. Renewing of certificates for existing Run As accounts would be possible only till the end of support.
18+
Automation Run As accounts will be supported until *30 September 2023*. Moreover, starting 01 April 2023, creation of **new** Run As accounts in Azure Automation will not be possible. Renewing of certificates for existing Run As accounts would be possible only till the end of support.
1919

2020
## Will existing runbooks that use the Run As account be able to authenticate?
2121
Yes, they'll be able to authenticate. There will be no impact to existing runbooks that use a Run As account. After 30 September 2023, all runbook executions using RunAs accounts, including Classic Run As accounts wouldn't be supported. Hence, you must migrate all runbooks to use Managed identities before that date.
@@ -50,9 +50,6 @@ Run As accounts also have a management overhead that involves creating a service
5050
## Can a managed identity be used for both cloud and hybrid jobs?
5151
Azure Automation supports [system-assigned managed identities](./automation-security-overview.md#managed-identities) for both cloud and hybrid jobs. Currently, Azure Automation [user-assigned managed identities](./automation-security-overview.md) can be used for cloud jobs only and can't be used for jobs that run on a hybrid worker.
5252

53-
## Can I use a Run As account for new Automation account?
54-
Yes, but only in a scenario where managed identities aren't supported for specific on-premises resources. We'll allow the creation of a Run As account through a [PowerShell script](./create-run-as-account.md#create-account-using-powershell).
55-
5653
## How can I migrate from an existing Run As account to a managed identity?
5754
Follow the steps in [Migrate an existing Run As account to a managed identity](./migrate-run-as-accounts-managed-identity.md).
5855

articles/automation/migrate-run-as-accounts-managed-identity.md

Lines changed: 45 additions & 44 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ ms.custom: devx-track-azurepowershell
1111
# Migrate from an existing Run As account to Managed identities
1212

1313
> [!IMPORTANT]
14-
> Azure Automation Run As accounts will retire on *30 September 2023* and completely move to [Managed Identities](automation-security-overview.md#managed-identities). All runbook executions using RunAs accounts, including Classic Run As accounts wouldn't be supported after this date. Starting 01 April 2023, the creation of **new** Run As accounts in Azure Automation isn't possible.
14+
> Azure Automation Run As accounts will retire on *30 September 2023* and completely move to [Managed Identities](automation-security-overview.md#managed-identities). All runbook executions using RunAs accounts, including Classic Run As accounts wouldn't be supported after this date. Starting 01 April 2023, the creation of **new** Run As accounts in Azure Automation will not be possible.
1515
1616
For more information about migration cadence and the support timeline for Run As account creation and certificate renewal, see the [frequently asked questions](automation-managed-identity-faq.md).
1717

@@ -39,6 +39,7 @@ Before you migrate from a Run As account or Classic Run As account to a managed
3939
For example, if the Automation account is required only to start or stop an Azure VM, then the permissions assigned to the Run As account need to be only for starting or stopping the VM. Similarly, assign read-only permissions if a runbook is reading from Azure Blob Storage. For more information, see [Azure Automation security guidelines](../automation/automation-security-guidelines.md#authentication-certificate-and-identities).
4040

4141
1. If you're using Classic Run As accounts, ensure that you have [migrated](../virtual-machines/classic-vm-deprecation.md) resources deployed through classic deployment model to Azure Resource Manager.
42+
1. Use [this script](https://github.com/azureautomation/runbooks/blob/master/Utility/AzRunAs/Check-AutomationRunAsAccountRoleAssignments.ps1) to find out which Automation accounts are using a Run As account. If your Azure Automation accounts contain a Run As account, it will have the built-in contributor role assigned to it by default. You can use the script to check the Azure Automation Run As accounts and determine if their role assignment is the default one or if it has been changed to a different role definition.
4243

4344
## Migrate from an Automation Run As account to a managed identity
4445

@@ -59,49 +60,7 @@ To migrate from an Automation Run As account or Classic Run As account to a mana
5960

6061
## Sample scripts
6162

62-
The following examples of runbook scripts fetch the Resource Manager resources by using the Run As account (service principal) and the managed identity.
63-
64-
# [Run As account](#tab/run-as-account)
65-
66-
```powershell-interactive
67-
$connectionName = "AzureRunAsConnection"
68-
try
69-
{
70-
# Get the connection "AzureRunAsConnection"
71-
$servicePrincipalConnection=Get-AutomationConnection -Name $connectionName
72-
73-
"Logging in to Azure..."
74-
Add-AzureRmAccount `
75-
-ServicePrincipal `
76-
-TenantId $servicePrincipalConnection.TenantId `
77-
-ApplicationId $servicePrincipalConnection.ApplicationId `
78-
-CertificateThumbprint $servicePrincipalConnection.CertificateThumbprint
79-
}
80-
catch {
81-
if (!$servicePrincipalConnection)
82-
{
83-
$ErrorMessage = "Connection $connectionName not found."
84-
throw $ErrorMessage
85-
} else{
86-
Write-Error -Message $_.Exception
87-
throw $_.Exception
88-
}
89-
}
90-
91-
#Get all Resource Manager resources from all resource groups
92-
$ResourceGroups = Get-AzureRmResourceGroup
93-
94-
foreach ($ResourceGroup in $ResourceGroups)
95-
{
96-
Write-Output ("Showing resources in resource group " + $ResourceGroup.ResourceGroupName)
97-
$Resources = Find-AzureRmResource -ResourceGroupNameContains $ResourceGroup.ResourceGroupName | Select ResourceName, ResourceType
98-
ForEach ($Resource in $Resources)
99-
{
100-
Write-Output ($Resource.ResourceName + " of type " + $Resource.ResourceType)
101-
}
102-
Write-Output ("")
103-
}
104-
```
63+
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.
10564

10665
# [System-assigned managed identity](#tab/sa-managed-identity)
10766

@@ -161,6 +120,48 @@ foreach ($ResourceGroup in $ResourceGroups)
161120
Write-Output ("")
162121
}
163122
```
123+
# [Run As account](#tab/run-as-account)
124+
125+
```powershell-interactive
126+
$connectionName = "AzureRunAsConnection"
127+
try
128+
{
129+
# Get the connection "AzureRunAsConnection"
130+
$servicePrincipalConnection=Get-AutomationConnection -Name $connectionName
131+
132+
"Logging in to Azure..."
133+
Add-AzureRmAccount `
134+
-ServicePrincipal `
135+
-TenantId $servicePrincipalConnection.TenantId `
136+
-ApplicationId $servicePrincipalConnection.ApplicationId `
137+
-CertificateThumbprint $servicePrincipalConnection.CertificateThumbprint
138+
}
139+
catch {
140+
if (!$servicePrincipalConnection)
141+
{
142+
$ErrorMessage = "Connection $connectionName not found."
143+
throw $ErrorMessage
144+
} else{
145+
Write-Error -Message $_.Exception
146+
throw $_.Exception
147+
}
148+
}
149+
150+
#Get all Resource Manager resources from all resource groups
151+
$ResourceGroups = Get-AzureRmResourceGroup
152+
153+
foreach ($ResourceGroup in $ResourceGroups)
154+
{
155+
Write-Output ("Showing resources in resource group " + $ResourceGroup.ResourceGroupName)
156+
$Resources = Find-AzureRmResource -ResourceGroupNameContains $ResourceGroup.ResourceGroupName | Select ResourceName, ResourceType
157+
ForEach ($Resource in $Resources)
158+
{
159+
Write-Output ($Resource.ResourceName + " of type " + $Resource.ResourceType)
160+
}
161+
Write-Output ("")
162+
}
163+
```
164+
164165
---
165166

166167
## Graphical runbooks

0 commit comments

Comments
 (0)