AzureKubernetesEnvironmentExtensions
Class static net8.0
Provides extension methods for adding Azure Kubernetes Service (AKS) environments to the application model.
namespace Aspire.Hosting;
public static class AzureKubernetesEnvironmentExtensions{ // ...} 7 members
Methods7
Section titled MethodsAddAzureKubernetesEnvironment(IDistributedApplicationBuilder, string)extensionats exportIResourceBuilder<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 exportIResourceBuilder<AksNodePoolResource> Adds a node pool to the AKS cluster.
WithContainerRegistry(IResourceBuilder<AzureKubernetesEnvironmentResource>, IResourceBuilder<AzureContainerRegistryResource>)extensionats exportIResourceBuilder<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 exportIResourceBuilder<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 exportIResourceBuilder<AksNodePoolResource> Configures a specific AKS node pool to use its own VNet subnet. When applied, this node pool's subnet overrides the environment-level subnet set via
AzureKubernetesEnvironmentExtensions.WithSubnet. WithSystemNodePool(IResourceBuilder<AzureKubernetesEnvironmentResource>, string, int, int)extensionats exportIResourceBuilder<AzureKubernetesEnvironmentResource> Replaces the default system node pool with a customized configuration.
WithWorkloadIdentity(IResourceBuilder<AzureKubernetesEnvironmentResource>, bool)extensionats exportIResourceBuilder<AzureKubernetesEnvironmentResource> Enables or disables workload identity on the AKS environment, allowing pods to authenticate to Azure services using federated credentials.