Skip to content

Commit 625994a

Browse files
Merge pull request #302383 from ADOYLEMSFT/main
address 30509361
2 parents dfe2e2f + d76e517 commit 625994a

File tree

1 file changed

+7
-38
lines changed

1 file changed

+7
-38
lines changed

articles/automation/automation-use-azure-ad.md

Lines changed: 7 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
title: Use Microsoft Entra ID in Azure Automation to authenticate to Azure
33
description: This article tells how to use Microsoft Entra ID within Azure Automation as the provider for authentication to Azure.
44
services: automation
5-
ms.date: 09/09/2024
5+
ms.date: 07/08/2025
66
ms.topic: how-to
77
ms.custom: devx-track-azurepowershell, no-azure-ad-ps-ref
88
ms.author: v-jasmineme
@@ -19,44 +19,10 @@ The [Microsoft Entra ID](../active-directory/fundamentals/active-directory-whati
1919

2020
You can enable Microsoft Entra ID through the following PowerShell modules:
2121

22-
* Azure Active Directory PowerShell for Graph (AzureRM and Az modules). Azure Automation ships with the AzureRM module and its recent upgrade, the Az module. Functionality includes non-interactive authentication to Azure using Microsoft Entra user (OrgId) credential-based authentication. See [Microsoft Entra ID 2.0.2.76](https://www.powershellgallery.com/packages/AzureAD/2.0.2.76).
22+
* Azure Active Directory PowerShell for Graph. Azure Automation ships with the Az module. Functionality includes non-interactive authentication to Azure using Microsoft Entra user (OrgId) credential-based authentication. See [Azure AD 2.0.2.182](https://www.powershellgallery.com/packages/AzureAD/2.0.2.182).
2323

2424
* Microsoft Entra ID for Windows PowerShell. This module enables interactions with Microsoft Online, including Microsoft 365.
2525

26-
### Preinstallation
27-
28-
Before installing the Microsoft Entra modules on your computer:
29-
30-
* Uninstall any previous versions of the AzureRM/Az module and the retired MSOnline module.
31-
32-
* Uninstall the Microsoft Online Services Sign-In Assistant to ensure correct operation of the new PowerShell modules.
33-
34-
### Install the AzureRM and Az modules
35-
36-
>[!NOTE]
37-
>To work with these modules, you must use PowerShell version 5.1 or later with a 64-bit version of Windows.
38-
39-
1. Install Windows Management Framework (WMF) 5.1. See [Install and Configure WMF 5.1](/powershell/scripting/wmf/setup/install-configure).
40-
41-
2. Install AzureRM and/or Az using instructions in [Install Azure PowerShell on Windows with PowerShellGet](/powershell/azure/install-azure-powershell).
42-
43-
### Install the module
44-
45-
>[!NOTE]
46-
>To install the module, you must be a member of an admin role. See [About admin roles](/microsoft-365/admin/add-users/about-admin-roles).
47-
48-
1. Ensure that the Microsoft .NET Framework 3.5.x feature is enabled on your computer. It's likely that your computer has a newer version installed, but backward compatibility with older versions of the .NET Framework can be enabled or disabled.
49-
50-
2. Install the 64-bit version of the [Microsoft Online Services Sign-in Assistant](/microsoft-365/enterprise/connect-to-microsoft-365-powershell?view=o365-worldwide&preserve-view=true#step-1-install-the-required-software-1).
51-
52-
3. Run Windows PowerShell as an administrator to create an elevated Windows PowerShell command prompt.
53-
54-
4. Deploy Microsoft Entra ID from [Microsoft.Entra](https://www.powershellgallery.com/packages/Microsoft.Entra/1.0.4).
55-
56-
5. If you're prompted to install the NuGet provider, type Y and press ENTER.
57-
58-
6. If you're prompted to install the module from [PSGallery](https://www.powershellgallery.com/), type Y and press ENTER.
59-
6026
### Install support for PSCredential
6127

6228
Azure Automation uses the [PSCredential](/dotnet/api/system.management.automation.pscredential) class to represent a credential asset. Your scripts retrieve `PSCredential` objects using the `Get-AutomationPSCredential` cmdlet. For more information, see [Credential assets in Azure Automation](shared-resources/credentials.md).
@@ -94,13 +60,12 @@ You can use the Azure portal to create the credential asset. Do this operation f
9460
To prepare a new credential asset in Windows PowerShell, your script first creates a `PSCredential` object using the assigned user name and password. The script then uses this object to create the asset through a call to the [New-AzureAutomationCredential](/powershell/module/servicemanagement/azure/new-azureautomationcredential) cmdlet. Alternatively, the script can call the [Get-Credential](/powershell/module/microsoft.powershell.security/get-credential) cmdlet to prompt the user to type in a name and password. See [Credential assets in Azure Automation](shared-resources/credentials.md).
9561

9662

97-
9863
## Manage Azure resources from an Azure Automation runbook
9964

10065
You can manage Azure resources from Azure Automation runbooks using the credential asset. Below is an example PowerShell runbook that collects the credential asset to use for stopping and starting virtual machines in an Azure subscription. This runbook first uses `Get-AutomationPSCredential` to retrieve the credential to use to authenticate to Azure. It then calls the [Connect-AzAccount](/powershell/module/az.accounts/connect-azaccount) cmdlet to connect to Azure using the credential.
10166

10267
```powershell
103-
Workflow Workflow
68+
Workflow Workflowname
10469
{
10570
Param
10671
(
@@ -173,6 +138,10 @@ Workflow Workflow
173138
}
174139
```
175140

141+
## Using Microsoft Graph with Powershell
142+
143+
See [Get started with the Microsoft Graph PowerShell SDK](https://learn.microsoft.com/powershell/microsoftgraph/get-started?view=graph-powershell-1.0)
144+
176145
## Next steps
177146

178147
* For details of credential use, see [Manage credentials in Azure Automation](shared-resources/credentials.md).

0 commit comments

Comments
 (0)