Quickstart
Introduction
Section titled “Introduction”This guide explains how to set up the Azure emulator and interact with it using the az CLI.
In this guide, you will run some basic Azure CLI commands to manage resource groups in an local Azure development environment without connecting to the real cloud services.
Prerequisites
Section titled “Prerequisites”lstk- Azure CLI (
az) - A LocalStack account with a license that covers Azure usage —
lstkhandles authentication for you (see Authentication)
Instructions
Section titled “Instructions”Start the Azure emulator:
$ lstk startFor more installation details, see the installation instructions.
Set up the az CLI integration
Section titled “Set up the az CLI integration”To make sure the az tool sends requests to the Azure Emulator REST API, run the following command:
$ lstk az start-interceptionCreate a resource group
Section titled “Create a resource group”To create a resource group, you can now run the same az command as you would normally:
$ az group create --name myResourceGroup --location westeuropeThe following output would be displayed:
{ "id": "/subscriptions/some-generated-id/resourceGroups/myResourceGroup", "location": "westeurope", "managedBy": null, "name": "myResourceGroup", "properties": { "provisioningState": "Succeeded" }, "tags": null, "type": "Microsoft.Resources/resourceGroups"}Check & list resource groups
Section titled “Check & list resource groups”To check the resource group details, run the following command:
$ az group show --name myResourceGroupTo list all the resource groups, run the following command:
$ az group listDelete the resource group
Section titled “Delete the resource group”To delete the resource group, run the following command:
$ az group delete --name myResourceGroup --yesTeardown
Section titled “Teardown”When you’re done, disable interception and stop the emulator:
$ lstk az stop-interception$ lstk stopAlternative: prefixed commands
Section titled “Alternative: prefixed commands”Instead of interception, you can prefix each az command with lstk az individually, without changing your global ~/.azure configuration. Run this once to prepare the integration:
$ lstk setup azureThen prefix every command:
$ lstk az group create --name myResourceGroup --location westeurope$ lstk az group show --name myResourceGroup$ lstk az group list$ lstk az group delete --name myResourceGroup --yes