Skip to content

Latest commit

 

History

History
168 lines (116 loc) · 4.3 KB

AzureGettingStarted.md

File metadata and controls

168 lines (116 loc) · 4.3 KB
id title
AzureGettingStarted
Azure Getting Started

This document describes how to get started with GruCloud on Azure.

import TOCInline from '@theme/TOCInline';

Use Cases

usecase.svg

Workflow

gc-new-workflow

Requirement

Azure Account

Visit the azure portal and ensure you have an azure account as well as a subscription.

Azure CLI

Install the Azure Command-Line Interface az from here

At this point, ensure the az command is installed:

az --version

Installing the GruCloud CLI

The GruCloud CLI, gc, is written in Javascript running on Node.js

Install it globally with:

npm i -g @grucloud/core

gc-cli-install.svg

GruCloud CLI commands

gc new Create a new project

Use the new command to create a new project:

gc-new-azure

<iframe data-autoplay src="https://asciinema.org/a/MFw0YToJlA6BpFgUU3LY2LA1D/iframe?autoplay=true&speed=2&loop=true" id="asciicast-iframe-13761" name="asciicast-iframe-13761" scrolling="no" style={{ width: "100%", height: "500px" }} ></iframe>

The boilerplate project is now created and configured.

gc list List the live resources

Visualize your current infrastructure with the list command:

gc list --graph
<iframe data-autoplay src="https://asciinema.org/a/zbXkGiXBdDwOXHCJtKvttxv9z/iframe?autoplay=true&speed=1&loop=true" id="asciicast-iframe-13761" name="asciicast-iframe-13761" scrolling="no" style={{ width: "100%", height: "700px" }} ></iframe>

diagram-live.svg

gc gencode Generate the code

The gencode command fetches the live resources and generate the code in resource.js

gc gencode

The following flowchart explains in more detail the process of generating the code from the live infrastructure.

gc-gencode.svg

<iframe data-autoplay src="https://asciinema.org/a/MyAIWObbcxVXLMaBA2A05u3y4/iframe?autoplay=true&speed=1&loop=true" id="asciicast-iframe-13762" name="asciicast-iframe-13762" scrolling="no" style={{ width: "100%", height: "700px" }} ></iframe>

gc graph Target Graph

The graph command creates a dependency graph of the target resources:

gc graph

diagram-live.svg

The graph command requires graphviz to convert the generated artifacts/diagram-target.dot into an image such as artifacts/diagram-target.svg

gc apply Update the resources

To update the infrastructure, either use the Azure portal and run gc gencode, or modify directly the file resource.js. Once done, use the apply command to update the infrastructure:

gc apply
<iframe data-autoplay src="https://asciinema.org/a/X8nXfxNUnAKVPTORfPRggDbP0/iframe?autoplay=true&speed=1&loop=true" id="asciicast-iframe-13763" name="asciicast-iframe-13763" scrolling="no" style={{ width: "100%", height: "800px" }} ></iframe>

gc destroy Destroy the resources

To destroy the infrastructure, use the destroy command:

gc destroy
<iframe data-autoplay src="https://asciinema.org/a/2pQiYTgZgQD776G077qOHBU64/iframe?autoplay=true&speed=1&loop=true" id="asciicast-iframe-13764" name="asciicast-iframe-13764" scrolling="no" style={{ width: "100%", height: "900px" }} ></iframe>

Next Steps