# WithLocation

- Module: [Aspire.Hosting.Azure](/reference/api/go/aspire.hosting.azure.md)
- Version: `17.0.0`
- Kind: `method`
- Defined on: [`AzureEnvironmentResource`](/reference/api/go/aspire.hosting.azure/azureenvironmentresource.md)
- Source: [GitHub](https://github.com/microsoft/aspire/tree/2d325b13709752ba6d9a943635c5e2940a2530c0)

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
func (AzureEnvironmentResource) 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()`.

## Applies to

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