Tutorial

Preview

Sign in during Public Preview to get the Team plan free, plus an early-adopter discount when we launch. Sign in

Tutorial

In this tutorial you'll create a Storage Account, upload a file to it, and then see that file in the Storage Emulator. You'll use the same az commands you'd run against Azure, prefixed with locally run.

Note

Everything here runs on your machine. Nothing reaches Azure, so there's nothing to clean up in the cloud afterwards.

Before you start

Install and set up Locally by following Getting Started, then start it with locally build and leave it running in its own terminal.

1. Create a resource group

Locally uses its own region names, so a command meant for Locally can't accidentally create resources in Azure. We'll use london (see Locations & Regions for the full list):

$ locally run az group create --name quickstart-rg --location london

2. Create a Storage Account

This is the same command you'd run against Azure. Locally creates the account and starts a Storage Emulator for it:

$ locally run az storage account create --name quickstartstorage --resource-group quickstart-rg --location london --sku Standard_LRS

3. Create a container

Locally has its own commands for everyday data plane tasks, like creating a container:

$ locally storage container create --account quickstartstorage --name files

4. Upload a file

Create a small file, then upload it to the container:

$ echo 'hello from Locally' > hello.txt $ locally run az storage blob upload --account-name quickstartstorage --container-name files --name hello.txt --file hello.txt --auth-mode login

--auth-mode login uploads as the identity locally run signs you in with, rather than with the account's access key - the same approach we'd recommend against Azure.

5. See it in the Storage Emulator

Open the Storage Emulator for your Storage Account:

$ locally storage dashboard --account quickstartstorage

Select the files container and you'll see hello.txt. Open its Actions menu and select View to see hello from Locally.

You can also get there from the Locally Dashboard: go to Resources, select quickstartstorage, then choose Blob from Endpoints for this Service.

Locally or Azure

locally run points the command after it at Locally. Leave the prefix off and the same command runs against Azure - you'll just need an Azure region in place of london.

It works the same way for Terraform, Pulumi, PowerShell and the other tools Automatic Configuration supports, so switching between Locally and Azure looks the same whichever you use.

Next steps

The Storage Emulator page covers what else it can do, like file shares, queues and tables.

The Guides show how to use Locally with Terraform, Bicep, Pulumi, the Azure SDKs and more, and the Examples are ready to run.

Preview

Sign in during Public Preview to get the Team plan free, plus an early-adopter discount when we launch. Sign in

A local cloud for you and your agents.

Your Azure infrastructure, running on your machine. Deploy in seconds, break things freely, and ship to Azure when you're ready.