AzureAppServiceEnvironmentExtensions Methods
Class Methods 9 members
Extensions for adding Azure App Service Environment resources to a distributed application builder.
AddAzureAppServiceEnvironment(IDistributedApplicationBuilder, string) Section titled AddAzureAppServiceEnvironment(IDistributedApplicationBuilder, string) extension IResourceBuilder<AzureAppServiceEnvironmentResource> Adds a azure app service environment resource to the distributed application builder.
public static class AzureAppServiceEnvironmentExtensions{ public static IResourceBuilder<AzureAppServiceEnvironmentResource> AddAzureAppServiceEnvironment( this IDistributedApplicationBuilder builder, string name) { // ... }}Parameters
builder IDistributedApplicationBuilder The distributed application builder. name string The name of the resource. Returns
IResourceBuilder<AzureAppServiceEnvironmentResource> ApplicationModel.IResourceBuilder`1 WithAzureApplicationInsights(IResourceBuilder<AzureAppServiceEnvironmentResource>) Section titled WithAzureApplicationInsights(IResourceBuilder<AzureAppServiceEnvironmentResource>) extension IResourceBuilder<AzureAppServiceEnvironmentResource> Configures whether Azure Application Insights should be enabled for the Azure App Service.
public static class AzureAppServiceEnvironmentExtensions{ public static IResourceBuilder<AzureAppServiceEnvironmentResource> WithAzureApplicationInsights( this IResourceBuilder<AzureAppServiceEnvironmentResource> builder) { // ... }}Parameters
builder IResourceBuilder<AzureAppServiceEnvironmentResource> The AzureAppServiceEnvironmentResource to configure. Returns
IResourceBuilder<AzureAppServiceEnvironmentResource> ApplicationModel.IResourceBuilder`1 WithAzureApplicationInsights(IResourceBuilder<AzureAppServiceEnvironmentResource>, string) Section titled WithAzureApplicationInsights(IResourceBuilder<AzureAppServiceEnvironmentResource>, string) extension IResourceBuilder<AzureAppServiceEnvironmentResource> Configures whether Azure Application Insights should be enabled for the Azure App Service.
public static class AzureAppServiceEnvironmentExtensions{ public static IResourceBuilder<AzureAppServiceEnvironmentResource> WithAzureApplicationInsights( this IResourceBuilder<AzureAppServiceEnvironmentResource> builder, string applicationInsightsLocation) { // ... }}Parameters
builder IResourceBuilder<AzureAppServiceEnvironmentResource> The AzureAppServiceEnvironmentResource to configure. applicationInsightsLocation string The location for Application Insights. Returns
IResourceBuilder<AzureAppServiceEnvironmentResource> ApplicationModel.IResourceBuilder`1 WithAzureApplicationInsights(IResourceBuilder<AzureAppServiceEnvironmentResource>, IResourceBuilder<ParameterResource>) Section titled WithAzureApplicationInsights(IResourceBuilder<AzureAppServiceEnvironmentResource>, IResourceBuilder<ParameterResource>) extension IResourceBuilder<AzureAppServiceEnvironmentResource> Configures whether Azure Application Insights should be enabled for the Azure App Service.
public static class AzureAppServiceEnvironmentExtensions{ public static IResourceBuilder<AzureAppServiceEnvironmentResource> WithAzureApplicationInsights( this IResourceBuilder<AzureAppServiceEnvironmentResource> builder, IResourceBuilder<ParameterResource> applicationInsightsLocation) { // ... }}Parameters
builder IResourceBuilder<AzureAppServiceEnvironmentResource> The AzureAppServiceEnvironmentResource to configure. applicationInsightsLocation IResourceBuilder<ParameterResource> The location parameter for Application Insights. Returns
IResourceBuilder<AzureAppServiceEnvironmentResource> ApplicationModel.IResourceBuilder`1 WithAzureApplicationInsights(IResourceBuilder<AzureAppServiceEnvironmentResource>, IResourceBuilder<AzureApplicationInsightsResource>) Section titled WithAzureApplicationInsights(IResourceBuilder<AzureAppServiceEnvironmentResource>, IResourceBuilder<AzureApplicationInsightsResource>) extension IResourceBuilder<AzureAppServiceEnvironmentResource> Configures whether Azure Application Insights should be enabled for the Azure App Service.
public static class AzureAppServiceEnvironmentExtensions{ public static IResourceBuilder<AzureAppServiceEnvironmentResource> WithAzureApplicationInsights( this IResourceBuilder<AzureAppServiceEnvironmentResource> builder, IResourceBuilder<AzureApplicationInsightsResource> applicationInsightsBuilder) { // ... }}Parameters
builder IResourceBuilder<AzureAppServiceEnvironmentResource> The AzureAppServiceEnvironmentResource builder to configure. applicationInsightsBuilder IResourceBuilder<AzureApplicationInsightsResource> The Application Insights resource builder. Returns
IResourceBuilder<AzureAppServiceEnvironmentResource> ApplicationModel.IResourceBuilder`1 WithDashboard(IResourceBuilder<AzureAppServiceEnvironmentResource>, bool) Section titled WithDashboard(IResourceBuilder<AzureAppServiceEnvironmentResource>, bool) extension IResourceBuilder<AzureAppServiceEnvironmentResource> Configures whether the Aspire dashboard should be included in the Azure App Service environment.
public static class AzureAppServiceEnvironmentExtensions{ public static IResourceBuilder<AzureAppServiceEnvironmentResource> WithDashboard( this IResourceBuilder<AzureAppServiceEnvironmentResource> builder, bool enable = true) { // ... }}Parameters
builder IResourceBuilder<AzureAppServiceEnvironmentResource> The ApplicationModel.IResourceBuilder`1 to configure. enable bool optional Whether to include the Aspire dashboard. Default is true. Returns
IResourceBuilder<AzureAppServiceEnvironmentResource> A reference to the ApplicationModel.IResourceBuilder`1 for chaining additional configuration. WithDeploymentSlot(IResourceBuilder<AzureAppServiceEnvironmentResource>, IResourceBuilder<ParameterResource>) Section titled WithDeploymentSlot(IResourceBuilder<AzureAppServiceEnvironmentResource>, IResourceBuilder<ParameterResource>) extension IResourceBuilder<AzureAppServiceEnvironmentResource> Configures the slot to which the Azure App Services should be deployed.
public static class AzureAppServiceEnvironmentExtensions{ public static IResourceBuilder<AzureAppServiceEnvironmentResource> WithDeploymentSlot( this IResourceBuilder<AzureAppServiceEnvironmentResource> builder, IResourceBuilder<ParameterResource> deploymentSlot) { // ... }}Parameters
builder IResourceBuilder<AzureAppServiceEnvironmentResource> The AzureAppServiceEnvironmentResource to configure. deploymentSlot IResourceBuilder<ParameterResource> The deployment slot parameter for all App Services in the App Service Environment. Returns
IResourceBuilder<AzureAppServiceEnvironmentResource> ApplicationModel.IResourceBuilder`1 WithDeploymentSlot(IResourceBuilder<AzureAppServiceEnvironmentResource>, string) Section titled WithDeploymentSlot(IResourceBuilder<AzureAppServiceEnvironmentResource>, string) extension IResourceBuilder<AzureAppServiceEnvironmentResource> Configures the slot to which the Azure App Services should be deployed.
public static class AzureAppServiceEnvironmentExtensions{ public static IResourceBuilder<AzureAppServiceEnvironmentResource> WithDeploymentSlot( this IResourceBuilder<AzureAppServiceEnvironmentResource> builder, string deploymentSlot) { // ... }}Parameters
builder IResourceBuilder<AzureAppServiceEnvironmentResource> The AzureAppServiceEnvironmentResource to configure. deploymentSlot string The deployment slot for all App Services in the App Service Environment. Returns
IResourceBuilder<AzureAppServiceEnvironmentResource> ApplicationModel.IResourceBuilder`1 WithHttpsUpgrade(IResourceBuilder<AzureAppServiceEnvironmentResource>, bool) Section titled WithHttpsUpgrade(IResourceBuilder<AzureAppServiceEnvironmentResource>, bool) extension IResourceBuilder<AzureAppServiceEnvironmentResource> 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.
public static class AzureAppServiceEnvironmentExtensions{ public static IResourceBuilder<AzureAppServiceEnvironmentResource> WithHttpsUpgrade( this IResourceBuilder<AzureAppServiceEnvironmentResource> builder, bool upgrade = true) { // ... }}Parameters
builder IResourceBuilder<AzureAppServiceEnvironmentResource> The ApplicationModel.IResourceBuilder`1 to configure. upgrade bool optional Whether to upgrade HTTP endpoints to HTTPS. Default is true. Returns
IResourceBuilder<AzureAppServiceEnvironmentResource> A reference to the ApplicationModel.IResourceBuilder`1 for chaining additional configuration. Remarks
When disabled (
false), HTTP endpoints will use HTTP scheme and port 80 in Azure App Service. Note that Azure App Service forces HTTP to HTTPS redirects at the platform level, so disabling upgrade primarily affects connection strings generated for dependent resources. Examples
Preserve HTTP endpoints instead of automatically upgrading them to HTTPS:
var appService = builder.AddAzureAppServiceEnvironment("appservice") .WithHttpsUpgrade(false);