We recommend using Azure Native.
Azure v6.21.0 published on Friday, Mar 7, 2025 by Pulumi
azure.core.getLocation
Explore with Pulumi AI
Use this data source to access information of a specific physical location.
Example Usage
import * as pulumi from "@pulumi/pulumi";
import * as azure from "@pulumi/azure";
const example = azure.core.getLocation({
    location: "West Europe",
});
import pulumi
import pulumi_azure as azure
example = azure.core.get_location(location="West Europe")
package main
import (
	"github.com/pulumi/pulumi-azure/sdk/v6/go/azure/core"
	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
func main() {
	pulumi.Run(func(ctx *pulumi.Context) error {
		_, err := core.GetLocation(ctx, &core.GetLocationArgs{
			Location: "West Europe",
		}, nil)
		if err != nil {
			return err
		}
		return nil
	})
}
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Azure = Pulumi.Azure;
return await Deployment.RunAsync(() => 
{
    var example = Azure.Core.GetLocation.Invoke(new()
    {
        Location = "West Europe",
    });
});
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.azure.core.CoreFunctions;
import com.pulumi.azure.core.inputs.GetLocationArgs;
import java.util.List;
import java.util.ArrayList;
import java.util.Map;
import java.io.File;
import java.nio.file.Files;
import java.nio.file.Paths;
public class App {
    public static void main(String[] args) {
        Pulumi.run(App::stack);
    }
    public static void stack(Context ctx) {
        final var example = CoreFunctions.getLocation(GetLocationArgs.builder()
            .location("West Europe")
            .build());
    }
}
variables:
  example:
    fn::invoke:
      function: azure:core:getLocation
      arguments:
        location: West Europe
Using getLocation
Two invocation forms are available. The direct form accepts plain arguments and either blocks until the result value is available, or returns a Promise-wrapped result. The output form accepts Input-wrapped arguments and returns an Output-wrapped result.
function getLocation(args: GetLocationArgs, opts?: InvokeOptions): Promise<GetLocationResult>
function getLocationOutput(args: GetLocationOutputArgs, opts?: InvokeOptions): Output<GetLocationResult>def get_location(location: Optional[str] = None,
                 opts: Optional[InvokeOptions] = None) -> GetLocationResult
def get_location_output(location: Optional[pulumi.Input[str]] = None,
                 opts: Optional[InvokeOptions] = None) -> Output[GetLocationResult]func GetLocation(ctx *Context, args *GetLocationArgs, opts ...InvokeOption) (*GetLocationResult, error)
func GetLocationOutput(ctx *Context, args *GetLocationOutputArgs, opts ...InvokeOption) GetLocationResultOutput> Note: This function is named GetLocation in the Go SDK.
public static class GetLocation 
{
    public static Task<GetLocationResult> InvokeAsync(GetLocationArgs args, InvokeOptions? opts = null)
    public static Output<GetLocationResult> Invoke(GetLocationInvokeArgs args, InvokeOptions? opts = null)
}public static CompletableFuture<GetLocationResult> getLocation(GetLocationArgs args, InvokeOptions options)
public static Output<GetLocationResult> getLocation(GetLocationArgs args, InvokeOptions options)
fn::invoke:
  function: azure:core/getLocation:getLocation
  arguments:
    # arguments dictionaryThe following arguments are supported:
- Location string
- Specifies the supported Azure location where the resource exists.
- Location string
- Specifies the supported Azure location where the resource exists.
- location String
- Specifies the supported Azure location where the resource exists.
- location string
- Specifies the supported Azure location where the resource exists.
- location str
- Specifies the supported Azure location where the resource exists.
- location String
- Specifies the supported Azure location where the resource exists.
getLocation Result
The following output properties are available:
- DisplayName string
- The display name of the location.
- Id string
- The provider-assigned unique ID for this managed resource.
- Location string
- ZoneMappings List<GetLocation Zone Mapping> 
- A zone_mappingsblock as defined below.
- DisplayName string
- The display name of the location.
- Id string
- The provider-assigned unique ID for this managed resource.
- Location string
- ZoneMappings []GetLocation Zone Mapping 
- A zone_mappingsblock as defined below.
- displayName String
- The display name of the location.
- id String
- The provider-assigned unique ID for this managed resource.
- location String
- zoneMappings List<GetLocation Zone Mapping> 
- A zone_mappingsblock as defined below.
- displayName string
- The display name of the location.
- id string
- The provider-assigned unique ID for this managed resource.
- location string
- zoneMappings GetLocation Zone Mapping[] 
- A zone_mappingsblock as defined below.
- display_name str
- The display name of the location.
- id str
- The provider-assigned unique ID for this managed resource.
- location str
- zone_mappings Sequence[GetLocation Zone Mapping] 
- A zone_mappingsblock as defined below.
- displayName String
- The display name of the location.
- id String
- The provider-assigned unique ID for this managed resource.
- location String
- zoneMappings List<Property Map>
- A zone_mappingsblock as defined below.
Supporting Types
GetLocationZoneMapping   
- LogicalZone string
- The logical zone id for the availability zone
- PhysicalZone string
- The fully qualified physical zone id of availability zone to which logical zone id is mapped to
- LogicalZone string
- The logical zone id for the availability zone
- PhysicalZone string
- The fully qualified physical zone id of availability zone to which logical zone id is mapped to
- logicalZone String
- The logical zone id for the availability zone
- physicalZone String
- The fully qualified physical zone id of availability zone to which logical zone id is mapped to
- logicalZone string
- The logical zone id for the availability zone
- physicalZone string
- The fully qualified physical zone id of availability zone to which logical zone id is mapped to
- logical_zone str
- The logical zone id for the availability zone
- physical_zone str
- The fully qualified physical zone id of availability zone to which logical zone id is mapped to
- logicalZone String
- The logical zone id for the availability zone
- physicalZone String
- The fully qualified physical zone id of availability zone to which logical zone id is mapped to
Package Details
- Repository
- Azure Classic pulumi/pulumi-azure
- License
- Apache-2.0
- Notes
- This Pulumi package is based on the azurermTerraform Provider.