Real Subscriptions, a Real Tenant and Real Credentials

Preview

During Public Preview you can use the Team plan for free, and get an early-adopter discount at GA. Sign in

Real Subscriptions, a Real Tenant and Real Credentials

Available on Starter Standard Team Compare plans →

Locally gives you real Subscriptions, in a real tenant, with real users - and so real credentials, with role-based access control enforced on every request. The number of Subscriptions, Management Groups and Tenants you can have depends on your plan: one of each on Starter, three of each on Standard, and as many as you need on Team.

Using realistic values means you can catch parsing and configuration errors earlier. For example, if a bug in how your code reads the Subscription ID leaves you with an empty UUID (00000000-0000-0000-0000-000000000000, or Guid.Empty in .NET), that fails against Locally straight away - rather than going unnoticed until you deploy.

Automatic Configuration wires all of this into your tooling for you, so there's nothing to copy into a config file.

A Subscription for each agent

Having more than one Subscription means you can give each of your AI agents its own Subscription to work in - so they don't clobber each other's resources. You can choose which Subscription is used by passing --subscription to locally run:

$ locally run --subscription "Second Subscription" terraform apply

And since role assignments are enforced, you can also run each agent as its own service principal (using --service-principal) with access to just its own Subscription - and test the role assignments your application relies on for real.

Subscriptions

Each Subscription has its own UUID, generated when you first set up Locally - so its resource ID, and the IDs of everything within it, look exactly as they would in Azure. You can see your Subscriptions at any time with:

$ locally subscriptions list

When you have more than one, Locally passes their IDs to Terraform and OpenTofu as the primary_subscription_id, secondary_subscription_id and ternary_subscription_id variables - so you can test configurations which span multiple Subscriptions without hard-coding any IDs. See Automatic Configuration for how to use these in your provider blocks.

Tenant and credentials

Your Subscriptions sit within a Tenant (default.tenants.locally), which has its own Users, Groups and Service Principals via the Directory (Entra) Emulator.

By default you authenticate as the Default Identity, which has Owner rights over everything in Locally - but you can also create your own identities, or use one of the existing ones, with real permissions and role assignments. Credentials expire and can be refreshed too, so you can test token caching and renewal as needed.

Management Groups

Available on Starter Standard Team Compare plans →

Management Groups organise Subscriptions into a hierarchy under the Tenant's root group, so policies and role assignments can apply to many Subscriptions at once. Create them with the Azure CLI, Terraform or an ARM Template, or from the Management Groups tab on the Subscriptions page in the Locally Dashboard:

$ locally run az account management-group create --name platform --display-name Platform

Management Groups can be nested, and Subscriptions moved between them:

$ locally run az account management-group subscription add --name platform --subscription <subscription-id> Screenshot of the Platform Management Group in the Locally Dashboard, showing its place under the Tenant Root Group and the Workloads group nested within it

Policies and role assignments can be assigned at a Management Group, templates can be deployed into one, and the Activity Log records what happens at Management Group and Tenant scope.

You can have one Management Group on Starter, three on Standard, and as many as you need on Team.

Heads up

This feature is under active development and may contain bugs or incomplete functionality.

Tenants

Available on Starter Standard Team Compare plans →

Alongside the default Tenant, you can create more from the Tenants tab on the Subscriptions page. A Tenant is a permissions boundary, and holds its own Subscriptions and Management Groups. Each Tenant gets its own domain under tenants.locally, based on its name, and once there's more than one, creating a Subscription asks which Tenant it belongs to.

Starter has just the default Tenant. You can have three Tenants on Standard, and as many as you need on Team.

Screenshot of the Default Tenant in the Locally Dashboard, showing its domain, its ID and the Management Groups within it

Heads up

This feature is under active development and may contain bugs or incomplete functionality.

Signing in as Users and Service Principals

When you sign in interactively - for example using InteractiveBrowserCredential, or to an application using single sign-on - Locally shows its own sign-in page, where you can choose which identity to sign in as. Use Default Identity signs you in with a single click:

Screenshot of the Locally sign-in page

Or you can sign in as any of the users or service principals in the directory - with or without their password. That's deliberate: Locally only listens on your machine, and its directory is there for testing, so it's designed to make switching identity quick rather than to keep anyone out:

Screenshot of choosing a Directory user on the Locally sign-in page

Sign-in Options also lets you set the location, device and risk signals for the sign-in - so you can test your Conditional Access policies.

From the command line, you can run a command as a specific identity by passing --user, --service-principal or --managed-identity to locally run - and Locally takes care of signing in for you:

$ locally run --user [email protected] terraform apply

The command only sees the Subscriptions that identity has access to, and can only do what its role assignments allow - so you can check that a user with Reader can't make changes, for example.

Role-based access control

Locally includes the built-in role definitions - so you can assign roles such as Owner, Contributor or Reader using the tools you already use (such as the Azure CLI, Terraform or an ARM Template), at the same scopes you would in Azure.

Role assignments are enforced on every request - so an identity with Reader can read but not write, and gets the same AuthorizationFailed error it would in Azure. This means you can find missing permissions while you're developing, rather than after you've deployed.

If you'd rather not deal with role assignments yet, the Ignore RBAC Permissions? feature flag turns these checks off in the Control Plane API, so any authenticated principal is allowed. It's off by default.

Once your application's working, Minimum Necessary Permissions can generate a role definition containing just the permissions it used - so it doesn't need to be granted Owner or Contributor.

Resource Providers

Each Subscription has Resource Providers registered against it. Every provider whose plugin is installed is registered in every Subscription to start with, and a Subscription can only use the providers registered in it.

You can register and unregister them using the tools you already use, or from the Resource Providers tab on a Subscription's page in the Locally Dashboard:

$ locally run az provider register --namespace Microsoft.Storage
  • Registering a provider whose plugin isn't installed installs it, if your plan includes it - the provider shows as Registering until the plugin's ready.
  • Unregistering a provider only affects that Subscription, and Locally remembers it until you restart. You can't unregister a provider that's built into Locally, or one the Subscription still has resources for.
  • Template deployments register the providers they need before deploying anything - so deploying a template can install a plugin too.

Should you encounter any issues, please take a look at the troubleshooting section, reach out in our Discord or open an issue and we'll take a look.

Preview

During Public Preview you can use the Team plan for free, and get an early-adopter discount at GA. Sign in

A local cloud for you and your AI agents.

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