# AzureAppServiceEnvironmentExtensions

- Kind: `class`
- Package: [Aspire.Hosting.Azure.AppService](/reference/api/csharp/aspire.hosting.azure.appservice.md)
- Version: `13.4.0`
- Namespace: `Aspire.Hosting`
- Target framework: `net8.0`
- Source: [GitHub](https://github.com/microsoft/aspire/blob/cbc352350f1a9bafbaff10d14a2c8de4ac186a48/src/Aspire.Hosting.Azure.AppService/AzureAppServiceEnvironmentExtensions.cs)

Extensions for adding Azure App Service Environment resources to a distributed application builder.

## Definition

```csharp
namespace Aspire.Hosting;

public static class AzureAppServiceEnvironmentExtensions
{
    // ...
}
```

## Methods

- [AddAzureAppServiceEnvironment(IDistributedApplicationBuilder, string)](/reference/api/csharp/aspire.hosting.azure.appservice/azureappserviceenvironmentextensions/methods.md#addazureappserviceenvironment-idistributedapplicationbuilder-string) : `IResourceBuilder<AzureAppServiceEnvironmentResource>` `extension` `ats export` -- Adds a azure app service environment resource to the distributed application builder.
- [WithAcrPullIdentity(IResourceBuilder<AzureAppServiceEnvironmentResource>, IResourceBuilder<AzureUserAssignedIdentityResource>)](/reference/api/csharp/aspire.hosting.azure.appservice/azureappserviceenvironmentextensions/methods.md#withacrpullidentity-iresourcebuilder-azureappserviceenvironmentresource-iresourcebuilder-azureuserassignedidentityresource) : `IResourceBuilder<AzureAppServiceEnvironmentResource>` `extension` `ats export` -- Configures the Azure App Service environment to use the supplied `Azure.AzureUserAssignedIdentityResource` as the managed identity that App Service apps use to pull images from the configured container registry (the `AcrPull` identity), instead of having Aspire create a new identity and a new `AcrPull` role assignment.
- [WithAzureApplicationInsights(IResourceBuilder<AzureAppServiceEnvironmentResource>)](/reference/api/csharp/aspire.hosting.azure.appservice/azureappserviceenvironmentextensions/methods.md#withazureapplicationinsights-iresourcebuilder-azureappserviceenvironmentresource) : `IResourceBuilder<AzureAppServiceEnvironmentResource>` `extension` `ats ignored` -- Configures whether Azure Application Insights should be enabled for the Azure App Service.
- [WithAzureApplicationInsights(IResourceBuilder<AzureAppServiceEnvironmentResource>, string)](/reference/api/csharp/aspire.hosting.azure.appservice/azureappserviceenvironmentextensions/methods.md#withazureapplicationinsights-iresourcebuilder-azureappserviceenvironmentresource-string) : `IResourceBuilder<AzureAppServiceEnvironmentResource>` `extension` `ats ignored` -- Configures whether Azure Application Insights should be enabled for the Azure App Service.
- [WithAzureApplicationInsights(IResourceBuilder<AzureAppServiceEnvironmentResource>, IResourceBuilder<ParameterResource>)](/reference/api/csharp/aspire.hosting.azure.appservice/azureappserviceenvironmentextensions/methods.md#withazureapplicationinsights-iresourcebuilder-azureappserviceenvironmentresource-iresourcebuilder-parameterresource) : `IResourceBuilder<AzureAppServiceEnvironmentResource>` `extension` `ats ignored` -- Configures whether Azure Application Insights should be enabled for the Azure App Service.
- [WithAzureApplicationInsights(IResourceBuilder<AzureAppServiceEnvironmentResource>, IResourceBuilder<AzureApplicationInsightsResource>)](/reference/api/csharp/aspire.hosting.azure.appservice/azureappserviceenvironmentextensions/methods.md#withazureapplicationinsights-iresourcebuilder-azureappserviceenvironmentresource-iresourcebuilder-azureapplicationinsightsresource) : `IResourceBuilder<AzureAppServiceEnvironmentResource>` `extension` `ats ignored` -- Configures whether Azure Application Insights should be enabled for the Azure App Service.
- [WithDashboard(IResourceBuilder<AzureAppServiceEnvironmentResource>, bool)](/reference/api/csharp/aspire.hosting.azure.appservice/azureappserviceenvironmentextensions/methods.md#withdashboard-iresourcebuilder-azureappserviceenvironmentresource-bool) : `IResourceBuilder<AzureAppServiceEnvironmentResource>` `extension` `ats export` -- Configures whether the Aspire dashboard should be included in the Azure App Service environment.
- [WithDeploymentSlot(IResourceBuilder<AzureAppServiceEnvironmentResource>, IResourceBuilder<ParameterResource>)](/reference/api/csharp/aspire.hosting.azure.appservice/azureappserviceenvironmentextensions/methods.md#withdeploymentslot-iresourcebuilder-azureappserviceenvironmentresource-iresourcebuilder-parameterresource) : `IResourceBuilder<AzureAppServiceEnvironmentResource>` `extension` `ats ignored` -- Configures the slot to which the Azure App Services should be deployed.
- [WithDeploymentSlot(IResourceBuilder<AzureAppServiceEnvironmentResource>, string)](/reference/api/csharp/aspire.hosting.azure.appservice/azureappserviceenvironmentextensions/methods.md#withdeploymentslot-iresourcebuilder-azureappserviceenvironmentresource-string) : `IResourceBuilder<AzureAppServiceEnvironmentResource>` `extension` `ats ignored` -- Configures the slot to which the Azure App Services should be deployed.
- [WithHttpsUpgrade(IResourceBuilder<AzureAppServiceEnvironmentResource>, bool)](/reference/api/csharp/aspire.hosting.azure.appservice/azureappserviceenvironmentextensions/methods.md#withhttpsupgrade-iresourcebuilder-azureappserviceenvironmentresource-bool) : `IResourceBuilder<AzureAppServiceEnvironmentResource>` `extension` `ats export` -- Configures whether HTTP endpoints should be automatically upgraded to HTTPS for the Azure App Service environment. By default, HTTP endpoints are upgraded to HTTPS for security and WebSocket compatibility.
