azure-tenant-isolation

Isolate Azure CLI and AZD token state per tenant with verify-before-destructive-operation checks.

5|2|Updated Apr 28, 2026
One-click install
npx skills add https://github.com/aiappsgbb/awesome-gbb --skill azure-tenant-isolation
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: azure-tenant-isolation
Source: https://github.com/aiappsgbb/awesome-gbb/tree/main/skills/azure-tenant-isolation
Command: npx skills add https://github.com/aiappsgbb/awesome-gbb --skill azure-tenant-isolation

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

This Skill prevents developers from accidentally deploying to the wrong Azure tenant or subscription when running multiple concurrent terminals, scripts, or agent sessions on the same machine.

Core Features & Use Cases

  • Per-tenant isolation for Azure CLI and AZD: Forces tenant-scoped state via AZURE_CONFIG_DIR and AZD_CONFIG_DIR, avoiding shared ~/.azure and ~/.azd collisions.
  • Verify-before-act guardrails: Requires an explicit tenant + subscription assertion immediately before any destructive action like azd up, azd deploy, az deployment ... create, az group create, or deletes.
  • Index-driven tenant selection: Uses a personal JSON tenant index (optionally overridden by AZURE_TENANT_INDEX) to map aliases to tenant IDs, config directories, and allowed subscriptions.
  • Safe auth behavior: Enforces az login --tenant <id> and azd auth login --tenant-id <id>, and avoids re-login when tokens are already valid.

Quick Start

Set AZURE_CONFIG_DIR and AZD_CONFIG_DIR from the tenant index alias you want, then run your azd up workflow only after the tenant+subscription assertion passes.

Frequently Asked Questions about azure-tenant-isolation

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I prevent accidental cross-tenant Azure deployments when running multiple terminals?

Preventing cross-tenant Azure deployments involves isolating token and configuration state per tenant using dedicated AZURE_CONFIG_DIR and AZD_CONFIG_DIR paths, and enforcing a verify-before-destructive-operation check using az account show.

How does tenant isolation work for concurrent Azure CLI and AZD sessions?

Tenant isolation for concurrent Azure CLI and AZD sessions works by mapping context aliases to specific tenant IDs and allowed subscriptions via an index file, forcing logins like az login --tenant <id> to avoid shared ~/.azure and ~/.azd token collisions.

How to configure an alias-driven tenant index for Azure subscription isolation?

Configuring an alias-driven tenant index for Azure subscription isolation requires creating a personal JSON file mapping aliases to tenant IDs, config directories, and allowed subscriptions, which can optionally be overridden using the AZURE_TENANT_INDEX environment variable.

Do I need to re-login to Azure CLI if my tenant token is already valid?

You do not need to re-login to Azure CLI if your tenant token is already valid, as the safe auth behavior enforces az login --tenant <id> only when necessary and skips authentication when existing tokens remain active.

What Azure CLI destructive operations require an explicit tenant and subscription assertion?

Azure CLI destructive operations requiring an explicit tenant and subscription assertion include azd up, azd deploy, az deployment ... create, az group create, and any delete commands, ensuring an immediate verify-before-act guardrail.

Can I use this tenant isolation approach for CI steps and agent workflows?

You can use this tenant isolation approach for CI steps and agent workflows that call az or azd for deployment actions in multi-tenant development environments, preventing cross-subscription mistakes during concurrent terminal automation.