{"id":2667,"date":"2022-08-21T18:27:38","date_gmt":"2022-08-21T23:27:38","guid":{"rendered":"https:\/\/www.ciraltos.com\/?p=2667"},"modified":"2022-08-21T18:27:39","modified_gmt":"2022-08-21T23:27:39","slug":"azure-automation-subscription-null-or-empty","status":"publish","type":"post","link":"https:\/\/www.ciraltos.com\/staging2\/azure-automation-subscription-null-or-empty\/","title":{"rendered":"Azure Automation Subscription Null or Empty"},"content":{"rendered":"\n<p>What do you do if you are setting up a new Runbook in Azure\nAutomation and get a message similar to: <\/p>\n\n\n\n<p>\u201cCannot validate argument on parameter &#8216;Subscription.&#8217; The\nargument is null or empty.\u201d<\/p>\n\n\n\n<div class=\"wp-block-image\"><figure class=\"aligncenter size-large\"><img decoding=\"async\" loading=\"lazy\" width=\"600\" height=\"143\" src=\"https:\/\/www.ciraltos.com\/wp-content\/uploads\/2022\/08\/No-Subscription-Error.png\" alt=\"No Subscription Error \" class=\"wp-image-2668\" srcset=\"https:\/\/www.ciraltos.com\/staging2\/wp-content\/uploads\/2022\/08\/No-Subscription-Error.png 600w, https:\/\/www.ciraltos.com\/staging2\/wp-content\/uploads\/2022\/08\/No-Subscription-Error-300x72.png 300w\" sizes=\"(max-width: 600px) 100vw, 600px\" \/><figcaption>No Subscription Error <\/figcaption><\/figure><\/div>\n\n\n\n<p>And this is a new managed identity, or maybe the first time\nusing the identity?<\/p>\n\n\n\n<p>Looking at the roles assigned to a new System Assigned Managed Identity, we can see that all the RBAC roles are from Azure AD. \u00a0Remember, the subscription and Azure AD are different scopes for RBAC roles.\u00a0 By default, a new System or User Managed Identity does not have rights to the subscription.\u00a0 <\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img decoding=\"async\" loading=\"lazy\" width=\"976\" height=\"186\" src=\"https:\/\/www.ciraltos.com\/wp-content\/uploads\/2022\/08\/Default-Azure-AD-Roles.png\" alt=\"\" class=\"wp-image-2669\" srcset=\"https:\/\/www.ciraltos.com\/staging2\/wp-content\/uploads\/2022\/08\/Default-Azure-AD-Roles.png 976w, https:\/\/www.ciraltos.com\/staging2\/wp-content\/uploads\/2022\/08\/Default-Azure-AD-Roles-300x57.png 300w, https:\/\/www.ciraltos.com\/staging2\/wp-content\/uploads\/2022\/08\/Default-Azure-AD-Roles-768x146.png 768w\" sizes=\"(max-width: 976px) 100vw, 976px\" \/><figcaption>Default Azure AD Roles<\/figcaption><\/figure>\n\n\n\n<p>The default settings have no Subscription level rights.&nbsp; Because of that, no subscription value\nreturns when the Connect-AzAccount -Identity command runs to authenticate the\nrunbook with the managed identity.&nbsp; We can\nverify that with the output from the $AzureContext variable used to authenticate\nthe runbook.<\/p>\n\n\n\n<div class=\"wp-block-image\"><figure class=\"aligncenter size-large\"><img decoding=\"async\" loading=\"lazy\" width=\"462\" height=\"184\" src=\"https:\/\/www.ciraltos.com\/wp-content\/uploads\/2022\/08\/No-Subscription.png\" alt=\"\" class=\"wp-image-2670\" srcset=\"https:\/\/www.ciraltos.com\/staging2\/wp-content\/uploads\/2022\/08\/No-Subscription.png 462w, https:\/\/www.ciraltos.com\/staging2\/wp-content\/uploads\/2022\/08\/No-Subscription-300x119.png 300w\" sizes=\"(max-width: 462px) 100vw, 462px\" \/><figcaption> No Subscription <\/figcaption><\/figure><\/div>\n\n\n\n<p>The fix is easy, assign the managed identity a role in the\nsubscription.&nbsp; Odds are, you intend to do\nthat anyway.&nbsp; After all, why log in with\nthe managed identity if it\u2019s not going to interact with the subscription?<\/p>\n\n\n\n<p>Once we assign a role in the subscription, the login context\nwill have a subscription to add.<\/p>\n\n\n\n<div class=\"wp-block-image\"><figure class=\"aligncenter size-large\"><img decoding=\"async\" loading=\"lazy\" width=\"440\" height=\"165\" src=\"https:\/\/www.ciraltos.com\/wp-content\/uploads\/2022\/08\/With-Subscription.png\" alt=\"\" class=\"wp-image-2671\" srcset=\"https:\/\/www.ciraltos.com\/staging2\/wp-content\/uploads\/2022\/08\/With-Subscription.png 440w, https:\/\/www.ciraltos.com\/staging2\/wp-content\/uploads\/2022\/08\/With-Subscription-300x113.png 300w\" sizes=\"(max-width: 440px) 100vw, 440px\" \/><figcaption>With Subscription<\/figcaption><\/figure><\/div>\n","protected":false},"excerpt":{"rendered":"<p>What do you do if you are setting up a new Runbook in Azure Automation and get a message similar to: \u201cCannot validate argument on parameter &#8216;Subscription.&#8217; The argument is null or empty.\u201d And this is a new managed identity, or maybe the first time using the identity? Looking at the roles assigned to a &hellip;<\/p>\n<p class=\"read-more\"> <a class=\"\" href=\"https:\/\/www.ciraltos.com\/staging2\/azure-automation-subscription-null-or-empty\/\"> <span class=\"screen-reader-text\">Azure Automation Subscription Null or Empty<\/span> Read More &raquo;<\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"site-sidebar-layout":"default","site-content-layout":"default","ast-global-header-display":"","ast-main-header-display":"","ast-hfb-above-header-display":"","ast-hfb-below-header-display":"","ast-hfb-mobile-header-display":"","site-post-title":"","ast-breadcrumbs-content":"","ast-featured-img":"","footer-sml-layout":"","theme-transparent-header-meta":"","adv-header-id-meta":"","stick-header-meta":"","header-above-stick-meta":"","header-main-stick-meta":"","header-below-stick-meta":""},"categories":[1],"tags":[],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v20.3 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>Azure Automation Subscription Null or Empty - ciraltos<\/title>\n<meta name=\"description\" content=\"What do you do if you are setting up a new Runbook in AzureAutomation and get a message similar to: \u201cCannot validate argument on parameter &#039;Subscription.&#039; Theargument is null or empty\" \/>\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.ciraltos.com\/staging2\/azure-automation-subscription-null-or-empty\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Azure Automation Subscription Null or Empty - ciraltos\" \/>\n<meta property=\"og:description\" content=\"What do you do if you are setting up a new Runbook in AzureAutomation and get a message similar to: \u201cCannot validate argument on parameter &#039;Subscription.&#039; Theargument is null or empty\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.ciraltos.com\/staging2\/azure-automation-subscription-null-or-empty\/\" \/>\n<meta property=\"og:site_name\" content=\"ciraltos\" \/>\n<meta property=\"article:published_time\" content=\"2022-08-21T23:27:38+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2022-08-21T23:27:39+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/www.ciraltos.com\/wp-content\/uploads\/2022\/08\/No-Subscription-Error.png\" \/>\n<meta name=\"author\" content=\"Travis Roberts\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:creator\" content=\"@ciraltos\" \/>\n<meta name=\"twitter:site\" content=\"@ciraltos\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Travis Roberts\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"1 minute\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\/\/www.ciraltos.com\/staging2\/azure-automation-subscription-null-or-empty\/#article\",\"isPartOf\":{\"@id\":\"https:\/\/www.ciraltos.com\/staging2\/azure-automation-subscription-null-or-empty\/\"},\"author\":{\"name\":\"Travis Roberts\",\"@id\":\"http:\/\/www.ciraltos.com\/staging2\/#\/schema\/person\/25391996d6cddfecd4d257162b7e373a\"},\"headline\":\"Azure Automation Subscription Null or Empty\",\"datePublished\":\"2022-08-21T23:27:38+00:00\",\"dateModified\":\"2022-08-21T23:27:39+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\/\/www.ciraltos.com\/staging2\/azure-automation-subscription-null-or-empty\/\"},\"wordCount\":223,\"commentCount\":2,\"publisher\":{\"@id\":\"http:\/\/www.ciraltos.com\/staging2\/#\/schema\/person\/25391996d6cddfecd4d257162b7e373a\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\/\/www.ciraltos.com\/staging2\/azure-automation-subscription-null-or-empty\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\/\/www.ciraltos.com\/staging2\/azure-automation-subscription-null-or-empty\/\",\"url\":\"https:\/\/www.ciraltos.com\/staging2\/azure-automation-subscription-null-or-empty\/\",\"name\":\"Azure Automation Subscription Null or Empty - ciraltos\",\"isPartOf\":{\"@id\":\"http:\/\/www.ciraltos.com\/staging2\/#website\"},\"datePublished\":\"2022-08-21T23:27:38+00:00\",\"dateModified\":\"2022-08-21T23:27:39+00:00\",\"description\":\"What do you do if you are setting up a new Runbook in AzureAutomation and get a message similar to: \u201cCannot validate argument on parameter 'Subscription.' Theargument is null or empty\",\"breadcrumb\":{\"@id\":\"https:\/\/www.ciraltos.com\/staging2\/azure-automation-subscription-null-or-empty\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/www.ciraltos.com\/staging2\/azure-automation-subscription-null-or-empty\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/www.ciraltos.com\/staging2\/azure-automation-subscription-null-or-empty\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"http:\/\/www.ciraltos.com\/staging2\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Azure Automation Subscription Null or Empty\"}]},{\"@type\":\"WebSite\",\"@id\":\"http:\/\/www.ciraltos.com\/staging2\/#website\",\"url\":\"http:\/\/www.ciraltos.com\/staging2\/\",\"name\":\"ciraltos\",\"description\":\"cloud, technology and trends\",\"publisher\":{\"@id\":\"http:\/\/www.ciraltos.com\/staging2\/#\/schema\/person\/25391996d6cddfecd4d257162b7e373a\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"http:\/\/www.ciraltos.com\/staging2\/?s={search_term_string}\"},\"query-input\":\"required name=search_term_string\"}],\"inLanguage\":\"en-US\"},{\"@type\":[\"Person\",\"Organization\"],\"@id\":\"http:\/\/www.ciraltos.com\/staging2\/#\/schema\/person\/25391996d6cddfecd4d257162b7e373a\",\"name\":\"Travis Roberts\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"http:\/\/www.ciraltos.com\/staging2\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/www.ciraltos.com\/staging2\/wp-content\/uploads\/2023\/03\/Logo-1.png\",\"contentUrl\":\"https:\/\/www.ciraltos.com\/staging2\/wp-content\/uploads\/2023\/03\/Logo-1.png\",\"width\":5657,\"height\":3563,\"caption\":\"Travis Roberts\"},\"logo\":{\"@id\":\"http:\/\/www.ciraltos.com\/staging2\/#\/schema\/person\/image\/\"},\"sameAs\":[\"http:\/\/www.ciraltos.com\",\"https:\/\/twitter.com\/ciraltos\"],\"url\":\"https:\/\/www.ciraltos.com\/staging2\/author\/admin\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Azure Automation Subscription Null or Empty - ciraltos","description":"What do you do if you are setting up a new Runbook in AzureAutomation and get a message similar to: \u201cCannot validate argument on parameter 'Subscription.' Theargument is null or empty","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.ciraltos.com\/staging2\/azure-automation-subscription-null-or-empty\/","og_locale":"en_US","og_type":"article","og_title":"Azure Automation Subscription Null or Empty - ciraltos","og_description":"What do you do if you are setting up a new Runbook in AzureAutomation and get a message similar to: \u201cCannot validate argument on parameter 'Subscription.' Theargument is null or empty","og_url":"https:\/\/www.ciraltos.com\/staging2\/azure-automation-subscription-null-or-empty\/","og_site_name":"ciraltos","article_published_time":"2022-08-21T23:27:38+00:00","article_modified_time":"2022-08-21T23:27:39+00:00","og_image":[{"url":"https:\/\/www.ciraltos.com\/wp-content\/uploads\/2022\/08\/No-Subscription-Error.png"}],"author":"Travis Roberts","twitter_card":"summary_large_image","twitter_creator":"@ciraltos","twitter_site":"@ciraltos","twitter_misc":{"Written by":"Travis Roberts","Est. reading time":"1 minute"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/www.ciraltos.com\/staging2\/azure-automation-subscription-null-or-empty\/#article","isPartOf":{"@id":"https:\/\/www.ciraltos.com\/staging2\/azure-automation-subscription-null-or-empty\/"},"author":{"name":"Travis Roberts","@id":"http:\/\/www.ciraltos.com\/staging2\/#\/schema\/person\/25391996d6cddfecd4d257162b7e373a"},"headline":"Azure Automation Subscription Null or Empty","datePublished":"2022-08-21T23:27:38+00:00","dateModified":"2022-08-21T23:27:39+00:00","mainEntityOfPage":{"@id":"https:\/\/www.ciraltos.com\/staging2\/azure-automation-subscription-null-or-empty\/"},"wordCount":223,"commentCount":2,"publisher":{"@id":"http:\/\/www.ciraltos.com\/staging2\/#\/schema\/person\/25391996d6cddfecd4d257162b7e373a"},"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/www.ciraltos.com\/staging2\/azure-automation-subscription-null-or-empty\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/www.ciraltos.com\/staging2\/azure-automation-subscription-null-or-empty\/","url":"https:\/\/www.ciraltos.com\/staging2\/azure-automation-subscription-null-or-empty\/","name":"Azure Automation Subscription Null or Empty - ciraltos","isPartOf":{"@id":"http:\/\/www.ciraltos.com\/staging2\/#website"},"datePublished":"2022-08-21T23:27:38+00:00","dateModified":"2022-08-21T23:27:39+00:00","description":"What do you do if you are setting up a new Runbook in AzureAutomation and get a message similar to: \u201cCannot validate argument on parameter 'Subscription.' Theargument is null or empty","breadcrumb":{"@id":"https:\/\/www.ciraltos.com\/staging2\/azure-automation-subscription-null-or-empty\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.ciraltos.com\/staging2\/azure-automation-subscription-null-or-empty\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/www.ciraltos.com\/staging2\/azure-automation-subscription-null-or-empty\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"http:\/\/www.ciraltos.com\/staging2\/"},{"@type":"ListItem","position":2,"name":"Azure Automation Subscription Null or Empty"}]},{"@type":"WebSite","@id":"http:\/\/www.ciraltos.com\/staging2\/#website","url":"http:\/\/www.ciraltos.com\/staging2\/","name":"ciraltos","description":"cloud, technology and trends","publisher":{"@id":"http:\/\/www.ciraltos.com\/staging2\/#\/schema\/person\/25391996d6cddfecd4d257162b7e373a"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"http:\/\/www.ciraltos.com\/staging2\/?s={search_term_string}"},"query-input":"required name=search_term_string"}],"inLanguage":"en-US"},{"@type":["Person","Organization"],"@id":"http:\/\/www.ciraltos.com\/staging2\/#\/schema\/person\/25391996d6cddfecd4d257162b7e373a","name":"Travis Roberts","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"http:\/\/www.ciraltos.com\/staging2\/#\/schema\/person\/image\/","url":"https:\/\/www.ciraltos.com\/staging2\/wp-content\/uploads\/2023\/03\/Logo-1.png","contentUrl":"https:\/\/www.ciraltos.com\/staging2\/wp-content\/uploads\/2023\/03\/Logo-1.png","width":5657,"height":3563,"caption":"Travis Roberts"},"logo":{"@id":"http:\/\/www.ciraltos.com\/staging2\/#\/schema\/person\/image\/"},"sameAs":["http:\/\/www.ciraltos.com","https:\/\/twitter.com\/ciraltos"],"url":"https:\/\/www.ciraltos.com\/staging2\/author\/admin\/"}]}},"_links":{"self":[{"href":"https:\/\/www.ciraltos.com\/staging2\/wp-json\/wp\/v2\/posts\/2667"}],"collection":[{"href":"https:\/\/www.ciraltos.com\/staging2\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.ciraltos.com\/staging2\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.ciraltos.com\/staging2\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.ciraltos.com\/staging2\/wp-json\/wp\/v2\/comments?post=2667"}],"version-history":[{"count":3,"href":"https:\/\/www.ciraltos.com\/staging2\/wp-json\/wp\/v2\/posts\/2667\/revisions"}],"predecessor-version":[{"id":2674,"href":"https:\/\/www.ciraltos.com\/staging2\/wp-json\/wp\/v2\/posts\/2667\/revisions\/2674"}],"wp:attachment":[{"href":"https:\/\/www.ciraltos.com\/staging2\/wp-json\/wp\/v2\/media?parent=2667"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.ciraltos.com\/staging2\/wp-json\/wp\/v2\/categories?post=2667"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.ciraltos.com\/staging2\/wp-json\/wp\/v2\/tags?post=2667"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}