# AzureEnvironmentResource.WithLocation

- Module: [Aspire.Hosting.Azure](/reference/api/go/aspire.hosting.azure.md)
- Defined on: [AzureEnvironmentResource](/reference/api/go/aspire.hosting.azure/azureenvironmentresource.md)
- Version: `17.0.0`
- Kind: `method`

Sets the location of the Azure environment resource.

## Remarks

This method is used to set the location of the Azure environment resource.
The location is used to determine where the resources will be deployed.

## Definition

```go
type AzureEnvironmentResource interface {
    // ... omitted for brevity
    WithLocation(location ParameterResource) AzureEnvironmentResource
}
```

## Signature

```go
WithLocation(location ParameterResource) AzureEnvironmentResource
```

## Parameters

- `location` (`ParameterResource`) -- The Azure location.

## Returns

[`AzureEnvironmentResource`](/reference/api/go/aspire.hosting.azure/azureenvironmentresource.md) -- The resource builder.

Returns a handle; failures surface later via `Err()`.

## Defined on

- [AzureEnvironmentResource](/reference/api/go/aspire.hosting.azure/azureenvironmentresource.md) -- `handle`
