AzureAppServiceComputeResourceExtensions Methods
Class Methods 2 members
Provides extension methods for publishing compute resources as Azure App Service websites.
PublishAsAzureAppServiceWebsite(IResourceBuilder<T>, Action<AzureResourceInfrastructure, WebSite>, Action<AzureResourceInfrastructure, WebSiteSlot>) Section titled PublishAsAzureAppServiceWebsite(IResourceBuilder<T>, Action<AzureResourceInfrastructure, WebSite>, Action<AzureResourceInfrastructure, WebSiteSlot>) extension IResourceBuilder<T> Publishes the specified compute resource as an Azure App Service or Azure App Service Slot.
public static class AzureAppServiceComputeResourceExtensions{ public static IResourceBuilder<T> PublishAsAzureAppServiceWebsite<T>( this IResourceBuilder<T> builder, Action<AzureResourceInfrastructure, WebSite>? configure = null, Action<AzureResourceInfrastructure, WebSiteSlot>? configureSlot = null) { // ... }}Parameters
builder IResourceBuilder<T> The compute resource builder. configure Action<AzureResourceInfrastructure, WebSite> optional The configuration action for the App Service WebSite resource. configureSlot Action<AzureResourceInfrastructure, WebSiteSlot> optional The configuration action for the App Service WebSite Slot resource. Returns
IResourceBuilder<T> The updated compute resource builder. Remarks
builder.AddProject<Projects.Api>( "name").PublishAsAzureAppServiceWebsite((infrastructure, app) =>{ // Configure the App Service WebSite resource here});SkipEnvironmentVariableNameChecks(IResourceBuilder<T>) Section titled SkipEnvironmentVariableNameChecks(IResourceBuilder<T>) extension IResourceBuilder<T> Skips validation for environment variable names that Azure App Service may not support.
public static class AzureAppServiceComputeResourceExtensions{ public static IResourceBuilder<T> SkipEnvironmentVariableNameChecks<T>( this IResourceBuilder<T> builder) { // ... }}Parameters
builder IResourceBuilder<T> The compute resource builder. Returns
IResourceBuilder<T> The updated compute resource builder. Exceptions
InvalidOperationException Thrown when the resource is not configured for Azure App Service publishing. Remarks
When running on Azure App Service, environment variable names can't contain hyphens. This can cause Aspire client integrations that rely on the original environment variable names to fail. By default, Aspire performs validation to ensure environment variable names are compatible with Azure App Service, failing to publish if any invalid names are found.