Skip to content

Latest commit

 

History

History
78 lines (47 loc) · 3.94 KB

az-hack.md

File metadata and controls

78 lines (47 loc) · 3.94 KB

az hack

az hack is a command-line utility for quickly bootstrapping Azure resources commonly used for a student hack project. With az hack create you will be able to spin up and configure databases, web hosting, and even artificial intelligence.

Provisioned resources

All resources are placed in the same resource group

Pricing Note: The database and Cognitive Services keys may incur charging. Please consult the documentation for up-to-date pricing information.

Configuration notes

All generated passwords, keys, and names will be displayed on the screen upon completion of the command. In addition, all values are stored as environmental variables in the website, and can be accessed in your application as such.

Note: You may want to consider using a package such as Node dotenv, python-dotenv, dotenv.net or PHP dotenv to simplify managing environmental variables for your application.

Installation

az hack is an Azure Command Line Interface (CLI) extension, and is designed to be run locally.

Installation Steps

  1. Install Python
  2. Install Azure CLI
  3. Login
az login
  1. Install the hack extension
az extension add --name hack

Usage

Command

az hack create --name
           --database {mysql, sql, cosmosdb}
           --runtime {python, tomcat, jetty, php, aspnet, node}
           --location
           [--ai]

Parameters

name

Base name of the application. Must be 10 characters or less. A random set of characters will be placed at the end to ensure uniqueness.

database

Type of database to create - cosmosdb (for Mongo API), mysql, or sql

Note for MySQL If you are using Azure Databases for MySQL, you will need to enable SSL for your application to connect

Note about firewalls By default, the firewall for SQL or MySQL will be configured to only allow resources on Azure to connect to your database. To enable your local system to connect, you will need to add your IP address to the MySQL firewall rules or SQL firewall rules. You can determine your systems public IP address by using a search engine and searching "What is my IP".

runtime

Runtime or framework for website - tomcat or jetty for Java, php, python, aspnet, node

location

Region for the application. See full list by using az location list

ai

(Optional) Creates a key for use with Cognitive Services