# AzureEnvironmentResource Constructors

- Package: [Aspire.Hosting.Azure](/reference/api/csharp/aspire.hosting.azure.md)
- Type: [AzureEnvironmentResource](/reference/api/csharp/aspire.hosting.azure/azureenvironmentresource.md)
- Kind: `Constructors`
- Members: `1`

Represents the root Azure deployment target for an Aspire application. Manages deployment parameters and context for Azure resources.

## AzureEnvironmentResource(string, ParameterResource, ParameterResource, ParameterResource)

- Name: `Constructor(string, ParameterResource, ParameterResource, ParameterResource)`
- Source: [GitHub](https://github.com/microsoft/aspire/blob/cbc352350f1a9bafbaff10d14a2c8de4ac186a48/src/Aspire.Hosting.Azure/AzureEnvironmentResource.cs#L64-L180)

Initializes a new instance of the [AzureEnvironmentResource](/reference/api/csharp/aspire.hosting.azure/azureenvironmentresource.md) class.

```csharp
public sealed class AzureEnvironmentResource
{
    public AzureEnvironmentResource(
        string name,
        ParameterResource location,
        ParameterResource resourceGroupName,
        ParameterResource principalId)
    {
        // ...
    }
}
```

## Parameters

- `name` (`string`)
  The name of the Azure environment resource.
- `location` (`ParameterResource`)
  The Azure location that the resources will be deployed to.
- `resourceGroupName` (`ParameterResource`)
  The Azure resource group name that the resources will be deployed to.
- `principalId` (`ParameterResource`)
  The Azure principal ID that will be used to deploy the resources.

## Exceptions

- `ArgumentNullException` -- Thrown when the name is null or empty.
- `ArgumentException` -- Thrown when the name is invalid.
