---
display_name: Azure Region
description: A parameter with human region names and icons
icon: ../.icons/azure.svg
maintainer_github: coder
verified: true
tags: [helper, parameter, azure, regions]
---

# Azure Region

This module adds a parameter with all Azure regions, allowing developers to select the region closest to them.

```hcl
module "azure_region" {
    source = "https://registry.coder.com/modules/azure-region"
    default = "eastus"
}

resource "azurem_resource_group" "example" {
    location = module.azure_region.value
}
```

![Azure Region Default](../.images/azure-default.png)

## Examples

### Customize existing regions

Change the display name and icon for a region using the corresponding maps:

```hcl
module "azure-region" {
    source = "https://registry.coder.com/modules/azure-region"
    custom_names = {
        "australia": "Go Australia!"
    }
    custom_icons = {
        "australia": "/icons/smiley.svg"
    }
}

resource "azurerm_resource_group" "example" {
    location = module.azure_region.value
}
```

![Azure Region Custom](../.images/azure-custom.png)

### Exclude Regions

Hide all regions in Australia except australiacentral:

```hcl
module "azure-region" {
    source = "https://registry.coder.com/modules/azure-region"
    exclude = [
        "australia",
        "australiacentral2",
        "australiaeast",
        "australiasoutheast"
    ]
}

resource "azurerm_resource_group" "example" {
    location = module.azure_region.value
}
```

![Azure Exclude](../.images/azure-exclude.png)

## Related templates

For a complete Azure template, see the following examples in the [Coder Registry](https://registry.coder.com/).

- [Azure VM (Linux)](https://registry.coder.com/templates/azure-linux)
- [Azure VM (Windows)](https://registry.coder.com/templates/azure-windows)
