{"id":53585,"date":"2025-08-08T15:54:17","date_gmt":"2025-08-08T05:54:17","guid":{"rendered":"https:\/\/www.cloudproinc.com.au\/?p=53585"},"modified":"2025-08-08T15:54:20","modified_gmt":"2025-08-08T05:54:20","slug":"use-azure-managed-identity-with-azure-automation-powershell","status":"publish","type":"post","link":"https:\/\/www.cloudproinc.com.au\/index.php\/2025\/08\/08\/use-azure-managed-identity-with-azure-automation-powershell\/","title":{"rendered":"Use Azure Managed Identity with Azure Automation PowerShell"},"content":{"rendered":"\n<p>When running scripts in <strong>Azure Automation<\/strong>, authentication is often the trickiest part. Your runbooks might need to connect to Azure services, Microsoft Graph, or other APIs \u2014 and that means handling credentials securely. In this guide, <em>Use Azure Managed Identity with Azure Automation PowerShell<\/em>, we\u2019ll focus specifically on <strong>User-assigned Managed Identity (UAMI)<\/strong>, a secure, reusable, and passwordless way to authenticate your automation scripts without managing secrets or dealing with service principal key rotation.<\/p>\n\n\n\n<!--more-->\n\n\n\n<div class=\"wp-block-yoast-seo-table-of-contents yoast-table-of-contents\"><h2>Table of contents<\/h2><ul><li><a href=\"#h-what-is-a-user-assigned-managed-identity\" data-level=\"2\">What is a User-assigned Managed Identity?<\/a><\/li><li><a href=\"#h-why-uami-instead-of-app-registration-with-secrets\" data-level=\"2\">Why UAMI Instead of App Registration with Secrets?<\/a><\/li><li><a href=\"#h-step-1-create-a-user-assigned-managed-identity\" data-level=\"2\">Step 1: Create a User-assigned Managed Identity<\/a><\/li><li><a href=\"#h-step-2-assign-permissions-to-the-uami\" data-level=\"2\">Step 2: Assign Permissions to the UAMI<\/a><\/li><li><a href=\"#h-step-3-assign-the-uami-to-your-automation-account\" data-level=\"2\">Step 3: Assign the UAMI to Your Automation Account<\/a><\/li><li><a href=\"#h-step-4-authenticate-with-uami-in-powershell\" data-level=\"2\">Step 4: Authenticate with UAMI in PowerShell<\/a><\/li><\/ul><\/div>\n\n\n\n<p>While you can use <strong>App Registrations<\/strong> with secrets or <strong>System-assigned Managed Identities (SAMI)<\/strong>, many enterprise scenarios benefit from <strong>User-assigned Managed Identities (UAMI)<\/strong>. UAMI offers flexibility, reusability, and security \u2014 making it ideal for shared automation environments.<\/p>\n\n\n\n<p>In this post, we\u2019ll cover:<\/p>\n\n\n\n<ol class=\"wp-block-list\">\n<li>What a User-assigned Managed Identity is<\/li>\n\n\n\n<li>Why you might choose UAMI over SAMI or App Registration with secrets<\/li>\n\n\n\n<li>How to create and assign a UAMI<\/li>\n\n\n\n<li>How to use it in an Azure Automation PowerShell runbook<\/li>\n\n\n\n<li>Common pitfalls and best practices<\/li>\n<\/ol>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"h-what-is-a-user-assigned-managed-identity\">What is a User-assigned Managed Identity?<\/h2>\n\n\n\n<p>A <strong>User-assigned Managed Identity<\/strong> is an Azure resource that has its own identity in Microsoft Entra ID (Azure AD). Unlike a <strong>System-assigned MI<\/strong>, which is tied to a single resource\u2019s lifecycle, a UAMI:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Exists independently of any one resource<\/li>\n\n\n\n<li>Can be assigned to multiple resources (Automation accounts, VMs, Functions, etc.)<\/li>\n\n\n\n<li>Retains its permissions even if one resource is deleted<\/li>\n<\/ul>\n\n\n\n<p>This makes it perfect when:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>You need <strong>consistent credentials across multiple Automation accounts<\/strong><\/li>\n\n\n\n<li>You want to <strong>separate identity lifecycle from the Automation account\u2019s lifecycle<\/strong><\/li>\n\n\n\n<li>You\u2019re running automation for <strong>multiple subscriptions or tenants<\/strong><\/li>\n<\/ul>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"h-why-uami-instead-of-app-registration-with-secrets\">Why UAMI Instead of App Registration with Secrets?<\/h2>\n\n\n\n<p>Before Managed Identity, the common approach was:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Create an <strong>App Registration<\/strong> in Entra ID<\/li>\n\n\n\n<li>Create a <strong>client secret<\/strong><\/li>\n\n\n\n<li>Store it securely (e.g., in Key Vault or Automation variables)<\/li>\n\n\n\n<li>Rotate it regularly<\/li>\n<\/ul>\n\n\n\n<p>While functional, this approach has several issues:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li><strong>Secret rotation overhead<\/strong> \u2014 secrets expire and must be updated everywhere<\/li>\n\n\n\n<li><strong>Storage complexity<\/strong> \u2014 secrets must be stored and retrieved securely<\/li>\n\n\n\n<li><strong>Security risk<\/strong> \u2014 accidental exposure in logs or code<\/li>\n<\/ul>\n\n\n\n<p><strong>With UAMI, you get:<\/strong><\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li><strong>Passwordless authentication<\/strong> \u2014 no secrets to manage<\/li>\n\n\n\n<li><strong>Automatic credential rotation<\/strong> \u2014 Azure handles it<\/li>\n\n\n\n<li><strong>Centralized permissions<\/strong> \u2014 one identity to manage across services<\/li>\n\n\n\n<li><strong>Resource reusability<\/strong> \u2014 same identity can be attached to multiple resources<\/li>\n<\/ul>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"h-step-1-create-a-user-assigned-managed-identity\">Step 1: Create a User-assigned Managed Identity<\/h2>\n\n\n\n<ol class=\"wp-block-list\">\n<li>In the <strong>Azure portal<\/strong>, search for <strong>Managed Identities<\/strong>.<\/li>\n\n\n\n<li>Click <strong>Create<\/strong>.<\/li>\n\n\n\n<li>Choose your <strong>Subscription<\/strong> and <strong>Resource Group<\/strong>.<\/li>\n\n\n\n<li>Enter a <strong>Name<\/strong> (e.g., <code>AutomationUAMI<\/code>).<\/li>\n\n\n\n<li>Select a <strong>Region<\/strong> \u2014 ideally the same as your Automation account.<\/li>\n\n\n\n<li>Click <strong>Review + Create<\/strong>, then <strong>Create<\/strong>.<\/li>\n<\/ol>\n\n\n\n<figure class=\"wp-block-image size-full\"><img decoding=\"async\" width=\"732\" height=\"342\" data-src=\"\/wp-content\/uploads\/2025\/08\/image-4.png\" alt=\"\" class=\"wp-image-53586 lazyload\" data-srcset=\"\/wp-content\/uploads\/2025\/08\/image-4.png 732w, \/wp-content\/uploads\/2025\/08\/image-4-300x140.png 300w, \/wp-content\/uploads\/2025\/08\/image-4-480x224.png 480w\" data-sizes=\"(max-width: 732px) 100vw, 732px\" src=\"data:image\/svg+xml;base64,PHN2ZyB3aWR0aD0iMSIgaGVpZ2h0PSIxIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciPjwvc3ZnPg==\" style=\"--smush-placeholder-width: 732px; --smush-placeholder-aspect-ratio: 732\/342;\" \/><\/figure>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"h-step-2-assign-permissions-to-the-uami\">Step 2: Assign Permissions to the UAMI<\/h2>\n\n\n\n<p>UAMI starts with no permissions. You must grant access based on what your runbook needs.<\/p>\n\n\n\n<p>Example: Assign Contributor role at the Resource Group level:<\/p>\n\n\n\n<ol class=\"wp-block-list\">\n<li>Go to the resource group or subscription you want to manage.<\/li>\n\n\n\n<li>Select <strong>Access control (IAM)<\/strong> \u2192 <strong>Add role assignment<\/strong>.<\/li>\n\n\n\n<li>Select the role (<code>Contributor<\/code>, <code>Reader<\/code>, <code>Key Vault Secrets User<\/code>, etc.).<\/li>\n\n\n\n<li>On the <strong>Members<\/strong> tab, choose <strong>Managed identity<\/strong> \u2192 <strong>User-assigned managed identity<\/strong>.<\/li>\n\n\n\n<li>Select your UAMI and click <strong>Review + Assign<\/strong>.<\/li>\n<\/ol>\n\n\n\n<figure class=\"wp-block-image size-full\"><img decoding=\"async\" width=\"943\" height=\"91\" data-src=\"\/wp-content\/uploads\/2025\/08\/image-5.png\" alt=\"\" class=\"wp-image-53587 lazyload\" data-srcset=\"\/wp-content\/uploads\/2025\/08\/image-5.png 943w, \/wp-content\/uploads\/2025\/08\/image-5-300x29.png 300w, \/wp-content\/uploads\/2025\/08\/image-5-768x74.png 768w, \/wp-content\/uploads\/2025\/08\/image-5-480x46.png 480w\" data-sizes=\"(max-width: 943px) 100vw, 943px\" src=\"data:image\/svg+xml;base64,PHN2ZyB3aWR0aD0iMSIgaGVpZ2h0PSIxIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciPjwvc3ZnPg==\" style=\"--smush-placeholder-width: 943px; --smush-placeholder-aspect-ratio: 943\/91;\" \/><\/figure>\n\n\n\n<p>If using Microsoft Graph, you must:<\/p>\n\n\n\n<ol class=\"wp-block-list\">\n<li>Go to <strong>Entra ID \u2192 Enterprise Applications<\/strong>.<\/li>\n\n\n\n<li>Find your UAMI by name.<\/li>\n\n\n\n<li>Assign API permissions (e.g., <code>User.Read.All<\/code> for reading users).<\/li>\n\n\n\n<li>Grant <strong>Admin consent<\/strong>.<\/li>\n<\/ol>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"h-step-3-assign-the-uami-to-your-automation-account\">Step 3: Assign the UAMI to Your Automation Account<\/h2>\n\n\n\n<ol class=\"wp-block-list\">\n<li>Open your <strong>Automation Account<\/strong> in Azure.<\/li>\n\n\n\n<li>In the left menu, click <strong>Identity<\/strong>.<\/li>\n\n\n\n<li>Under <strong>User-assigned<\/strong>, click <strong>+ Add<\/strong>.<\/li>\n\n\n\n<li>Select your UAMI and click <strong>Add<\/strong>.<\/li>\n<\/ol>\n\n\n\n<p>Your Automation account now has access to authenticate as that UAMI.<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img decoding=\"async\" width=\"676\" height=\"222\" data-src=\"\/wp-content\/uploads\/2025\/08\/image-6.png\" alt=\"\" class=\"wp-image-53588 lazyload\" data-srcset=\"\/wp-content\/uploads\/2025\/08\/image-6.png 676w, \/wp-content\/uploads\/2025\/08\/image-6-300x99.png 300w, \/wp-content\/uploads\/2025\/08\/image-6-480x158.png 480w\" data-sizes=\"(max-width: 676px) 100vw, 676px\" src=\"data:image\/svg+xml;base64,PHN2ZyB3aWR0aD0iMSIgaGVpZ2h0PSIxIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciPjwvc3ZnPg==\" style=\"--smush-placeholder-width: 676px; --smush-placeholder-aspect-ratio: 676\/222;\" \/><\/figure>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"h-step-4-authenticate-with-uami-in-powershell\">Step 4: Authenticate with UAMI in PowerShell<\/h2>\n\n\n\n<p>When running inside Azure Automation, you can connect using the UAMI\u2019s <strong>Client ID<\/strong>.<\/p>\n\n\n\n<p><strong>Example: Connect to Azure Resource Manager and restart a Web app<\/strong><\/p>\n\n\n\n<pre class=\"wp-block-code has-white-color has-black-background-color has-text-color has-background has-link-color wp-elements-056eb03a7080161b9d37e1af00e9c05d\"><code># Log in with managed identity (inside VM, App Service, etc.)\n$subscriptionID=\"SUBID\"\nConnect-AzAccount -Identity -AccountId \"UAMICLIENTID\" -Subscription \"SUBID\"\nSet-AzContext -Subscription $subscriptionID  \n# Restart a Web App\nRestart-AzWebApp -ResourceGroupName \"rgname\" -Name \"wepappname\" <\/code><\/pre>\n\n\n\n<h2 class=\"wp-block-heading\">Best Practices<\/h2>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Use <strong>least privilege RBAC<\/strong> \u2014 give the UAMI only the permissions needed.<\/li>\n\n\n\n<li>Use <strong>separate UAMIs<\/strong> for different environments (e.g., Dev, Test, Prod).<\/li>\n\n\n\n<li>Keep <strong>a naming convention<\/strong> for UAMIs to track usage.<\/li>\n\n\n\n<li>Prefer UAMI when multiple automation jobs need to share the same identity.<\/li>\n<\/ul>\n\n\n\n<h2 class=\"wp-block-heading\">Conclusion<\/h2>\n\n\n\n<p>A <strong>User-assigned Managed Identity<\/strong> offers flexibility, reusability, and security for Azure Automation authentication. Unlike System-assigned MI, it\u2019s not tied to the lifecycle of your Automation account, and unlike App Registrations, it doesn\u2019t require secret management.<\/p>\n\n\n\n<p>If your automation spans multiple resources, subscriptions, or even Automation accounts, UAMI is the most maintainable and secure option.<\/p>\n\n\n\n<ul class=\"wp-block-yoast-seo-related-links yoast-seo-related-links\">\n<li><a href=\"https:\/\/www.cloudproinc.com.au\/index.php\/2024\/08\/01\/automating-access-to-microsoft-graph-api-using-azure-pipelines\/\">Automating Access to Microsoft Graph API Using Azure Pipelines<\/a><\/li>\n\n\n\n<li><a href=\"https:\/\/www.cloudproinc.com.au\/index.php\/2024\/07\/25\/assigning-local-admins-to-windows-11-through-intune\/\">Assigning Local Admins to Windows 11 through Intune<\/a><\/li>\n\n\n\n<li><a href=\"https:\/\/cloudproinc.com.au\/index.php\/2025\/07\/08\/how-to-authenticate-to-azure-cli-with-a-service-principal\/\">How to Authenticate to Azure CLI with a Service Principal<\/a><\/li>\n\n\n\n<li><a href=\"https:\/\/www.cloudproinc.com.au\/index.php\/2024\/10\/11\/create-an-app-registration-for-microsoft-azure-sdk-for-net\/\">Create an App Registration for Microsoft Azure SDK for .NET<\/a><\/li>\n\n\n\n<li><a href=\"https:\/\/www.cloudproinc.com.au\/index.php\/wiz-security-deployment-services\/\">Wiz Security Deployment Services<\/a><\/li>\n<\/ul>\n","protected":false},"excerpt":{"rendered":"<p>When running scripts in Azure Automation, authentication is often the trickiest part. Your runbooks might need to connect to Azure services, Microsoft Graph, or other APIs \u2014 and that means handling credentials securely. In this guide, Use Azure Managed Identity with Azure Automation PowerShell, we\u2019ll focus specifically on User-assigned Managed Identity (UAMI), a secure, reusable, [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":53589,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_yoast_wpseo_focuskw":"Use Azure Managed Identity with Azure Automation PowerShell","_yoast_wpseo_title":"","_yoast_wpseo_metadesc":"Learn how to use Azure Managed Identity with Azure Automation PowerShell for secure authentication without managing secrets.","_yoast_wpseo_opengraph-title":"","_yoast_wpseo_opengraph-description":"","_yoast_wpseo_twitter-title":"","_yoast_wpseo_twitter-description":"","_et_pb_use_builder":"off","_et_pb_old_content":"","_et_gb_content_width":"","_jetpack_memberships_contains_paid_content":false,"footnotes":""},"categories":[16,20,13],"tags":[],"class_list":["post-53585","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-microsoft-azure","category-azure-powershell","category-blog"],"yoast_head":"<!-- This site is optimized with the Yoast SEO Premium plugin v27.3 (Yoast SEO v27.3) - https:\/\/yoast.com\/product\/yoast-seo-premium-wordpress\/ -->\n<title>Use Azure Managed Identity with Azure Automation PowerShell - CPI Consulting<\/title>\n<meta name=\"description\" content=\"Learn how to use Azure Managed Identity with Azure Automation PowerShell for secure authentication without managing secrets.\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.cloudproinc.com.au\/index.php\/2025\/08\/08\/use-azure-managed-identity-with-azure-automation-powershell\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Use Azure Managed Identity with Azure Automation PowerShell\" \/>\n<meta property=\"og:description\" content=\"Learn how to use Azure Managed Identity with Azure Automation PowerShell for secure authentication without managing secrets.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.cloudproinc.com.au\/index.php\/2025\/08\/08\/use-azure-managed-identity-with-azure-automation-powershell\/\" \/>\n<meta property=\"og:site_name\" content=\"CPI Consulting\" \/>\n<meta property=\"article:published_time\" content=\"2025-08-08T05:54:17+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2025-08-08T05:54:20+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/www.cloudproinc.com.au\/wp-content\/uploads\/2025\/08\/Use-Managed-Identity-Azure-Automation.png\" \/>\n\t<meta property=\"og:image:width\" content=\"1024\" \/>\n\t<meta property=\"og:image:height\" content=\"1024\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/png\" \/>\n<meta name=\"author\" content=\"CPI Staff\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"CPI Staff\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"4 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\\\/\\\/www.cloudproinc.com.au\\\/index.php\\\/2025\\\/08\\\/08\\\/use-azure-managed-identity-with-azure-automation-powershell\\\/#article\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.cloudproinc.com.au\\\/index.php\\\/2025\\\/08\\\/08\\\/use-azure-managed-identity-with-azure-automation-powershell\\\/\"},\"author\":{\"name\":\"CPI Staff\",\"@id\":\"https:\\\/\\\/www.cloudproinc.com.au\\\/#\\\/schema\\\/person\\\/192eeeb0ce91062126ce3822ae88fe6e\"},\"headline\":\"Use Azure Managed Identity with Azure Automation PowerShell\",\"datePublished\":\"2025-08-08T05:54:17+00:00\",\"dateModified\":\"2025-08-08T05:54:20+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\\\/\\\/www.cloudproinc.com.au\\\/index.php\\\/2025\\\/08\\\/08\\\/use-azure-managed-identity-with-azure-automation-powershell\\\/\"},\"wordCount\":766,\"commentCount\":0,\"publisher\":{\"@id\":\"https:\\\/\\\/www.cloudproinc.com.au\\\/#organization\"},\"image\":{\"@id\":\"https:\\\/\\\/www.cloudproinc.com.au\\\/index.php\\\/2025\\\/08\\\/08\\\/use-azure-managed-identity-with-azure-automation-powershell\\\/#primaryimage\"},\"thumbnailUrl\":\"\\\/wp-content\\\/uploads\\\/2025\\\/08\\\/Use-Managed-Identity-Azure-Automation.png\",\"articleSection\":[\"Azure\",\"Azure PowerShell\",\"Blog\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\\\/\\\/www.cloudproinc.com.au\\\/index.php\\\/2025\\\/08\\\/08\\\/use-azure-managed-identity-with-azure-automation-powershell\\\/#respond\"]}],\"accessibilityFeature\":[\"tableOfContents\"]},{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/www.cloudproinc.com.au\\\/index.php\\\/2025\\\/08\\\/08\\\/use-azure-managed-identity-with-azure-automation-powershell\\\/\",\"url\":\"https:\\\/\\\/www.cloudproinc.com.au\\\/index.php\\\/2025\\\/08\\\/08\\\/use-azure-managed-identity-with-azure-automation-powershell\\\/\",\"name\":\"Use Azure Managed Identity with Azure Automation PowerShell - CPI Consulting\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.cloudproinc.com.au\\\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\\\/\\\/www.cloudproinc.com.au\\\/index.php\\\/2025\\\/08\\\/08\\\/use-azure-managed-identity-with-azure-automation-powershell\\\/#primaryimage\"},\"image\":{\"@id\":\"https:\\\/\\\/www.cloudproinc.com.au\\\/index.php\\\/2025\\\/08\\\/08\\\/use-azure-managed-identity-with-azure-automation-powershell\\\/#primaryimage\"},\"thumbnailUrl\":\"\\\/wp-content\\\/uploads\\\/2025\\\/08\\\/Use-Managed-Identity-Azure-Automation.png\",\"datePublished\":\"2025-08-08T05:54:17+00:00\",\"dateModified\":\"2025-08-08T05:54:20+00:00\",\"description\":\"Learn how to use Azure Managed Identity with Azure Automation PowerShell for secure authentication without managing secrets.\",\"breadcrumb\":{\"@id\":\"https:\\\/\\\/www.cloudproinc.com.au\\\/index.php\\\/2025\\\/08\\\/08\\\/use-azure-managed-identity-with-azure-automation-powershell\\\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\\\/\\\/www.cloudproinc.com.au\\\/index.php\\\/2025\\\/08\\\/08\\\/use-azure-managed-identity-with-azure-automation-powershell\\\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/www.cloudproinc.com.au\\\/index.php\\\/2025\\\/08\\\/08\\\/use-azure-managed-identity-with-azure-automation-powershell\\\/#primaryimage\",\"url\":\"\\\/wp-content\\\/uploads\\\/2025\\\/08\\\/Use-Managed-Identity-Azure-Automation.png\",\"contentUrl\":\"\\\/wp-content\\\/uploads\\\/2025\\\/08\\\/Use-Managed-Identity-Azure-Automation.png\",\"width\":1024,\"height\":1024},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/www.cloudproinc.com.au\\\/index.php\\\/2025\\\/08\\\/08\\\/use-azure-managed-identity-with-azure-automation-powershell\\\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\\\/\\\/www.cloudproinc.com.au\\\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Use Azure Managed Identity with Azure Automation PowerShell\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\\\/\\\/www.cloudproinc.com.au\\\/#website\",\"url\":\"https:\\\/\\\/www.cloudproinc.com.au\\\/\",\"name\":\"Cloud Pro Inc - CPI Consulting Pty Ltd\",\"description\":\"Cloud, AI &amp; Cybersecurity Consulting | Melbourne\",\"publisher\":{\"@id\":\"https:\\\/\\\/www.cloudproinc.com.au\\\/#organization\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\\\/\\\/www.cloudproinc.com.au\\\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Organization\",\"@id\":\"https:\\\/\\\/www.cloudproinc.com.au\\\/#organization\",\"name\":\"Cloud Pro Inc - Cloud Pro Inc - CPI Consulting Pty Ltd\",\"url\":\"https:\\\/\\\/www.cloudproinc.com.au\\\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/www.cloudproinc.com.au\\\/#\\\/schema\\\/logo\\\/image\\\/\",\"url\":\"\\\/wp-content\\\/uploads\\\/2022\\\/01\\\/favfinalfile.png\",\"contentUrl\":\"\\\/wp-content\\\/uploads\\\/2022\\\/01\\\/favfinalfile.png\",\"width\":500,\"height\":500,\"caption\":\"Cloud Pro Inc - Cloud Pro Inc - CPI Consulting Pty Ltd\"},\"image\":{\"@id\":\"https:\\\/\\\/www.cloudproinc.com.au\\\/#\\\/schema\\\/logo\\\/image\\\/\"}},{\"@type\":\"Person\",\"@id\":\"https:\\\/\\\/www.cloudproinc.com.au\\\/#\\\/schema\\\/person\\\/192eeeb0ce91062126ce3822ae88fe6e\",\"name\":\"CPI Staff\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/2d96eeb53b791d92c8c50dd667e3beec92c93253bb6ff21c02cfa8ca73665c70?s=96&d=mm&r=g\",\"url\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/2d96eeb53b791d92c8c50dd667e3beec92c93253bb6ff21c02cfa8ca73665c70?s=96&d=mm&r=g\",\"contentUrl\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/2d96eeb53b791d92c8c50dd667e3beec92c93253bb6ff21c02cfa8ca73665c70?s=96&d=mm&r=g\",\"caption\":\"CPI Staff\"},\"sameAs\":[\"http:\\\/\\\/www.cloudproinc.com.au\"],\"url\":\"https:\\\/\\\/www.cloudproinc.com.au\\\/index.php\\\/author\\\/cpiadmin\\\/\"}]}<\/script>\n<!-- \/ Yoast SEO Premium plugin. -->","yoast_head_json":{"title":"Use Azure Managed Identity with Azure Automation PowerShell - CPI Consulting","description":"Learn how to use Azure Managed Identity with Azure Automation PowerShell for secure authentication without managing secrets.","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/www.cloudproinc.com.au\/index.php\/2025\/08\/08\/use-azure-managed-identity-with-azure-automation-powershell\/","og_locale":"en_US","og_type":"article","og_title":"Use Azure Managed Identity with Azure Automation PowerShell","og_description":"Learn how to use Azure Managed Identity with Azure Automation PowerShell for secure authentication without managing secrets.","og_url":"https:\/\/www.cloudproinc.com.au\/index.php\/2025\/08\/08\/use-azure-managed-identity-with-azure-automation-powershell\/","og_site_name":"CPI Consulting","article_published_time":"2025-08-08T05:54:17+00:00","article_modified_time":"2025-08-08T05:54:20+00:00","og_image":[{"width":1024,"height":1024,"url":"https:\/\/www.cloudproinc.com.au\/wp-content\/uploads\/2025\/08\/Use-Managed-Identity-Azure-Automation.png","type":"image\/png"}],"author":"CPI Staff","twitter_card":"summary_large_image","twitter_misc":{"Written by":"CPI Staff","Est. reading time":"4 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/www.cloudproinc.com.au\/index.php\/2025\/08\/08\/use-azure-managed-identity-with-azure-automation-powershell\/#article","isPartOf":{"@id":"https:\/\/www.cloudproinc.com.au\/index.php\/2025\/08\/08\/use-azure-managed-identity-with-azure-automation-powershell\/"},"author":{"name":"CPI Staff","@id":"https:\/\/www.cloudproinc.com.au\/#\/schema\/person\/192eeeb0ce91062126ce3822ae88fe6e"},"headline":"Use Azure Managed Identity with Azure Automation PowerShell","datePublished":"2025-08-08T05:54:17+00:00","dateModified":"2025-08-08T05:54:20+00:00","mainEntityOfPage":{"@id":"https:\/\/www.cloudproinc.com.au\/index.php\/2025\/08\/08\/use-azure-managed-identity-with-azure-automation-powershell\/"},"wordCount":766,"commentCount":0,"publisher":{"@id":"https:\/\/www.cloudproinc.com.au\/#organization"},"image":{"@id":"https:\/\/www.cloudproinc.com.au\/index.php\/2025\/08\/08\/use-azure-managed-identity-with-azure-automation-powershell\/#primaryimage"},"thumbnailUrl":"\/wp-content\/uploads\/2025\/08\/Use-Managed-Identity-Azure-Automation.png","articleSection":["Azure","Azure PowerShell","Blog"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/www.cloudproinc.com.au\/index.php\/2025\/08\/08\/use-azure-managed-identity-with-azure-automation-powershell\/#respond"]}],"accessibilityFeature":["tableOfContents"]},{"@type":"WebPage","@id":"https:\/\/www.cloudproinc.com.au\/index.php\/2025\/08\/08\/use-azure-managed-identity-with-azure-automation-powershell\/","url":"https:\/\/www.cloudproinc.com.au\/index.php\/2025\/08\/08\/use-azure-managed-identity-with-azure-automation-powershell\/","name":"Use Azure Managed Identity with Azure Automation PowerShell - CPI Consulting","isPartOf":{"@id":"https:\/\/www.cloudproinc.com.au\/#website"},"primaryImageOfPage":{"@id":"https:\/\/www.cloudproinc.com.au\/index.php\/2025\/08\/08\/use-azure-managed-identity-with-azure-automation-powershell\/#primaryimage"},"image":{"@id":"https:\/\/www.cloudproinc.com.au\/index.php\/2025\/08\/08\/use-azure-managed-identity-with-azure-automation-powershell\/#primaryimage"},"thumbnailUrl":"\/wp-content\/uploads\/2025\/08\/Use-Managed-Identity-Azure-Automation.png","datePublished":"2025-08-08T05:54:17+00:00","dateModified":"2025-08-08T05:54:20+00:00","description":"Learn how to use Azure Managed Identity with Azure Automation PowerShell for secure authentication without managing secrets.","breadcrumb":{"@id":"https:\/\/www.cloudproinc.com.au\/index.php\/2025\/08\/08\/use-azure-managed-identity-with-azure-automation-powershell\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.cloudproinc.com.au\/index.php\/2025\/08\/08\/use-azure-managed-identity-with-azure-automation-powershell\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.cloudproinc.com.au\/index.php\/2025\/08\/08\/use-azure-managed-identity-with-azure-automation-powershell\/#primaryimage","url":"\/wp-content\/uploads\/2025\/08\/Use-Managed-Identity-Azure-Automation.png","contentUrl":"\/wp-content\/uploads\/2025\/08\/Use-Managed-Identity-Azure-Automation.png","width":1024,"height":1024},{"@type":"BreadcrumbList","@id":"https:\/\/www.cloudproinc.com.au\/index.php\/2025\/08\/08\/use-azure-managed-identity-with-azure-automation-powershell\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/www.cloudproinc.com.au\/"},{"@type":"ListItem","position":2,"name":"Use Azure Managed Identity with Azure Automation PowerShell"}]},{"@type":"WebSite","@id":"https:\/\/www.cloudproinc.com.au\/#website","url":"https:\/\/www.cloudproinc.com.au\/","name":"Cloud Pro Inc - CPI Consulting Pty Ltd","description":"Cloud, AI &amp; Cybersecurity Consulting | Melbourne","publisher":{"@id":"https:\/\/www.cloudproinc.com.au\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.cloudproinc.com.au\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Organization","@id":"https:\/\/www.cloudproinc.com.au\/#organization","name":"Cloud Pro Inc - Cloud Pro Inc - CPI Consulting Pty Ltd","url":"https:\/\/www.cloudproinc.com.au\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.cloudproinc.com.au\/#\/schema\/logo\/image\/","url":"\/wp-content\/uploads\/2022\/01\/favfinalfile.png","contentUrl":"\/wp-content\/uploads\/2022\/01\/favfinalfile.png","width":500,"height":500,"caption":"Cloud Pro Inc - Cloud Pro Inc - CPI Consulting Pty Ltd"},"image":{"@id":"https:\/\/www.cloudproinc.com.au\/#\/schema\/logo\/image\/"}},{"@type":"Person","@id":"https:\/\/www.cloudproinc.com.au\/#\/schema\/person\/192eeeb0ce91062126ce3822ae88fe6e","name":"CPI Staff","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/secure.gravatar.com\/avatar\/2d96eeb53b791d92c8c50dd667e3beec92c93253bb6ff21c02cfa8ca73665c70?s=96&d=mm&r=g","url":"https:\/\/secure.gravatar.com\/avatar\/2d96eeb53b791d92c8c50dd667e3beec92c93253bb6ff21c02cfa8ca73665c70?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/2d96eeb53b791d92c8c50dd667e3beec92c93253bb6ff21c02cfa8ca73665c70?s=96&d=mm&r=g","caption":"CPI Staff"},"sameAs":["http:\/\/www.cloudproinc.com.au"],"url":"https:\/\/www.cloudproinc.com.au\/index.php\/author\/cpiadmin\/"}]}},"jetpack_featured_media_url":"\/wp-content\/uploads\/2025\/08\/Use-Managed-Identity-Azure-Automation.png","jetpack-related-posts":[{"id":492,"url":"https:\/\/www.cloudproinc.com.au\/index.php\/2024\/08\/01\/automating-access-to-microsoft-graph-api-using-azure-pipelines\/","url_meta":{"origin":53585,"position":0},"title":"Automating Access to Microsoft Graph API Using Azure Pipelines","author":"CPI Staff","date":"August 1, 2024","format":false,"excerpt":"This Azure DevOps pipelines article will show how we automate access to Microsoft Graph API using Azure DevOps pipelines. Azure pipelines is an Azure DevOps service that allows us to automate the deployment of applications, services and changes to cloud environments. Microsoft Graph API is the underlining API service that\u2026","rel":"","context":"In &quot;Azure devOps&quot;","block_context":{"text":"Azure devOps","link":"https:\/\/www.cloudproinc.com.au\/index.php\/category\/azure-devops\/"},"img":{"alt_text":"","src":"\/wp-content\/uploads\/2024\/08\/Automating-Access-to-Microsoft-Graph-Using-Azure-DevOps-Pipelines.webp","width":350,"height":200,"srcset":"\/wp-content\/uploads\/2024\/08\/Automating-Access-to-Microsoft-Graph-Using-Azure-DevOps-Pipelines.webp 1x, \/wp-content\/uploads\/2024\/08\/Automating-Access-to-Microsoft-Graph-Using-Azure-DevOps-Pipelines.webp 1.5x, \/wp-content\/uploads\/2024\/08\/Automating-Access-to-Microsoft-Graph-Using-Azure-DevOps-Pipelines.webp 2x, \/wp-content\/uploads\/2024\/08\/Automating-Access-to-Microsoft-Graph-Using-Azure-DevOps-Pipelines.webp 3x, \/wp-content\/uploads\/2024\/08\/Automating-Access-to-Microsoft-Graph-Using-Azure-DevOps-Pipelines.webp 4x"},"classes":[]},{"id":56770,"url":"https:\/\/www.cloudproinc.com.au\/index.php\/2025\/11\/05\/securely-use-managed-identity-in-production-and-azure-cli-locally\/","url_meta":{"origin":53585,"position":1},"title":"Securely use Managed Identity in Production and Azure CLI Locally","author":"CPI Staff","date":"November 5, 2025","format":false,"excerpt":"A clean pattern: Managed Identity in prod, Azure CLI for local dev. Practical steps, code, and gotchas to keep secrets out and developers productive.","rel":"","context":"In &quot;Azure&quot;","block_context":{"text":"Azure","link":"https:\/\/www.cloudproinc.com.au\/index.php\/category\/microsoft-azure\/"},"img":{"alt_text":"","src":"\/wp-content\/uploads\/2025\/11\/securely-use-managed-identity-in-production-and-azure-cli-locally.png","width":350,"height":200,"srcset":"\/wp-content\/uploads\/2025\/11\/securely-use-managed-identity-in-production-and-azure-cli-locally.png 1x, \/wp-content\/uploads\/2025\/11\/securely-use-managed-identity-in-production-and-azure-cli-locally.png 1.5x, \/wp-content\/uploads\/2025\/11\/securely-use-managed-identity-in-production-and-azure-cli-locally.png 2x, \/wp-content\/uploads\/2025\/11\/securely-use-managed-identity-in-production-and-azure-cli-locally.png 3x, \/wp-content\/uploads\/2025\/11\/securely-use-managed-identity-in-production-and-azure-cli-locally.png 4x"},"classes":[]},{"id":53428,"url":"https:\/\/www.cloudproinc.com.au\/index.php\/2025\/06\/30\/run-azure-powershell-cmdlets-using-docker-containers\/","url_meta":{"origin":53585,"position":2},"title":"Run Azure PowerShell cmdlets using Docker Containers","author":"CPI Staff","date":"June 30, 2025","format":false,"excerpt":"In this blog post, we\u2019ll show you how to run Azure PowerShell cmdlets using Docker containers. Table of contentsPrerequisitesPull the Azure PowerShell Docker ImageRun the Container and Connect to AzureRunning Scripts from Your Local Machine Azure PowerShell provides a familiar PowerShell interface to manage Azure resources and infrastructure. It enables\u2026","rel":"","context":"In &quot;Azure&quot;","block_context":{"text":"Azure","link":"https:\/\/www.cloudproinc.com.au\/index.php\/category\/microsoft-azure\/"},"img":{"alt_text":"","src":"\/wp-content\/uploads\/2025\/06\/run-auzre-powershell-using-docker.png","width":350,"height":200,"srcset":"\/wp-content\/uploads\/2025\/06\/run-auzre-powershell-using-docker.png 1x, \/wp-content\/uploads\/2025\/06\/run-auzre-powershell-using-docker.png 1.5x, \/wp-content\/uploads\/2025\/06\/run-auzre-powershell-using-docker.png 2x, \/wp-content\/uploads\/2025\/06\/run-auzre-powershell-using-docker.png 3x, \/wp-content\/uploads\/2025\/06\/run-auzre-powershell-using-docker.png 4x"},"classes":[]},{"id":53463,"url":"https:\/\/www.cloudproinc.com.au\/index.php\/2025\/07\/08\/how-to-authenticate-to-azure-cli-with-a-service-principal\/","url_meta":{"origin":53585,"position":3},"title":"How to Authenticate to Azure CLI with a Service Principal","author":"CPI Staff","date":"July 8, 2025","format":false,"excerpt":"In this blog post, we'll show you how to authenticate to Azure CLI with a Service Principal and login to Azure. Azure CLI is a command-line utility written in Python that allows users to manage Azure resources programmatically. It is widely used by DevOps engineers, developers, and IT professionals to\u2026","rel":"","context":"In &quot;Azure&quot;","block_context":{"text":"Azure","link":"https:\/\/www.cloudproinc.com.au\/index.php\/category\/microsoft-azure\/"},"img":{"alt_text":"","src":"\/wp-content\/uploads\/2024\/10\/Creating-a-Text-to-Speech-Power-App-Using-OpenAI-Whisper.webp","width":350,"height":200,"srcset":"\/wp-content\/uploads\/2024\/10\/Creating-a-Text-to-Speech-Power-App-Using-OpenAI-Whisper.webp 1x, \/wp-content\/uploads\/2024\/10\/Creating-a-Text-to-Speech-Power-App-Using-OpenAI-Whisper.webp 1.5x, \/wp-content\/uploads\/2024\/10\/Creating-a-Text-to-Speech-Power-App-Using-OpenAI-Whisper.webp 2x"},"classes":[]},{"id":56780,"url":"https:\/\/www.cloudproinc.com.au\/index.php\/2025\/11\/10\/security-best-practices-for-azure-ai-services\/","url_meta":{"origin":53585,"position":4},"title":"Security Best Practices for Azure AI Services","author":"CPI Staff","date":"November 10, 2025","format":false,"excerpt":"Practical, step-by-step guidance to secure Azure AI services end to end\u2014identity, networks, data, prompts, and monitoring\u2014so your teams can innovate confidently without exposing your organisation.","rel":"","context":"In &quot;Azure AI Services&quot;","block_context":{"text":"Azure AI Services","link":"https:\/\/www.cloudproinc.com.au\/index.php\/category\/azure-ai-services\/"},"img":{"alt_text":"","src":"\/wp-content\/uploads\/2025\/11\/security-best-practices-for-azure-ai-services-in-practice.png","width":350,"height":200,"srcset":"\/wp-content\/uploads\/2025\/11\/security-best-practices-for-azure-ai-services-in-practice.png 1x, \/wp-content\/uploads\/2025\/11\/security-best-practices-for-azure-ai-services-in-practice.png 1.5x, \/wp-content\/uploads\/2025\/11\/security-best-practices-for-azure-ai-services-in-practice.png 2x, \/wp-content\/uploads\/2025\/11\/security-best-practices-for-azure-ai-services-in-practice.png 3x, \/wp-content\/uploads\/2025\/11\/security-best-practices-for-azure-ai-services-in-practice.png 4x"},"classes":[]},{"id":369,"url":"https:\/\/www.cloudproinc.com.au\/index.php\/2024\/07\/11\/list-classic-azure-administrators-using-powershell-and-azure-rest-api\/","url_meta":{"origin":53585,"position":5},"title":"List Classic Azure Administrators Using PowerShell and Azure REST API","author":"CPI Staff","date":"July 11, 2024","format":false,"excerpt":"This Microsoft Azure article will show how to list classic Azure Administrators using PowerShell and Azure REST API. As an IT consultancy company that helps companies safeguard their Azure tenant, we perform many tenant assessments. As part of our identity and access review, we always check how many users have\u2026","rel":"","context":"In &quot;Azure&quot;","block_context":{"text":"Azure","link":"https:\/\/www.cloudproinc.com.au\/index.php\/category\/microsoft-azure\/"},"img":{"alt_text":"","src":"\/wp-content\/uploads\/2024\/07\/AzureAdmins.webp","width":350,"height":200,"srcset":"\/wp-content\/uploads\/2024\/07\/AzureAdmins.webp 1x, \/wp-content\/uploads\/2024\/07\/AzureAdmins.webp 1.5x, \/wp-content\/uploads\/2024\/07\/AzureAdmins.webp 2x, \/wp-content\/uploads\/2024\/07\/AzureAdmins.webp 3x, \/wp-content\/uploads\/2024\/07\/AzureAdmins.webp 4x"},"classes":[]}],"jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/www.cloudproinc.com.au\/index.php\/wp-json\/wp\/v2\/posts\/53585","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.cloudproinc.com.au\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.cloudproinc.com.au\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.cloudproinc.com.au\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.cloudproinc.com.au\/index.php\/wp-json\/wp\/v2\/comments?post=53585"}],"version-history":[{"count":1,"href":"https:\/\/www.cloudproinc.com.au\/index.php\/wp-json\/wp\/v2\/posts\/53585\/revisions"}],"predecessor-version":[{"id":53590,"href":"https:\/\/www.cloudproinc.com.au\/index.php\/wp-json\/wp\/v2\/posts\/53585\/revisions\/53590"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.cloudproinc.com.au\/index.php\/wp-json\/wp\/v2\/media\/53589"}],"wp:attachment":[{"href":"https:\/\/www.cloudproinc.com.au\/index.php\/wp-json\/wp\/v2\/media?parent=53585"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.cloudproinc.com.au\/index.php\/wp-json\/wp\/v2\/categories?post=53585"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.cloudproinc.com.au\/index.php\/wp-json\/wp\/v2\/tags?post=53585"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}