{"id":15175,"date":"2020-08-05T09:25:27","date_gmt":"2020-08-05T09:25:27","guid":{"rendered":"https:\/\/www.testpreptraining.com\/tutorial\/?page_id=15175"},"modified":"2022-03-14T10:56:31","modified_gmt":"2022-03-14T10:56:31","slug":"creating-an-azure-custom-role-using-azure-powershell","status":"publish","type":"page","link":"https:\/\/www.testpreptraining.ai\/tutorial\/creating-an-azure-custom-role-using-azure-powershell\/","title":{"rendered":"Creating an Azure custom role using Azure PowerShell"},"content":{"rendered":"\n<p>With the help of this tutorial you will know about Creating an Azure custom role using Azure PowerShell. If the built-in Azure roles don&#8217;t fit your organization&#8217;s needs, you may design your own custom roles.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"sign-in-to-azure-powershell\"><strong>Signing in to Azure PowerShell<\/strong><\/h3>\n\n\n\n<p>The fist step is to Sign in to&nbsp;Azure PowerShell.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"create-a-custom-role\"><strong>Creating a custom role<\/strong><\/h3>\n\n\n\n<p>Starting with a built-in role, altering it, and then establishing a new role is the simplest approach to developing a custom role.<\/p>\n\n\n\n<p>In PowerShell, you can use the\u00a0Get-AzProviderOperation\u00a0command to obtain the list of operations for the Microsoft.Support resource provider. Knowing the procedures that are available to build your permissions is really useful. At Azure Resource Manager resource provider operations, you may view a list of all the operations accessible.<\/p>\n\n\n\n<p>Get-AzProviderOperation &#8220;Microsoft.Support\/*&#8221; | FT Operation, Description -AutoSize<\/p>\n\n\n\n<p>Operation Description<br>&#8212;&#8212;&#8212; &#8212;&#8212;&#8212;&#8211;<br>Microsoft.Support\/register\/action Registers to Support Resource Provider<br>Microsoft.Support\/supportTickets\/read Gets Support Ticket details (including status, severity, contact \u2026<br>Microsoft.Support\/supportTickets\/write Creates or Updates a Support Ticket. You can create a Support Tic\u2026<\/p>\n\n\n\n<p>Use the&nbsp;Get-AzRoleDefinition&nbsp;command to produce output the&nbsp;Reader&nbsp;role in JSON format.<\/p>\n\n\n\n<p>Get-AzRoleDefinition -Name &#8220;Reader&#8221; | ConvertTo-Json | Out-File C:\\CustomRoles\\ReaderSupportRole.json<\/p>\n\n\n\n<p>Open the&nbsp;<strong>ReaderSupportRole.json<\/strong>&nbsp;file in an editor after you are done with the above steps.<\/p>\n\n\n\n<p>The following output shows the JSON output.<\/p>\n\n\n\n<p>{<br>&#8220;Name&#8221;: &#8220;Reader&#8221;,<br>&#8220;Id&#8221;: &#8220;acdd72a7-3385-48ef-bd42-f606fba81ae7&#8221;,<br>&#8220;IsCustom&#8221;: false,<br>&#8220;Description&#8221;: &#8220;Lets you view everything, but not make any changes.&#8221;,<br>&#8220;Actions&#8221;: [<br>&#8220;*\/read&#8221;<br>],<br>&#8220;NotActions&#8221;: [],<br>&#8220;DataActions&#8221;: [],<br>&#8220;NotDataActions&#8221;: [],<br>&#8220;AssignableScopes&#8221;: [<br>&#8220;\/&#8221;<br>]}<\/p>\n\n\n\n<ul class=\"wp-block-list\"><li>Select Edit the JSON file to add the&nbsp;<code>\"Microsoft.Support\/*\"<\/code>&nbsp;operation to the&nbsp;<code>Actions<\/code>&nbsp;property. make sure to include a comma after the read operation. This action will allow the user to create support tickets.<\/li><li>Get the ID of your subscription using the&nbsp;Get-AzSubscription&nbsp;command.<\/li><\/ul>\n\n\n\n<ul class=\"wp-block-list\"><li>In&nbsp;<code>AssignableScopes<\/code>, add your subscription ID with the following format:&nbsp;<code>\"\/subscriptions\/00000000-0000-0000-0000-000000000000\"<\/code>You must add explicit subscription IDs, otherwise you won&#8217;t be allowed to import the role into your subscription.<\/li><li>Now, Delete the&nbsp;<code>Id<\/code>&nbsp;property line and change the&nbsp;<code>IsCustom<\/code>&nbsp;property to&nbsp;<code>true<\/code>.<\/li><li>Subsequently, Alter the&nbsp;<code>Name<\/code>&nbsp;and&nbsp;<code>Description<\/code>&nbsp;properties to &#8220;Reader Support Tickets&#8221; and &#8220;View everything in the subscription and also open support tickets.&#8221;<\/li><li>To create the new custom role, however, use the&nbsp;New-AzRoleDefinition&nbsp;command and specify the JSON role definition file.<\/li><\/ul>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"list-custom-roles\"><strong>List custom roles<\/strong><\/h3>\n\n\n\n<ul class=\"wp-block-list\"><li>Firstly, To list all your custom roles, use the&nbsp;Get-AzRoleDefinition&nbsp;command. You can also see the custom role in the Azure portal.<\/li><\/ul>\n\n\n\n<figure class=\"wp-block-image\"><img decoding=\"async\" src=\"https:\/\/docs.microsoft.com\/en-us\/azure\/role-based-access-control\/media\/tutorial-custom-role-powershell\/custom-role-reader-support-tickets.png\" alt=\"screenshot of custom role imported in the Azure portal\"\/><figcaption>Image source &#8211; Microsoft<\/figcaption><\/figure>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"update-a-custom-role\"><strong>Update a custom role<\/strong><\/h3>\n\n\n\n<p>To update the custom role, you could update the JSON file or use the&nbsp;<code>PSRoleDefinition<\/code>&nbsp;object.<\/p>\n\n\n\n<ul class=\"wp-block-list\"><li>Firstly, To update the JSON file, use the&nbsp;Get-AzRoleDefinition&nbsp;command to output the custom role in JSON format.<\/li><\/ul>\n\n\n\n<ul class=\"wp-block-list\"><li>Now, click Open the file in an editor.<\/li><li>In&nbsp;<code>Actions<\/code>, now,  add the operation to create and manage resource group deployments&nbsp;<code>\"Microsoft.Resources\/deployments\/*\"<\/code>.<\/li><\/ul>\n\n\n\n<ul class=\"wp-block-list\"><li>However, To update the custom role, use the&nbsp;Set-AzRoleDefinition&nbsp;command and specify the updated JSON file.<\/li><li>To use the&nbsp;<code>PSRoleDefintion<\/code>&nbsp;object to update your custom role, firstly use the&nbsp;Get-AzRoleDefinition&nbsp;command to get the role.<\/li><li>Furthermore, Call the&nbsp;<code>Add<\/code>&nbsp;method to add the operation to read diagnostic settings.<\/li><li>Use the&nbsp;Set-AzRoleDefinition finally&nbsp;to update the role.<\/li><\/ul>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"delete-a-custom-role\"><strong>Delete a custom role<\/strong><\/h3>\n\n\n\n<ul class=\"wp-block-list\"><li>Firstly, Use the&nbsp;Get-AzRoleDefinition&nbsp;command to get the ID of the custom role.<\/li><li>After that, Use the&nbsp;Remove-AzRoleDefinition&nbsp;command and specify in detail the role ID to delete the custom role.<\/li><li>When you will be asked to confirm, type&nbsp;<strong>Y<\/strong>.<\/li><\/ul>\n\n\n\n<div class=\"wp-block-image\"><figure class=\"aligncenter size-full\"><a href=\"https:\/\/www.testpreptraining.ai\/microsoft-azure-architect-technologies-az-303-free-practice-test\" target=\"_blank\" rel=\"noopener noreferrer\"><img loading=\"lazy\" decoding=\"async\" width=\"960\" height=\"150\" src=\"https:\/\/www.testpreptraining.ai\/tutorial\/wp-content\/uploads\/2020\/07\/Untitled-design-5.png\" alt=\"free practice test for AZ- 303\" class=\"wp-image-13928\" srcset=\"https:\/\/www.testpreptraining.ai\/tutorial\/wp-content\/uploads\/2020\/07\/Untitled-design-5.png 960w, https:\/\/www.testpreptraining.ai\/tutorial\/wp-content\/uploads\/2020\/07\/Untitled-design-5-750x117.png 750w\" sizes=\"auto, (max-width: 960px) 100vw, 960px\" \/><\/a><\/figure><\/div>\n\n\n\n<p><a href=\"https:\/\/www.testpreptraining.ai\/tutorial\/exam-az-303-microsoft-azure-architect-technologies\/\" target=\"_blank\" rel=\"noreferrer noopener\"><strong>Go back to home page <\/strong><\/a><\/p>\n\n\n\n<p class=\"has-text-align-right\"><strong>Reference documentation &#8211; <\/strong><a href=\"https:\/\/docs.microsoft.com\/en-us\/azure\/role-based-access-control\/tutorial-custom-role-powershell\" target=\"_blank\" rel=\"noreferrer noopener\">Tutorial: Create an Azure custom role using Azure PowerShell<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>With the help of this tutorial you will know about Creating an Azure custom role using Azure PowerShell. If the built-in Azure roles don&#8217;t fit your organization&#8217;s needs, you may design your own custom roles. Signing in to Azure PowerShell The fist step is to Sign in to&nbsp;Azure PowerShell. Creating a custom role Starting with&#8230;<\/p>\n","protected":false},"author":1,"featured_media":0,"parent":0,"menu_order":0,"comment_status":"closed","ping_status":"closed","template":"","meta":{"_acf_changed":false,"footnotes":""},"categories":[],"tags":[],"class_list":["post-15175","page","type-page","status-publish","hentry"],"acf":[],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v22.1 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>Creating an Azure custom role using Azure PowerShell<\/title>\n<meta name=\"description\" content=\"Enhance and upgrade your Azure Architect skills by preparing from tutorial - Creating an Azure custom role using Azure PowerShell.\" \/>\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.testpreptraining.ai\/tutorial\/creating-an-azure-custom-role-using-azure-powershell\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Creating an Azure custom role using Azure PowerShell\" \/>\n<meta property=\"og:description\" content=\"Enhance and upgrade your Azure Architect skills by preparing from tutorial - Creating an Azure custom role using Azure PowerShell.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.testpreptraining.ai\/tutorial\/creating-an-azure-custom-role-using-azure-powershell\/\" \/>\n<meta property=\"og:site_name\" content=\"Testprep Training Tutorials\" \/>\n<meta property=\"article:modified_time\" content=\"2022-03-14T10:56:31+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/docs.microsoft.com\/en-us\/azure\/role-based-access-control\/media\/tutorial-custom-role-powershell\/custom-role-reader-support-tickets.png\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data1\" content=\"3 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"WebPage\",\"@id\":\"https:\/\/www.testpreptraining.ai\/tutorial\/creating-an-azure-custom-role-using-azure-powershell\/\",\"url\":\"https:\/\/www.testpreptraining.ai\/tutorial\/creating-an-azure-custom-role-using-azure-powershell\/\",\"name\":\"Creating an Azure custom role using Azure PowerShell\",\"isPartOf\":{\"@id\":\"https:\/\/www.testpreptraining.ai\/tutorial\/#website\"},\"datePublished\":\"2020-08-05T09:25:27+00:00\",\"dateModified\":\"2022-03-14T10:56:31+00:00\",\"description\":\"Enhance and upgrade your Azure Architect skills by preparing from tutorial - Creating an Azure custom role using Azure PowerShell.\",\"breadcrumb\":{\"@id\":\"https:\/\/www.testpreptraining.ai\/tutorial\/creating-an-azure-custom-role-using-azure-powershell\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/www.testpreptraining.ai\/tutorial\/creating-an-azure-custom-role-using-azure-powershell\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/www.testpreptraining.ai\/tutorial\/creating-an-azure-custom-role-using-azure-powershell\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/www.testpreptraining.ai\/tutorial\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Creating an Azure custom role using Azure PowerShell\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/www.testpreptraining.ai\/tutorial\/#website\",\"url\":\"https:\/\/www.testpreptraining.ai\/tutorial\/\",\"name\":\"Testprep Training Tutorials\",\"description\":\"\",\"publisher\":{\"@id\":\"https:\/\/www.testpreptraining.ai\/tutorial\/#organization\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/www.testpreptraining.ai\/tutorial\/?s={search_term_string}\"},\"query-input\":\"required name=search_term_string\"}],\"inLanguage\":\"en-US\"},{\"@type\":\"Organization\",\"@id\":\"https:\/\/www.testpreptraining.ai\/tutorial\/#organization\",\"name\":\"Testprep Training\",\"url\":\"https:\/\/www.testpreptraining.ai\/tutorial\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/www.testpreptraining.ai\/tutorial\/#\/schema\/logo\/image\/\",\"url\":\"https:\/\/www.testpreptraining.com\/tutorial\/wp-content\/uploads\/2020\/07\/tpt-logo-6.png\",\"contentUrl\":\"https:\/\/www.testpreptraining.com\/tutorial\/wp-content\/uploads\/2020\/07\/tpt-logo-6.png\",\"width\":583,\"height\":153,\"caption\":\"Testprep Training\"},\"image\":{\"@id\":\"https:\/\/www.testpreptraining.ai\/tutorial\/#\/schema\/logo\/image\/\"}}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Creating an Azure custom role using Azure PowerShell","description":"Enhance and upgrade your Azure Architect skills by preparing from tutorial - Creating an Azure custom role using Azure PowerShell.","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.testpreptraining.ai\/tutorial\/creating-an-azure-custom-role-using-azure-powershell\/","og_locale":"en_US","og_type":"article","og_title":"Creating an Azure custom role using Azure PowerShell","og_description":"Enhance and upgrade your Azure Architect skills by preparing from tutorial - Creating an Azure custom role using Azure PowerShell.","og_url":"https:\/\/www.testpreptraining.ai\/tutorial\/creating-an-azure-custom-role-using-azure-powershell\/","og_site_name":"Testprep Training Tutorials","article_modified_time":"2022-03-14T10:56:31+00:00","og_image":[{"url":"https:\/\/docs.microsoft.com\/en-us\/azure\/role-based-access-control\/media\/tutorial-custom-role-powershell\/custom-role-reader-support-tickets.png"}],"twitter_card":"summary_large_image","twitter_misc":{"Est. reading time":"3 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebPage","@id":"https:\/\/www.testpreptraining.ai\/tutorial\/creating-an-azure-custom-role-using-azure-powershell\/","url":"https:\/\/www.testpreptraining.ai\/tutorial\/creating-an-azure-custom-role-using-azure-powershell\/","name":"Creating an Azure custom role using Azure PowerShell","isPartOf":{"@id":"https:\/\/www.testpreptraining.ai\/tutorial\/#website"},"datePublished":"2020-08-05T09:25:27+00:00","dateModified":"2022-03-14T10:56:31+00:00","description":"Enhance and upgrade your Azure Architect skills by preparing from tutorial - Creating an Azure custom role using Azure PowerShell.","breadcrumb":{"@id":"https:\/\/www.testpreptraining.ai\/tutorial\/creating-an-azure-custom-role-using-azure-powershell\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.testpreptraining.ai\/tutorial\/creating-an-azure-custom-role-using-azure-powershell\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/www.testpreptraining.ai\/tutorial\/creating-an-azure-custom-role-using-azure-powershell\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/www.testpreptraining.ai\/tutorial\/"},{"@type":"ListItem","position":2,"name":"Creating an Azure custom role using Azure PowerShell"}]},{"@type":"WebSite","@id":"https:\/\/www.testpreptraining.ai\/tutorial\/#website","url":"https:\/\/www.testpreptraining.ai\/tutorial\/","name":"Testprep Training Tutorials","description":"","publisher":{"@id":"https:\/\/www.testpreptraining.ai\/tutorial\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.testpreptraining.ai\/tutorial\/?s={search_term_string}"},"query-input":"required name=search_term_string"}],"inLanguage":"en-US"},{"@type":"Organization","@id":"https:\/\/www.testpreptraining.ai\/tutorial\/#organization","name":"Testprep Training","url":"https:\/\/www.testpreptraining.ai\/tutorial\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.testpreptraining.ai\/tutorial\/#\/schema\/logo\/image\/","url":"https:\/\/www.testpreptraining.com\/tutorial\/wp-content\/uploads\/2020\/07\/tpt-logo-6.png","contentUrl":"https:\/\/www.testpreptraining.com\/tutorial\/wp-content\/uploads\/2020\/07\/tpt-logo-6.png","width":583,"height":153,"caption":"Testprep Training"},"image":{"@id":"https:\/\/www.testpreptraining.ai\/tutorial\/#\/schema\/logo\/image\/"}}]}},"_links":{"self":[{"href":"https:\/\/www.testpreptraining.ai\/tutorial\/wp-json\/wp\/v2\/pages\/15175","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.testpreptraining.ai\/tutorial\/wp-json\/wp\/v2\/pages"}],"about":[{"href":"https:\/\/www.testpreptraining.ai\/tutorial\/wp-json\/wp\/v2\/types\/page"}],"author":[{"embeddable":true,"href":"https:\/\/www.testpreptraining.ai\/tutorial\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.testpreptraining.ai\/tutorial\/wp-json\/wp\/v2\/comments?post=15175"}],"version-history":[{"count":2,"href":"https:\/\/www.testpreptraining.ai\/tutorial\/wp-json\/wp\/v2\/pages\/15175\/revisions"}],"predecessor-version":[{"id":52818,"href":"https:\/\/www.testpreptraining.ai\/tutorial\/wp-json\/wp\/v2\/pages\/15175\/revisions\/52818"}],"wp:attachment":[{"href":"https:\/\/www.testpreptraining.ai\/tutorial\/wp-json\/wp\/v2\/media?parent=15175"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.testpreptraining.ai\/tutorial\/wp-json\/wp\/v2\/categories?post=15175"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.testpreptraining.ai\/tutorial\/wp-json\/wp\/v2\/tags?post=15175"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}