# WithResourceGroup

- 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 resource group name of the Azure environment resource.

## Remarks

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

## Definition

```go
func (AzureEnvironmentResource) WithResourceGroup(resourceGroup ParameterResource) AzureEnvironmentResource
```

## Parameters

- `resourceGroup` (`ParameterResource`) -- The Azure resource group name.

## 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)
