Home » Azure » Document Azure subscription with PowerShell

Document Azure subscription with PowerShell

I would like to share an idea around documentation for Azure subscription, and hopefully get some ideas and feedback about it. What I see at customers is that documenting what resources are deployed to Azure is a challenge. It is also a challenge to easy get an overview of configuration and settings. Fortunately with Azure Power Shell we can easily get information about all resources in Azure. I have built an example script that export some settings from Azure and write them to a Word document.

The example script will export information about Virtual Machines, Network Interfaces and Network Security Groups (NSG). If you look in the script you can see examples of reading data from Azure and writing it to the Word document. You could of course read any data from your Azure environment and document it to Word. A benefit with a script is that you can schedule the script on intervals to always have an updated documentation of all your Azure resources.

Another thing I was testing was building Visio drawings with PowerShell. To do this I used this PowerShell module. The idea with this example is to read data from Azure and then draw a picture. In my example I included virtual machines and related storage accounts and network.

Download my example PowerShell scripts here.


Note that this is provided “AS-IS” with no warranties at all. This is not a production ready solution for your production environment, just an idea and an example.


  1. Came accross your script. It had some errors in it. I fixed those. Do you have an updated version somewhere. I would like to publish the modified script on github. (Of course referencing this site).

  2. hey, this may help clear up the error on set-visioshapecell….

    yes, it references vba, but it’s the same variables being passed, and the error is also identical….
    Set-VisioShapeCell : Specified argument was out of the range of valid values.
    Parameter name: Only string values can be values in the hashtable. Encountered a key of type System.String
    At line:1 char:1
    + Set-VisioShapeCell $props -Shapes $RG
    + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo : NotSpecified: (:) [Set-VisioShapeCell], ArgumentOutOfRangeException
    + FullyQualifiedErrorId : System.ArgumentOutOfRangeException,VisioPowerShell.Commands.Set_VisioShapeCell

  3. thanks for this Anders – this is a really useful script, much appreciated

  4. Hi Anders

    Ive been trying out your word.ps1 script for some time now but without success.
    After eventually spending time on troubleshooting the errors worked out that a) it does not work with Word 2016….so word 2013 (32-bit) only worked for me.
    Secondly, I could only get the script to run against my azure tenant subscription successfully with using a x86 powershell ISE with the AzureRM and Azure powershell modules installed.

    I like your idea and thnk it can be very useful in many situations.
    My situation is being able to deploy an envoronment from a json template, document the deployment, destroy the deployed envoronment and then review the document to keep track of the environment and being able to hand both to a colleugue to review.

  5. Thanks. I’ve been looking for this for a while now since AzureDocKit is just too expensive. It would be great if the output contains detail similar to AzureDocKit. I’m looking forward to the next version of your script.

  6. Awesome tool and helping us to keep track of our VM’s.
    Is there any script for PaaS as well.

Leave a comment

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.