Skip to content

Commit 42b1c6b

Browse files
author
Amson Liu
authored
Merge pull request #9474 from amsliu/v-liuamson-CI7004
New article for CI 7004.
2 parents 889c491 + 4e0e133 commit 42b1c6b

2 files changed

Lines changed: 73 additions & 0 deletions

File tree

Lines changed: 71 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,71 @@
1+
---
2+
title: Troubleshoot the SubnetIsDelegated error code
3+
description: Learn how to troubleshoot the SubnetIsDelegated error when you try to create a node pool.
4+
ms.date: 08/07/2025
5+
editor: v-jsitser
6+
ms.reviewer: v-liuamson
7+
ms.service: azure-kubernetes-service
8+
#Customer intent: As an Azure Kubernetes user, I want to troubleshoot the SubnetIsDelegated error so that I can successfully create a node pool.
9+
ms.custom: sap:Create, Upgrade, Scale and Delete operations (cluster or nodepool)
10+
---
11+
# Troubleshoot the SubnetIsDelegated error code
12+
13+
This article discusses how to identify and resolve the SubnetIsDelegated error that occurs when you try to create a node pool.
14+
15+
## Prerequisites
16+
17+
- Azure CLI (version 2.0.59 or a later version)
18+
19+
## Symptoms
20+
21+
When you try to create a node pool in an AKS cluster, you receive the following error message:
22+
23+
> **Code:** **SubnetIsDelegated**
24+
>
25+
> **Message:** `AgentPoolProfile` subnet with id \<subnet-id\> cannot be used as it\'s a delegated subnet. Please check <https://aka.ms/adv-network-prerequest> for more details.
26+
27+
## Cause
28+
29+
If you try to create a node pool by using a subnet, and the subnet is delegation-enabled for a particular Azure service, the new node pool can't be integrated with the AKS service.
30+
31+
## Resolution
32+
33+
To resolve this issue, follow these steps:
34+
35+
1. Verify that the subnet is correctly delegated:
36+
37+
```bash
38+
az network vnet subnet show \
39+
--resource-group $RESOURCE_GROUP \
40+
--vnet-name $VNET_NAME \
41+
--name $SUBNET_NAME \
42+
--query delegations
43+
```
44+
45+
1. Make sure that the output shows **Microsoft.ContainerService/managedClusters** as the delegated service or no delegated service. If the output shows any other Azure service delegation, remove it by running the following command:
46+
47+
```bash
48+
az network vnet subnet update \
49+
--resource-group $RESOURCE_GROUP \
50+
--vnet-name $VNET_NAME \
51+
--name $SUBNET_NAME \
52+
--remove delegations 0
53+
```
54+
55+
1. Run the following command to add Managed Cluster delegation:
56+
57+
```bash
58+
az network vnet subnet update \
59+
--resource-group $RESOURCE_GROUP \
60+
--vnet-name $VNET_NAME \
61+
--name $SUBNET_NAME \
62+
--delegations Microsoft.ContainerService/managedClusters
63+
```
64+
65+
1. After the subnet delegation is removed, try again to create the node pool by using the `az aks nodepool add` command.
66+
67+
## References
68+
69+
- [az aks node pool examples](/cli/azure/aks/nodepool?view=azure-cli-latest#az-aks-nodepool-add-examples&preserve-view=true)
70+
71+
[!INCLUDE [azure-help-support](../../../includes/azure-help-support.md)]

support/azure/azure-kubernetes/toc.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -455,5 +455,7 @@
455455
href: error-codes/windows-cse-error-check-api-server-connectivity-error.md
456456
- name: ZonalAllocationFailed, AllocationFailed, or OverconstrainedAllocationRequest error
457457
href: error-codes/zonalallocation-allocationfailed-error.md
458+
- name: SubnetIsDelegated error
459+
href: error-codes/subnetisdelegated-error.md
458460
- name: VirtualNetworkNotInSucceededState error
459461
href: error-codes/virtualnetworknotinsucceededstate-error.md

0 commit comments

Comments
 (0)