{"id":3916,"date":"2022-09-07T17:17:34","date_gmt":"2022-09-07T15:17:34","guid":{"rendered":"https:\/\/leeryanrs.com\/?p=3916"},"modified":"2022-09-07T17:17:34","modified_gmt":"2022-09-07T15:17:34","slug":"azure-resource-inventory-export","status":"publish","type":"post","link":"https:\/\/leeryanrs.com\/?p=3916","title":{"rendered":"Azure Resource Inventory Export"},"content":{"rendered":"\n<p>If you do not have any CMDB actively scanning you Azure environment, things could get messy if you&#8217;ve had several rushed deployments into your Azure infrastructure. I recently got to know about a script by a colleague, that can export every single resource in your subscription and display it in a very organized excel sheet.<\/p>\n\n\n\n<p><strong>Example<\/strong> &#8211; <\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img decoding=\"async\" src=\"https:\/\/leeryanrs.com\/wp-content\/uploads\/2022\/09\/image-1024x533.png\" alt=\"\" class=\"wp-image-3917\"\/><\/figure>\n\n\n\n<div class=\"wp-block-file\"><a id=\"wp-block-file--media-00a9bcff-ca2b-493f-b2ba-db2d0202e171\" href=\"https:\/\/leeryanrs.com\/wp-content\/uploads\/2022\/09\/azureinventory.txt\">AzureInventory<\/a><a href=\"https:\/\/leeryanrs.com\/wp-content\/uploads\/2022\/09\/azureinventory.txt\" class=\"wp-block-file__button\" download aria-describedby=\"wp-block-file--media-00a9bcff-ca2b-493f-b2ba-db2d0202e171\">Download<\/a><\/div>\n\n\n\n<p>I&#8217;ve uploaded the file here in TXT format, download it and rename to .ps1 ; You might need to have the below modules installed on your PC and one extension &#8211; <br><br>Azure AD<br>Azure CLI<br><br>Once those are installed, add the resource graph extension with this command -|<br><br><\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">az extension add --name resource-graph\n<\/pre>\n\n\n\n<p>Now run the script, it will take you to the login page of Microsoft, use an admin account with permissions to read the tenant.<\/p>\n\n\n\n<p><\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>Some users reported having to run the script with the trigger -Online as the excel was not being generated. I have also verified this bug occurs and using the -Online resolves it. A second bug is that it will show 0 resources in the excel. This is something on your PC and you must re-install the powershell modules and extension.<\/code><\/pre>\n\n\n\n<p>Credits for this script go to <a href=\"https:\/\/github.com\/microsoft\/ARI\">https:\/\/github.com\/microsoft\/ARI<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>If you do not have any CMDB actively scanning you Azure environment, things could get messy if you&#8217;ve had several rushed deployments into your Azure infrastructure. I recently got to know about a script by a colleague, that can export every single resource in your subscription and display it in a very organized excel sheet. [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[25,38,43],"class_list":["post-3916","post","type-post","status-publish","format-standard","hentry","category-uncategorized","tag-azure","tag-powershell","tag-script"],"_links":{"self":[{"href":"https:\/\/leeryanrs.com\/index.php?rest_route=\/wp\/v2\/posts\/3916","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/leeryanrs.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/leeryanrs.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/leeryanrs.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/leeryanrs.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=3916"}],"version-history":[{"count":0,"href":"https:\/\/leeryanrs.com\/index.php?rest_route=\/wp\/v2\/posts\/3916\/revisions"}],"wp:attachment":[{"href":"https:\/\/leeryanrs.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=3916"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/leeryanrs.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=3916"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/leeryanrs.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=3916"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}