• Stars
    star
    142
  • Rank 257,033 (Top 6 %)
  • Language
    TypeScript
  • License
    MIT License
  • Created about 5 years ago
  • Updated over 1 year ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

Graphically display ARM templates in VS Code with an interactive map style view

ARM Viewer for VS Code

Version Installs

This extension displays a graphical preview of Azure Resource Manager (ARM) templates. The view will show all resources with the official Azure icons and also linkage between the resources. Uses the Cytoscape.js library

You can drag and move icons as you wish, zoom in and out with the mouse wheel and drag the canvas to pan around. Clicking on a resource will show a small "infobox" with extra details. See usage for more details and features.

Extension as been tested successfully against all 900+ Azure Quickstart Templates ๐Ÿ˜

s1

s2

s3

Usage

  • Open a ARM template JSON file, and ensure it is active/focused
    • Click the eye symbol in the top right of the editor tab bar
    • toolbar
  • Or:
    • Open the VS Code command pallet with Ctrl+Shift+P or โ‡งโŒ˜P on a mac
    • Start typing ARM Viewer
    • Pick ARM Viewer: Preview ARM file graphically from the list
  • Or:
    • Use keyboard shortcut Ctrl+Alt+Q

Basic Features

  • Click on a resource to show popup 'infobox' for that resource, a selected subset of details will be shown.
  • Click and drag on background to move and pan the view around.
  • Zoom in and out with the mouse wheel.
  • Drag icons around to layout as your wish, one tip is to click 'Re-fit' after moving to get the best view & zoom level.

Toolbar

  • Click the 'Labels' button to toggle labels from resource names to resource types.
  • Click the 'Re-fit' button to refit the view to the best zoom level.
  • Click the 'Snap' button to toggle snap to grid mode on/off.
  • Click the 'Export' button to export as PNG, you will be prompted for a filename. The PNG will have a transparent background.
  • Two auto layout modes are available:
    • 'Tree' lays out the nodes in a hierarchical manner, ok for small templates, also the default.
    • 'Grid' puts the nodes on a grid, better for large templates but will often not make logical sense.

Parameter Files

By default the extension will try to use any defaultValues found in the parameters section of the template.

To apply a set of input parameters and overrides to the view, click 'Params' toolbar button. You will be prompted for a ARM parameters JSON file (e.g. azuredeploy.parameters.json). The values in the parameters JSON fill will be used in place of values set in the template

Resource Filters

The view can sometimes get very crowded, especially when you have many resources of the same time (e.g. NSG rules or Key Vault secrets). Click the 'Filter' toolbar button to apply a filter to the view. You will be prompted for a input string:

  • This is a comma separated list of resource types you want removed from the view.
  • A partial substring of the type can be used, e.g. secrets or vaults/secrets or microsoft.keyvault/vaults/secrets.
  • Case does not matter.
  • Entering an empty string will remove the filter.

Linked Templates

The extension will attempt to locate and display linked templates, these resources will be shown grouped together in a shaded box. Linked template support comes with many limitations. This is an outline of how it works:

  • If the resolved linked template URL is externally accessible, it will be downloaded and used. Results are cached to stop excessive HTTP calls.
  • If the URL is not accessible, then an attempt is made to load the file locally based on a guess from the filename and parent dir extracted from the URL, e.g. nested/linked.json
  • If that fails, then the local filesystem of the VS Code workspace will be searched for the file. Some assumptions are made in this search:
    • The search will only happen if the linked file has a different filename from the main/master template being viewed. Otherwise the search would just find the main template being viewed.
    • The linked template file should located somewhere under the path of the main template, sub-folders will be searched. If the file resides elsewhere outside this path it will not be located.
    • The first matching file will be used.
  • If linked template URL or filename is dynamic based on template parameters it is very likely not to resolve, and will not be found.
  • If the linked template can not be located/loaded then a icon representing the deployment will be shown as a fallback.
  • Currently there is no cache for data fetched from external URLs.
  • The layout of the icons/resources can initially be a bit strange, and will require some manual tidy up to look good. I'm investigating how to improve this.

Notes

This project was created as a learning exercise, but was heavily inspired & influenced by the old ARMViz tool. ARMViz sadly seems to have been abandoned, it often has problems displaying some templates. Personally I wasn't a fan of look of the output, and found it hard to read. These are a few of the reasons why I created this project

A new based version based on the same code as this VS Code extension, can be found here: https://github.com/benc-uk/armview-web

ARM Template JSON Support

ARM templates go outside the JSON specification and break it in a couple of areas:

  • Support for comments in the JSON file (aka JSONC)
  • Allowing the use of multi-line strings The extension supports both of these as far as is reasonably possible, multi-line strings in particular has no known spec on how it should be supported. The extension is also aware of the language server provided by the 'Azure Resource Manager Tools' extension and will accept files set to 'arm-template' as the language type.

Limitations & Known Issues

  • The code attempts to find the links (dependsOn relationships) between ARM resources, however due to the many subtle and complex ways these relationships can be defined & expressed, certain links may not be picked up & displayed. Oct 2020 - Parsing for nested resources has been improved.
  • Icons for the most commonly used & popular resource types have been added, however not every resource is covered (There's simply too many and no canonical source). The default ARM cube icon will be shown as a fallback. Get in touch if you want a icon added for a particular resource type.
  • Resolving names & other properties for resources is attempted, but due to programmatic way these are generally defined with ARM functions and expressions, full name resolution is not always possible.
  • Templates using the loop functions copy & copyIndex to create multiple resources will not be rendered correctly due to limitations on evaluating the dynamic iterative state of the template.

More Repositories

1

kubeview

Kubernetes cluster visualiser and graphical explorer
Vue
921
star
2

k6-reporter

Output K6 test run results as formatted & easy to read HTML reports
EJS
369
star
3

workflow-dispatch

A GitHub Action for triggering workflows, using the `workflow_dispatch` event
TypeScript
318
star
4

icon-collection

Azure & Microsoft SVG Icon Collection
HTML
241
star
5

python-demoapp

Simple Python Flask web application designed for running in containers for demos
JavaScript
128
star
6

dapr-store

Sample application showcasing the use of Dapr to build microservices based apps
Go
124
star
7

super-dungeon-delve

2D retro style dungeon game
GDScript
117
star
8

vuego-demoapp

Simple Golang and Vue.js SPA demo for deploying to Azure, Docker etc
Vue
115
star
9

smilr

Microservices reference app showcasing a range of technologies, platforms & methodologies
JavaScript
100
star
10

chatr

Chat app using Azure Web PubSub, Static Web Apps and other Azure services
JavaScript
70
star
11

nodejs-demoapp

Simple demo Node.js Express web app for deploying to Azure, Docker etc
JavaScript
45
star
12

msal-graph-vue

Vue.js sample app showing use of MSAL for authentication and calling MS Graph APIs
Vue
35
star
13

htmx-go-chat

Chat app written in Go with HTMX and SSE
Go
33
star
14

dotnet6-minimal

Quick and dirty minimal .NET 6 web app
C#
28
star
15

postman-prometheus

Run Postman collections continuously and export results as Prometheus metrics
JavaScript
28
star
16

dotnet-demoapp

.NET 6 demo web app for deploying to Azure, Docker etc
C#
26
star
17

kube-workshop

A hands-on workshop intended to get people comfortable in working with Kubernetes and deploying applications
25
star
18

touchmidi

Flexible HTML5 based touch based control surface for MIDI
JavaScript
24
star
19

armview-web

Standalone web version of github.com/benc-uk/armview-vscode
EJS
22
star
20

k6-prometheus-exporter

Export k6 metrics and load test data into Prometheus
Go
20
star
21

rayscale

Microservices based, distributed ray tracer designed to run in containers
TypeScript
20
star
22

tools-install

Setup scripts for various dev tools, utilities, SDKs and CLI stuff
Shell
19
star
23

bicep-iac

My set of Azure Bicep templates and modules
Bicep
17
star
24

hcl2-parser

HCLv2 parser for JavaScript
JavaScript
16
star
25

go-rest-api

Boilerplate & template starter for creating a REST based HTTP microservice in Go
Go
15
star
26

locust-reporter

Generate HTML reports from Locust load test output
Go
15
star
27

azure-arm

My ARM template library
Shell
14
star
28

batcomputer

A working example of DevOps & operationalisation applied to Machine Learning and AI
Python
13
star
29

gofract

Mandelbrot and Julia fractals rendered in real-time using Go
Go
13
star
30

pikube

Building a Kubernetes cluster on the Raspberry Pi
Python
12
star
31

keycloak-helm

Helm chart for Keycloak
Smarty
10
star
32

terraform-mgmt-bootstrap

Bootstrap core Azure state & resources using Terraform for use with Azure DevOps
HCL
9
star
33

serverless-cosmos-lab

Azure computer vision AI lab using LogicApps, Cognitive Services, CosmosDB and Web Apps
JavaScript
9
star
34

azure-functions

!! OLD PLEASE DON'T USE !! Demo and example Azure Functions in various languages
C#
9
star
35

kube-primer

Kubernetes Technical Primer
8
star
36

pod-kicker

A Kubernetes sidecar to watch for file changes and restart deployments and pods
Go
7
star
37

dotfiles

My personal dotfiles
Shell
7
star
38

aks-samples

Samples, feature demos and examples for Azure Kubernetes Service (AKS)
Shell
6
star
39

touchmidi-old

Flexible HTML5 based touch based control surface for MIDI
JavaScript
6
star
40

java-demoapp

Simple demo Java Spring Boot web app for deploying to Azure, Docker etc
Java
6
star
41

melkors-oubliette

A 3D dungeon crawler game inspired by Dungeon Master & Eye Of The Beholder
GDScript
6
star
42

devcontainers

Dockerfile
5
star
43

generative-music

Procedural and generative music tools and things
HTML
5
star
44

msal-graph-react

React sample app showing use of MSAL for authentication and calling MS Graph APIs
JavaScript
5
star
45

dart-raytracer

A raytracer written in Dart
Dart
4
star
46

goat-bot

Microsoft Bot Framework working example & demo - Goat Bot!
JavaScript
4
star
47

face-vision-app

Azure Cognitive Face/Vision APIs - Pure HTML5/JS Client
JavaScript
4
star
48

azure-samples

General collection of samples and snippets for Azure
PowerShell
4
star
49

csa-widgets

Dashboard Widgets for HP Cloud Service Automation
JavaScript
4
star
50

serverless-cognitive

Computer vision AI lab using Azure Functions and Cognitive Services
JavaScript
4
star
51

dungeon-game-old

C#
3
star
52

simple-slides

Simple slide presenter written in HTML5 & JS
HTML
3
star
53

angular-demoapp

Demo app written in Angular 4 using Node.js and Material Components
TypeScript
3
star
54

azure-devops-core-docker

End to end DevOps exercise with .NET Core, Docker, VSTS in Azure
Batchfile
3
star
55

dapr-dotnet-starter

Simple learning & getting started example for .NET and Dapr
C#
2
star
56

doom-lite

A learning exercise in writing a simple retro style FPS
JavaScript
2
star
57

midi-toolkit

A HTML5 & JS based static web app for working with MIDI
JavaScript
2
star
58

caster

Retro style 90s FPS with a fantasy theme, written in Go
Go
2
star
59

nanoproxy

A simple HTTP reverse proxy & Kubernetes ingress controller written in Go as a learning exercise
Go
2
star
60

nanomon

Lightweight network and HTTP monitoring system, designed to be run with containers & Kubernetes
Go
2
star
61

serverless-fractal-bot

Fractals done in serverless and then tweeted to the world
JavaScript
2
star
62

tomb-viewer

Rendering Tomb Raider levels in TypeScript and WebGL
TypeScript
1
star
63

taskr

Demonstrator for Static Web Apps with Functions and Cosmos DB
JavaScript
1
star
64

project-starter

A base template to be used for any project
Makefile
1
star
65

cassandra-prototype

Experimenting with Cassandra
Shell
1
star
66

food-truck

Food Truck Challenge
Go
1
star
67

hivealive

IoT on Azure Proof Of Concept
JavaScript
1
star
68

gitops-test

Shell
1
star
69

mockery

API Server Mocking in Go
Go
1
star
70

azure-iot-demo

Azure IoT Demo using IoT Hubs, Service Bus and Functions
JavaScript
1
star
71

nanotracker

Retro styled music tracker in HTML5 & modern JavaScript
JavaScript
1
star
72

cse-onboarding

CSE Tech On-Boarding FY23
1
star
73

go-acs-client

Client SDK for the Azure Communication Services API
Go
1
star
74

htmx-go-todo

An example of a simple HTMX app built using Go
Go
1
star
75

skytap-ansible

Skytap module for Ansible with some example playbooks
Python
1
star
76

dapr-gateway-hack

Experiment and hack for Dapr service invocation across networks and clusters
Go
1
star
77

gh-experiment

1
star
78

fractal-bot-go

Fractals & Twitter bot done with Azure Functions and Go custom handlers
Go
1
star
79

dotfiles-kit

Build your own dotfiles repo
Shell
1
star
80

grpc-experiment

Go
1
star
81

benc.dev

blog & personal/vanity site
HTML
1
star
82

gsots3d

Library for building & rendering 3D stuff on the web
JavaScript
1
star
83

rust-wasm-fractals

Mandelbrot & Julia fractals rendered with Rust with WASM & JS
JavaScript
1
star
84

nodejs-api-starter

Starter template app for a Node.js CRUD REST API using MongoDB & Mongoose
JavaScript
1
star
85

link-shortener

Link & URL shortener
Shell
1
star