1.0.18 • Published 3 years ago

az-ts v1.0.18

Weekly downloads
1
License
ISC
Repository
-
Last release
3 years ago

This project is a work in progress


az-ts

This ambitious project aims to be a full 1 to 1 typescript replacement for the existing azure cli.

create a webapp with az-ts

Why

The azure-cli is great, but when creating infrastructure deployment scripts, it's not always the smoothest experience bouncing back and forth between the interactive cli and your code.

Typescript provides an experience that makes the cli easier to explore from within your code.

Features

Fully typed easy to explore command heirarchy

get storage account connection strings with az-ts

Fully typed responses from the azure cli

fully typed responses from the cli

Installation & Usage

You will need to have the az cli installed, and accessible via the command az.

(If you currently run the cli from docker, or specify a command path to the cli, you will need to create an alias as this project attempts to use az on your behalf. Specifiying a path or a command to use is on the todo list.)

Install the project locally

npm install --save az-ts@latest

Install the project globally to run the az-ts command

npm install -g az-ts@latest

Now you can create a new typescript file, and import az;

/* create-webapp.ts */

import az from "az-ts";

// create an app service plan
az.appservice.plan
  .create("appServicePlanName", "resourceGroupName")
  .sku("F1")
  .location("canadacentral")
  .execute();

// create the webapp
az.webapp
  .create("webappName", "appServicePlanName", "resourceGroupName")
  .execute();

// allow the webapp to access other resources by using a system managed identity
az.webapp.identity
  .assign()
  .name("webappName")
  .resourceGroup("resourceGroupName")
  .identities("[system]")
  .execute();

Now you can log in to azure via the cli, and run az-ts on your typescript file

az login

az-ts ./create-webapp.ts
1.0.18

3 years ago

1.0.17

3 years ago

1.0.16

3 years ago

1.0.15

3 years ago

1.0.14

3 years ago

1.0.13

3 years ago

1.0.12

4 years ago

1.0.11

4 years ago

1.0.10

4 years ago

1.0.9

4 years ago

1.0.8

4 years ago

1.0.7

4 years ago

1.0.6

4 years ago

1.0.5

4 years ago

1.0.4

4 years ago

1.0.3

4 years ago

1.0.2

4 years ago

1.0.1

4 years ago

1.0.0

4 years ago