Might be a silly question, but have you tried putting the ID in quotes?
AKS won't deploy - "--vnet-subnet-id is not a valid Azure resource ID"
Whenever I try to create a private AKS instance using the Azure CLI, it fails with the error "vnet-subnet-id is not a valid Azure resource ID". However, there is nothing wrong with the vnet-subnet-id: I'm using the full and proper vnet-subnet-id, I've double and triple checked.
I've noticed this only happens when I use the azure cli on my local machine. When I run the exact same command with the exact same parameters in the Azure Cloud Shell, it runs perfectly fine. I've updated my local machine's azure cli to have the exact same version as the one in Azure Cloud Shell (and run az version on both to confirm this). I'm logged into the exact same account on the same exact same directory with the exact same subscription on both my local machine and the cloud shell as well.
Executing the command on the Cloud Shell is not an option for me, as the Cloud Shell hits its 20 minute timeout limit before az aks create can finish running.
This is the command I'm using (Note - some things redacted for privacy):
az aks create \
--name REDACTED \
--resource-group REDACTED \
--enable-managed-identity \
--enable-cluster-autoscaler \
--enable-private-cluster \
--kubernetes-version 1.18.4 \
--node-count 1 \
--min-count 1 \
--max-count 1 \
--vm-set-type VirtualMachineScaleSets \
--network-plugin azure \
--vnet-subnet-id /subscriptions/REDACTED/resourceGroups/REDACTED/providers/Microsoft.Network/virtualNetworks/REDACTED/subnets/REDACTED \
--service-cidr REDACTED \
--dns-service-ip REDACTED \
--docker-bridge-address REDACTED \
--dns-name-prefix REDACTED \
--network-policy azure \
--generate-ssh-keys
Azure Kubernetes Service
3 answers
Sort by: Most helpful
-
Sam Cogan 10,812 Reputation points Microsoft Employee Volunteer Moderator
2020-08-26T19:40:35.08+00:00 -
vipullag-MSFT 26,487 Reputation points Moderator
2020-08-27T05:59:40.18+00:00 I cannot reproduce the issue on my end, I ran the cli command on my local and I am not getting any error as you mentioned.
Also, try to enclose in quotes as per previous suggestion.I see that you have opened a GitHub as document issue here. I followed the same document.
I updated my CLI and tried, please find below screenshots with the commands I tried for your reference.
-
Gautam Kumar Sharma 50 Reputation points
2023-10-09T13:08:55.0166667+00:00 I have similar issues. however the git link (scroll below the end it saying why this issues) above has clue how to resolve the issues about error "vnet-subnet-id is not a valid Azure resource ID" this can be resolved by executing the below before executing the aks create cli command. it is working for me.
export MSYS_NO_PATHCONV=1 # issue with the Git Bash for Windows environment path being added