Skip to content
Docs Try Aspire
Docs Try

AzureKubernetesEnvironmentExtensions

Class static net8.0
📦 Aspire.Hosting.Azure.Kubernetes v13.3.0-preview.1.26254.5
Provides extension methods for adding Azure Kubernetes Service (AKS) environments to the application model.
namespace Aspire.Hosting;
public static class AzureKubernetesEnvironmentExtensions
{
// ...
}
AddAzureKubernetesEnvironment(IDistributedApplicationBuilder, string)extensionats export
IResourceBuilder<AzureKubernetesEnvironmentResource>
Adds an Azure Kubernetes Service (AKS) environment to the distributed application. This provisions an AKS cluster and configures it as a Kubernetes compute environment.
AddNodePool(IResourceBuilder<AzureKubernetesEnvironmentResource>, string, string, int, int)extensionats export
IResourceBuilder<AksNodePoolResource>
Adds a node pool to the AKS cluster.
WithContainerRegistry(IResourceBuilder<AzureKubernetesEnvironmentResource>, IResourceBuilder<AzureContainerRegistryResource>)extensionats export
IResourceBuilder<AzureKubernetesEnvironmentResource>
Configures the AKS environment to use a specific Azure Container Registry for image storage. When set, this replaces the auto-created default container registry.
WithSubnet(IResourceBuilder<AzureKubernetesEnvironmentResource>, IResourceBuilder<AzureSubnetResource>)extensionats export
IResourceBuilder<AzureKubernetesEnvironmentResource>
Configures the AKS cluster to use a VNet subnet for node pool networking. Unlike AzureVirtualNetworkExtensions.WithDelegatedSubnet, this does NOT add a service delegation to the subnet — AKS uses plain (non-delegated) subnets.
WithSubnet(IResourceBuilder<AksNodePoolResource>, IResourceBuilder<AzureSubnetResource>)extensionats export
IResourceBuilder<AksNodePoolResource>
WithSystemNodePool(IResourceBuilder<AzureKubernetesEnvironmentResource>, string, int, int)extensionats export
IResourceBuilder<AzureKubernetesEnvironmentResource>
Replaces the default system node pool with a customized configuration.
WithWorkloadIdentity(IResourceBuilder<AzureKubernetesEnvironmentResource>, bool)extensionats export
IResourceBuilder<AzureKubernetesEnvironmentResource>
Enables or disables workload identity on the AKS environment, allowing pods to authenticate to Azure services using federated credentials.
View all methods