Understanding Azure Availability Zone Mappings for Subscriptions

By John Savill's Technical Training

Share:

Key Concepts

  • Region: A geographical area where Azure resources are hosted.
  • Availability Zone (AZ): A distinct physical location within an Azure region, with independent power, cooling, networking, and control plane.
  • Physical Data Center Sets: The actual, distinct physical groupings of data centers within a region.
  • Subscription: An Azure account that acts as a billing boundary and a logical container for resources.
  • Logical AZ: The AZ designation (e.g., A1, A2, A3) as seen within a specific Azure subscription.
  • Physical AZ: The actual physical set of data centers that a logical AZ maps to within a region.
  • Proximity Placement Group: An Azure feature to guarantee proximity between VMs within the same data center.
  • Capacity Reservation: A feature to reserve compute capacity for specific VM SKUs in a particular AZ.
  • PowerShell: A command-line shell and scripting language from Microsoft.
  • Azure CLI: A command-line interface for managing Azure resources.

Mapping of Subscription Availability Zones to Physical Data Center Sets

This video explains the concept of mapping logical Availability Zones (AZs) within an Azure subscription to the actual physical sets of data centers that constitute an Azure region.

1. Understanding Azure Regions and Availability Zones

  • Region: A geographical area containing multiple distinct sets of data centers.
  • Physical Data Center Sets: Within a region, there are physically separate data center groupings, each with independent power, cooling, networking, and control plane. These are referred to as physical AZs (e.g., physical A1, A2, A3).
  • Logical AZs: Within a specific Azure subscription, you see AZs designated as A1, A2, A3, etc. These are logical representations.

2. The Mapping Discrepancy Between Subscriptions

  • The core concept is that the logical AZs (A1, A2, A3) within one subscription might not map to the same physical data center sets as the logical AZs in another subscription within the same region.
  • Example: For Region X (e.g., East US):
    • Subscription One: Logical A1 might map to Physical A2, Logical A2 to Physical A3, and Logical A3 to Physical A1.
    • Subscription Two: Logical A1 might map to Physical A1, Logical A2 to Physical A3, and Logical A3 to Physical A2.
  • Reason for Mixing: This mapping is intentionally mixed across subscriptions to help even out the usage of capacity at the physical data center level within a region.

3. When Mapping Alignment Matters

  • General Use Case: Normally, the specific physical mapping doesn't matter for most resource deployments (like VMs) because AZs themselves don't guarantee strict proximity. For guaranteed proximity between resources within a subscription, a Proximity Placement Group is used.
  • Specific Scenarios:
    • Sharing Resources Across Subscriptions: When sharing resources like Capacity Reservations between subscriptions, understanding the physical mapping is crucial.
    • Working with Microsoft on Capacity: In certain specialized capacity scenarios, Microsoft might refer to physical AZs, requiring knowledge of your subscription's mapping.
    • Example: Capacity Reservations: If you have a capacity reservation for a specific VM SKU in Subscription One's logical A3, and this maps to Physical A1, and you want to share this reservation with Subscription Two, where logical A1 maps to Physical A2, you need to know this to correctly utilize the reservation. You would need to understand that Subscription Two's logical A1 is not the same physical location as Subscription One's logical A1.

4. Tools for Querying the Mapping

  • Microsoft Documentation: Provides information on how to query this mapping.
  • Azure CLI: Offers methods to retrieve the mapping.
  • PowerShell: Also provides cmdlets to query the mapping between logical and physical AZs for a given subscription.

5. Custom PowerShell Script for Enumerating Mappings

The presenter demonstrates a custom PowerShell script designed to:

  • Functionality: Enumerate AZ mappings for specified regions across all accessible Azure subscriptions.
  • Parameters:
    • Regions: Takes one or more region names (e.g., "East US", "West US2").
    • Dash Raw: An optional parameter to output the raw custom object array instead of a formatted table.
  • Process:
    1. Log in to Azure using Connect-AzAccount.
    2. Get the list of specified regions.
    3. Retrieve a list of all accessible subscriptions.
    4. Iterate through each subscription:
      • Set the current subscription context.
      • Get the list of logical AZs used in that subscription.
      • For each matched region, iterate through the AZ mappings.
      • Identify which logical AZ in the subscription maps to which physical AZ (1, 2, or 3).
      • Create a custom object containing: Subscription Name, Subscription ID, Region Name, Region Display Name, and the logical-to-physical AZ mapping.
    5. Output:
      • By default, outputs a table ordered by region name, then subscription, showing subscription details and the logical to physical AZ mapping.
      • With -Raw, returns the array of custom objects for further processing.

6. Script Demonstration and Usage

  • The script is loaded into the PowerShell session.
  • It's executed with Read-AzureAZ -Regions "East US", "West US2".
  • The output shows the mapping for each subscription in the specified regions, highlighting how the logical AZs differ across subscriptions.
  • The -Raw parameter is demonstrated, storing the output in a variable. This variable can then be piped to other commands for custom sorting or formatting, offering flexibility. For example, sorting by region name and then formatting as a table with specific columns.

7. Conclusion and Takeaways

  • The video provides a practical solution for understanding the mapping between subscription-level logical AZs and physical data center sets.
  • This knowledge is essential for scenarios involving cross-subscription resource sharing, particularly for features like capacity reservations, and for collaborating with Microsoft on specific capacity needs.
  • The provided PowerShell script offers an automated way to retrieve and analyze this mapping across multiple subscriptions and regions.

Chat with this Video

AI-Powered

Hi! I can answer questions about this video "Understanding Azure Availability Zone Mappings for Subscriptions". What would you like to know?

Chat is based on the transcript of this video and may not be 100% accurate.

Related Videos

Ready to summarize another video?

Summarize YouTube Video