Git Product home page Git Product logo

azureresourcemap's Introduction

AzureDiagrams

Generate a Draw.IO diagram from your Azure Resources

Github Action

You need to an AAD token to use AzureResourceMap with at least Reader scope over the resource-groups. Here's an example that:

  • will get a token
  • use the Custom Github Action to generate a diagram
  • publish the diagram as an artefact.
      - name: "Get access token"
        id: token
        run: |
          token=$(az account get-access-token --query accessToken -o tsv --query "accessToken")
          echo "::add-mask::$token" 
          echo "::set-output name=token::$token"

      - name: graemefoster-azurediagrams-action
        uses: graemefoster/[email protected]
        with:
          subscriptionId: ${{ secrets.AZURE_SUBSCRIPTION_ID }}
          resourceGroup: "*-grf-*"
          outputFileName: "azurediagram.drawio"
          accessToken: ${{ steps.token.outputs.token }}

      - uses: actions/upload-artifact@v3
        with:
          name: diagram
          path: ./azurediagram.drawio

Yaml properties

Property Required Description
subscriptionId Yes Subscription Id to run against
resourceGroup Yes Wildcard enabled resource group name (supports multiple)
accessToken Yes Optional JWT to avoid using CLI credential
condensed Yes True collapses private endpoints into subnets (can simplify large diagrams)
inferConnections Yes True to infer connections by introspecting AppSettings
outputFileName Yes Name of generated file. Gets written to working directory

CLI

az login 
az account set --subscription "<subscription-name>"
dotnet AzureDiagrams.dll --subscription-id <subscription-id> --resource-group <resource-group> --resource-group <resource-group> --output c:/temp/

CLI flags

Flag Required Description
--tenant-id No Tenant Id (defaults to current Azure CLI)
--subscription Yes Subscription Id to run against
--resource-group Yes Wildcard enabled resource group name (supports multiple)
--output Yes Folder to output diagram to
--condensed No True collapses private endpoints into subnets (can simplify large diagrams)
--no-infer No True to infer connections by introspecting AppSettings
--token No Optional JWT to avoid using CLI credential
--output-file-name No Name of generated file. Defaults to resource-group name

Example outputs

Azure App Service with App Insights / database / Key Vault

AzureSimple

More complex with VNets and private endpoints

AzureSimple

How does it work?

AzureDiagrams queries the Azure Resource Management APIs to introspect resource-groups. It then uses a set of strategies to enrich the raw data, building a model that can be projected into other formats.

It's not 100% guaranteed to be correct but it should give a good first pass at fairly complex architectures/

To layout the components I use the amazing AutomaticGraphLayout library.

Todo

There are many, many Azure services not yet covered. I'll try and put a table here of what is covered, and how comprehensive it is covered.

Output Formats

The initial version supports Draw.IO diagrams.

azureresourcemap's People

Contributors

graemefoster avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.