Skip to content
Get Started for Free

Quickstart

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.

Start the Azure emulator:

$ lstk start

For more installation details, see the installation instructions.

To make sure the az tool sends requests to the Azure Emulator REST API, run the following command:

$ lstk az start-interception

To create a resource group, you can now run the same az command as you would normally:

$ az group create --name myResourceGroup --location westeurope

The following output would be displayed:

Terminal window
{
"id": "/subscriptions/some-generated-id/resourceGroups/myResourceGroup",
"location": "westeurope",
"managedBy": null,
"name": "myResourceGroup",
"properties": {
"provisioningState": "Succeeded"
},
"tags": null,
"type": "Microsoft.Resources/resourceGroups"
}

To check the resource group details, run the following command:

$ az group show --name myResourceGroup

To list all the resource groups, run the following command:

$ az group list

To delete the resource group, run the following command:

$ az group delete --name myResourceGroup --yes

When you’re done, disable interception and stop the emulator:

$ lstk az stop-interception
$ lstk stop

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 azure

Then 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
Was this page helpful?