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/automation/learn/powershell-runbook-managed-identity.md
+19-11Lines changed: 19 additions & 11 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,10 +1,10 @@
1
1
---
2
-
title: Create PowerShell runbook using managed identity in Azure Automation
2
+
title: Create PowerShell Runbook Using Managed Identity in Azure Automation
3
3
description: In this tutorial, you learn how to use managed identities with a PowerShell runbook in Azure Automation.
4
4
services: automation
5
5
ms.subservice: process-automation
6
6
ms.custom: devx-track-azurepowershell
7
-
ms.date: 11/24/2021
7
+
ms.date: 06/27/2025
8
8
ms.topic: tutorial
9
9
#Customer intent: As a developer, I want PowerShell runbooks to execute code using a manged identity.
10
10
ms.service: azure-automation
@@ -14,7 +14,7 @@ author: jasminemehndir
14
14
15
15
# Tutorial: Create Automation PowerShell runbook using managed identity
16
16
17
-
This tutorial walks you through creating a [PowerShell runbook](../automation-runbook-types.md#powershell-runbooks) in Azure Automation that uses a [managed identity](../automation-security-overview.md#managed-identities), rather than the Run As account to interact with resources. PowerShell runbooks are based on Windows PowerShell. A managed identity from Microsoft Entra ID allows your runbook to easily access other Microsoft Entra protected resources.
17
+
This tutorial walks you through creating a [PowerShell runbook](../automation-runbook-types.md#powershell-runbooks) in Azure Automation that uses a [managed identity](../automation-security-overview.md#managed-identities) to interact with resources. PowerShell runbooks are based on Windows PowerShell. A managed identity from Microsoft Entra ID allows your runbook to easily access other Microsoft Entra protected resources.
18
18
19
19
In this tutorial, you learn how to:
20
20
@@ -26,6 +26,8 @@ If you don't have an Azure subscription, create a [free account](https://azure.m
26
26
27
27
## Prerequisites
28
28
29
+
Before you assign permissions to managed identities, ensure you meet these prerequisites:
30
+
29
31
* An Azure Automation account with at least one user-assigned managed identity. For more information, see [Using a user-assigned managed identity for an Azure Automation account](../add-user-assigned-identity.md).
30
32
* Az modules: `Az.Accounts`, `Az.Automation`, `Az.ManagedServiceIdentity`, and `Az.Compute` imported into the Automation account. For more information, see [Import Az modules](../shared-resources/modules.md#import-az-modules).
31
33
* The [Azure Az PowerShell module](/powershell/azure/new-azureps-module-az) installed on your machine. To install or upgrade, see [How to install the Azure Az PowerShell module](/powershell/azure/install-azure-powershell). `Az.ManagedServiceIdentity` is a preview module and not installed as part of the Az module. To install it, run `Install-Module -Name Az.ManagedServiceIdentity`.
@@ -36,7 +38,9 @@ If you don't have an Azure subscription, create a [free account](https://azure.m
36
38
37
39
Assign permissions to the managed identities to allow them to stop and start a virtual machine.
38
40
39
-
1. Sign in to Azure interactively using the [Connect-AzAccount](/powershell/module/az.accounts/connect-azaccount) cmdlet and follow the instructions.
41
+
To assign permissions to managed identities, follow these steps:
42
+
43
+
1. Sign in to Azure interactively using the [Connect-AzAccount](/powershell/module/az.accounts/connect-azaccount) cmdlet and follow the instructions:
40
44
41
45
```powershell
42
46
# Sign in to your Azure subscription
@@ -49,7 +53,7 @@ Assign permissions to the managed identities to allow them to stop and start a v
0 commit comments