Quickstart

Get started with LocalStack for Azure in a few simple steps

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

Instructions

Before you begin, pull the Azure emulator image (localstack/azure // TODO) and start the container:

$ export LOCALSTACK_AUTH_TOKEN=<your_auth_token>
$ IMAGE_NAME=localstack/azure:latest localstack start // TODO

Setup the authentication

To authenticate with the Azure emulator, run the following command:

$ azlocal login

You don’t need to provide real credentials because the Azure emulator doesn’t connect to the real Azure cloud.

The following output would be displayed:

[
  {
    "cloudName": "AzureCloud",
    "homeTenantId": "some-other-generated-id",
    "id": "some-generated-id",
    "isDefault": true,
    "managedByTenants": [],
    "name": "Azure subscription 1",
    "state": "Enabled",
    "tenantId": "any-tenant",
    "user": {
      "name": "any-app",
      "type": "servicePrincipal"
    }
  }
]

Create a resource group

To create a resource group, run the following command:

$ azlocal group create --name MyResourceGroup --location westeurope

The 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

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

$ azlocal group show --name MyResourceGroup

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

$ azlocal group list

Delete the resource group

To delete the resource group, run the following command:

$ azlocal group delete --name MyResourceGroup --yes