Azure AKS creation "subscription not found" error
Hello,
We have subscription in pay-as-you-go rates, account billing type is MCA. Today we purchased Saving Plan. We have one RG under this subscription. In this RG I am trying to create AKS, but when I set all settings in portal, in last step of validation I got error:
"The subscription 'xxx' could not be found."
I double checked, that id of subscription is correct, this sub is also shown in combo box when I choose subscription in AKS Creation page. This is weird, because I already created there for example Container Registry where I also chose this subscription and it was created successfully. Is there any connection to recent purchasing of Saving Plan? There is status "pending billing" but I don't this has some impact. Any idea what is happening here?
Thanks,
Dominik Zatloukal
Azure Kubernetes Service (AKS)
-
deherman-MSFT 37,416 Reputation points • Microsoft Employee
2024-10-02T17:52:55.91+00:00 Could you clarify how you are attempting to create AKS cluster? Please share any screenshots including the error you are seeing.
-
Kyle Berry 0 Reputation points
2024-10-03T01:50:25.9033333+00:00 I'm having the same issue while trying to create the cluster from the Azure Portal.
Tier: Dev/Test - free.
{ "error": { "code": "InvalidTemplateDeployment", "details": [ { "code": "NotFound", "message": "Preflight validation check for resource(s) for container service xxxxxxxxxx in resource group xxxxxxxx failed. Message: List Usage for location eastus2 failed. GET https://management.azure.com/subscriptions/xxxxxxxxx xxxxxx/providers/Microsoft.Compute/locations/eastus2/usages\n--------------------------------------------------------------------------------\nRESPONSE 404: 404 Not Found\nERROR CODE: NotFound\n--------------------------------------------------------------------------------\n{\n \"error\": {\n \"code\": \"NotFound\",\n \"message\": \"The subscription 'xxxxxxxxxxx' could not be found.\"\n }\n}\n--------------------------------------------------------------------------------\n. Details: " } ], "message": "The template deployment 'microsoft.aks-1727919590137' is not valid according to the validation procedure. The tracking id is '3be0aa4e-1b4e-4f23-b153-80a5ee5c0cd2'. See inner errors for details." }, "details": { "code": "InvalidTemplateDeployment", "message": "The template deployment 'microsoft.aks-1727919590137' is not valid according to the validation procedure. The tracking id is '3be0aa4e-1b4e-4f23-b153-80a5ee5c0cd2'. See inner errors for details.", "details": [ { "code": "NotFound", "message": "Preflight validation check for resource(s) for container service xxxxxxxx in resource group xxxxxxxxx failed. Message: List Usage for location eastus2 failed. GET https://management.azure.com/subscriptions/xxxxxxxxxxxxxxxxxxxx/providers/Microsoft.Compute/locations/eastus2/usages\n--------------------------------------------------------------------------------\nRESPONSE 404: 404 Not Found\nERROR CODE: NotFound\n--------------------------------------------------------------------------------\n{\n \"error\": {\n \"code\": \"NotFound\",\n \"message\": \"The subscription 'xxxxxxxxxxxxxxxxxx' could not be found.\"\n }\n}\n--------------------------------------------------------------------------------\n. Details: " } ] } }
-
Luke Murray 11,091 Reputation points • MVP
2024-10-03T01:52:31.57+00:00 What regions are you attempting to deploy to? Just in case there's any commonality there.
-
Kyle Berry 0 Reputation points
2024-10-03T02:07:41.2733333+00:00 EastUS2
-
Kyle Berry 0 Reputation points
2024-10-03T02:15:02.25+00:00 Here's the automation template which I believe should help you recreate it. I'm using EastUs2 region.
Replace {{ClusterName}} with your cluster name in two places.
{ "$schema": "https://schema.management.azure.com/schemas/2015-01-01/deploymentTemplate.json#", "contentVersion": "1.0.0.0", "variables": { "isScaleSetPrioritySpot": "[equals(parameters('scaleSetPriority'), 'Spot')]", "defaultAadProfile": { "managed": true, "adminGroupObjectIDs": "[parameters('adminGroupObjectIDs')]", "enableAzureRBAC": "[parameters('azureRbac')]" }, "defaultApiServerAccessProfile": { "authorizedIPRanges": "[if(parameters('enableAuthorizedIpRange'), parameters('authorizedIPRanges'), null())]", "enablePrivateCluster": "[parameters('enablePrivateCluster')]" }, "defaultAzurePolicy": { "enabled": "[parameters('enableAzurePolicy')]" }, "defaultSecrectStoreProvider": { "enabled": "[parameters('enableSecretStoreCSIDriver')]", "config": "[if(parameters('enableSecretStoreCSIDriver'), variables('secrectStoreConfig'), null())]" }, "secrectStoreConfig": { "enableSecretRotation": "false", "rotationPollInterval": "2m" }, "servicePrincipalProfile": { "ClientId": "[parameters('servicePrincipalClientId')]", "Secret": "[parameters('servicePrincipalClientSecret')]" } }, "parameters": { "apiVersion": { "type": "string" }, "resourceName": { "type": "string", "metadata": { "description": "The name of the Managed Cluster resource." } }, "location": { "type": "string", "metadata": { "description": "The location of AKS resource." } }, "isLocationEdgeZone": { "defaultValue": false, "type": "bool" }, "edgeZone": { "defaultValue": {}, "type": "object", "metadata": { "description": "Extended location of the cluster." } }, "useServicePrincipal": { "defaultValue": false, "type": "bool" }, "clusterSku": { "defaultValue": { "name": "Base", "tier": "Standard" }, "type": "object", "metadata": { "descirption": "The managed cluster SKU tier." } }, "clusterTags": { "defaultValue": {}, "type": "object", "metadata": { "description": "Specifies the tags of the AKS cluster." } }, "tagsForAllResources": { "defaultValue": {}, "type": "object" }, "clusterIdentity": { "defaultValue": { "type": "SystemAssigned" }, "type": "object", "metadata": { "description": "The identity of the managed cluster, if configured." } }, "enableAadProfile": { "defaultValue": false, "type": "bool", "metadata": { "description": "Flag to turn on or off of Microsoft Entra ID Profile." } }, "aadProfile": { "defaultValue": {}, "type": "object", "metadata": { "descirption": "The Microsoft Entra ID configuration." } }, "dnsPrefix": { "type": "string", "metadata": { "description": "Optional DNS prefix to use with hosted Kubernetes API server FQDN." } }, "kubernetesVersion": { "type": "string", "defaultValue": "1.7.7", "metadata": { "description": "The version of Kubernetes." } }, "enableRBAC": { "type": "bool", "defaultValue": true, "metadata": { "description": "Boolean flag to turn on and off of RBAC." } }, "windowsProfile": { "type": "bool", "defaultValue": false, "metadata": { "description": "Boolean flag to turn on and off of virtual machine scale sets" } }, "nodeResourceGroup": { "type": "string", "metadata": { "description": "The name of the resource group containing agent pool nodes." } }, "upgradeChannel": { "defaultValue": "none", "type": "string", "allowedValues": [ "none", "patch", "rapid", "stable", "node-image" ], "metadata": { "description": "Auto upgrade channel for a managed cluster." } }, "servicePrincipalClientId": { "defaultValue": "", "metadata": { "description": "Client ID (used by cloudprovider)." }, "type": "securestring" }, "servicePrincipalClientSecret": { "defaultValue": "", "metadata": { "description": "The Service Principal Client Secret." }, "type": "securestring" }, "adminGroupObjectIDs": { "type": "array", "defaultValue": "", "metadata": { "description": "An array of Microsoft Entra group object ids to give administrative access." } }, "principalId": { "defaultValue": "", "type": "string", "metadata": { "description": "The objectId of service principal." } }, "supportPlan": { "type": "string", "defaultValue": "KubernetesOfficial", "allowedValues": [ "AKSLongTermSupport", "KubernetesOfficial" ] }, "azureRbac": { "type": "bool", "defaultValue": false, "metadata": { "description": "Enable or disable Azure RBAC." } }, "disableLocalAccounts": { "type": "bool", "defaultValue": false, "metadata": { "description": "Enable or disable local accounts." } }, "enablePrivateCluster": { "type": "bool", "defaultValue": false, "metadata": { "description": "Enable private network access to the Kubernetes cluster." } }, "isPrivateClusterSupported": { "type": "bool", "defaultValue": false }, "enableAuthorizedIpRange": { "type": "bool", "defaultValue": false }, "authorizedIPRanges": { "defaultValue": [], "type": "array", "metadata": { "description": "Boolean flag to turn on and off http application routing." } }, "isPublicNetworkAccessEnabled": { "type": "bool", "defaultValue": false }, "publicNetworkAccess": { "defaultValue": "Enabled", "type": "string", "allowedValues": [ "Disabled", "Enabled", "SecuredByPerimeter" ], "metadata": { "description": "Allow or deny public network access for AKS." } }, "enableDiskEncryptionSetID": { "defaultValue": false, "type": "bool", "metadata": { "description": "Flag to turn on or off of diskEncryptionSetID. Set diskEncryptionSetID to null when false." } }, "diskEncryptionSetID": { "defaultValue": "", "type": "string", "metadata": { "description": "The ID of the disk encryption set used to encrypt the OS disks of the nodes." } }, "aadSessionKey": { "type": "securestring", "defaultValue": "" }, "isAzurePolicySupported": { "type": "bool", "defaultValue": false }, "enableAzurePolicy": { "type": "bool", "defaultValue": false, "metadata": { "description": "Boolean flag to turn on and off Azure Policy addon." } }, "isSecretStoreCSIDDriverSupported": { "type": "bool", "defaultValue": false }, "enableSecretStoreCSIDriver": { "type": "bool", "defaultValue": false, "metadata": { "description": "Boolean flag to turn on and off secret store CSI driver." } }, "enableOmsAgent": { "type": "bool", "defaultValue": true, "metadata": { "description": "Boolean flag to turn on and off omsagent addon." } }, "workspaceRegion": { "type": "string", "defaultValue": "East US", "metadata": { "description": "Specify the region for your OMS workspace." } }, "workspaceName": { "defaultValue": "", "type": "string", "metadata": { "description": "Specify the name of the OMS workspace." } }, "omsWorkspaceId": { "defaultValue": "", "type": "string", "metadata": { "description": "Specify the resource id of the OMS workspace." } }, "omsSku": { "type": "string", "defaultValue": "standalone", "allowedValues": [ "free", "standalone", "pernode" ], "metadata": { "description": "Select the SKU for your workspace." } }, "aciVnetSubnetName": { "defaultValue": "", "type": "string", "metadata": { "description": "Name of virtual network subnet used for the ACI Connector." } }, "aciConnectorLinuxEnabled": { "defaultValue": false, "type": "bool", "metadata": { "description": "Enables the Linux ACI Connector." } }, "acrName": { "defaultValue": "", "type": "string", "metadata": { "description": "Specify the name of the Azure Container Registry." } }, "acrResourceGroup": { "defaultValue": "", "type": "string", "metadata": { "description": "The name of the resource group the container registry is associated with." } }, "guidValue": { "type": "string", "metadata": { "description": "The unique id used in the role assignment of the kubernetes service to the container registry service. It is recommended to use the default value." }, "defaultValue": "[newGuid()]" }, "enableVnetSubnetID": { "defaultValue": false, "type": "bool", "metadata": { "description": "Flag to turn on or off of vnetSubnetID." } }, "vnetSubnetID": { "defaultValue": "", "type": "string", "metadata": { "description": "Resource ID of virtual network subnet used for nodes and/or pods IP assignment." } }, "loadBalancerSku": { "defaultValue": "Standard", "type": "string", "allowedValues": [ "Basic", "Standard" ], "metadata": { "description": "Specifies the sku of the load balancer used by the virtual machine scale sets used by node pools." } }, "networkPolicy": { "defaultValue": "", "type": "string", "metadata": { "description": "Network policy used for building the Kubernetes network." } }, "networkPlugin": { "defaultValue": "azure", "type": "string", "allowedValues": [ "azure", "kubenet" ], "metadata": { "description": "Network plugin used for building the Kubernetes network." } }, "networkPluginMode": { "defaultValue": "", "type": "string", "metadata": { "description": "Network plugin mode used for building the Kubernetes network." } }, "networkDataplane": { "defaultValue": "", "type": "string", "metadata": { "description": "Network dataplane used in the Kubernetes cluster." } }, "serviceCidr": { "defaultValue": "", "type": "string", "metadata": { "description": "A CIDR notation IP range from which to assign service cluster IPs." } }, "dnsServiceIP": { "defaultValue": "", "type": "string", "metadata": { "description": "Containers DNS server IP address." } }, "spotMaxPrice": { "defaultValue": "", "type": "string", "metadata": { "description": "Possible values are any decimal value greater than zero or -1 which indicates the willingness to pay any on-demand price." } }, "vmssNodePool": { "type": "bool", "defaultValue": false, "metadata": { "description": "Boolean flag to turn on and off of virtual machine scale sets" } }, "isAvailabilityZoneEnabled": { "type": "bool", "defaultValue": false, "metadata": { "description": "Boolean flag to turn on or off of Availability Zone" } }, "osDiskSizeGB": { "type": "int", "defaultValue": 0, "metadata": { "description": "Disk size (in GiB) to provision for each of the agent pool nodes. This value ranges from 0 to 1023. Specifying 0 will apply the default disk size for that agentVMSize." }, "minValue": 0, "maxValue": 1023 }, "agentCount": { "defaultValue": 3, "minValue": 1, "maxValue": 50, "type": "int", "metadata": { "description": "The number of agent nodes for the cluster. Production workloads have a recommended minimum of 3." } }, "scaleSetEvictionPolicy": { "defaultValue": "Delete", "allowedValues": [ "Delete", "Deallocate" ], "type": "string", "metadata": { "description": "Specifies the ScaleSetEvictionPolicy to be used to specify eviction policy for spot virtual machine scale set. Default to Delete. Allowed values are Delete or Deallocate." } }, "scaleSetPriority": { "defaultValue": "Regular", "allowedValues": [ "Spot", "Regular" ], "type": "string", "metadata": { "description": "Specifies the virtual machine scale set priority in the user node pool: Spot or Regular." } }, "agentTags": { "defaultValue": {}, "type": "object", "metadata": { "description": "Specifies the tags of the agent pool." } }, "enableNodePublicIP": { "defaultValue": false, "type": "bool", "metadata": { "description": "Some scenarios may require nodes in a node pool to receive their own dedicated public IP addresses." } }, "agentNodeTaints": { "defaultValue": [], "type": "array", "metadata": { "description": "Specifies the taints added to new nodes during node pool create and scale. For example, key=value:NoSchedule. - string." } }, "agentNodeLables": { "defaultValue": {}, "type": "object", "metadata": { "description": "Specifies the Agent pool node labels to be persisted across all nodes in the system node pool." } }, "agentAvailabilityZones": { "defaultValue": [], "type": "array", "metadata": { "description": "Specifies the availability zones for the agent nodes in the agent node pool. Requires the use of VirtualMachineScaleSets as node pool type." } }, "agentMode": { "defaultValue": "System", "type": "string", "allowedValues": [ "System", "User" ], "metadata": { "description": "A cluster must have at least one 'System' Agent Pool at all times." } }, "agentMaxPods": { "defaultValue": 30, "type": "int", "metadata": { "description": "Specifies the maximum number of pods that can run on a node in the agent node pool. The maximum number of pods per node in an AKS cluster is 250. The default maximum number of pods per node varies between kubenet and Azure CNI networking, and the method of cluster deployment." } }, "agentOSType": { "defaultValue": "Linux", "allowedValues": [ "Linux", "Windows" ], "type": "string", "metadata": { "description": "The type of operating system for agent pool." } }, "agentVMSize": { "defaultValue": "Standard_D2_v3", "type": "string", "metadata": { "description": "The size of the Virtual Machine." } }, "agentMaxCount": { "defaultValue": 5, "type": "int", "metadata": { "description": "Specifies the maximum number of nodes for auto-scaling for the system node pool." } }, "agentMinCount": { "defaultValue": 3, "type": "int", "metadata": { "description": "Specifies the minimum number of nodes for auto-scaling for the system node pool." } }, "enableAutoScaling": { "defaultValue": true, "type": "bool", "metadata": { "description": "Specifies whether to enable auto-scaling for the system node pool." } }, "serviceMeshMode": { "type": "string", "allowedValues": [ "Disabled", "Istio" ], "defaultValue": "Disabled" }, "istioInternalIngressGateway": { "type": "bool", "defaultValue": false }, "istioExternalIngressGateway": { "type": "bool", "defaultValue": false }, "nodeOSUpgradeChannel": { "defaultValue": "NodeImage", "type": "string", "allowedValues": [ "None", "Unmanaged", "SecurityPatch", "NodeImage" ], "metadata": { "description": "Auto upgrade channel for node OS security." } }, "isImageCleanerEnabled": { "type": "bool", "defaultValue": false }, "imageCleanerIntervalHours": { "type": "int", "defaultValue": 168 }, "enableOIDC": { "type": "bool", "defaultValue": true, "metadata": { "description": "Whether the OIDC issuer is enabled." } }, "enableWorkloadIdentity": { "type": "bool", "defaultValue": true, "metadata": { "description": "Whether to enable workload identity." } } }, "resources": [ { "name": "ConnectAKStoACR-4f5a9e3e-2daf-23ed-f1ca-43195a176db0", "type": "Microsoft.Resources/deployments", "apiVersion": "2019-05-01", "resourceGroup": "[parameters('acrResourceGroup')]", "dependsOn": [ "[concat('Microsoft.ContainerService/managedClusters/', parameters('resourceName'))]" ], "properties": { "mode": "Incremental", "template": { "$schema": "https://schema.management.azure.com/schemas/2015-01-01/deploymentTemplate.json#", "contentVersion": "1.0.0.0", "resources": [ { "apiVersion": "2018-09-01-preview", "type": "Microsoft.ContainerRegistry/registries/providers/roleAssignments", "name": "[concat(parameters('acrName'), '/Microsoft.Authorization/', parameters('guidValue'))]", "properties": { "principalId": "[reference(parameters('resourceName'), '2023-10-01').identityProfile.kubeletidentity.objectId]", "principalType": "ServicePrincipal", "roleDefinitionId": "[concat('/subscriptions/', subscription().subscriptionId, '/providers/Microsoft.Authorization/roleDefinitions/', '7f951dda-4ed3-4680-a7ca-43fe172d538d')]", "scope": "[resourceId(parameters('acrResourceGroup'),'Microsoft.ContainerRegistry/registries/', parameters('acrName'))]" } } ] } } }, { "type": "Microsoft.ContainerService/managedClusters/maintenanceConfigurations", "name": "{{ClusterName}}/aksManagedAutoUpgradeSchedule", "apiVersion": "2023-10-01", "dependsOn": [ "[concat('Microsoft.ContainerService/managedClusters/', parameters('resourceName'))]" ], "properties": { "maintenanceWindow": { "schedule": { "daily": null, "weekly": null, "absoluteMonthly": null, "relativeMonthly": { "intervalMonths": 1, "weekIndex": "First", "dayOfWeek": "Sunday" } }, "durationHours": 4, "utcOffset": "+00:00", "startDate": "2024-10-05", "startTime": "00:00" } } }, { "type": "Microsoft.ContainerService/managedClusters/maintenanceConfigurations", "name": "{{ClusterName}}/aksManagedNodeOSUpgradeSchedule", "apiVersion": "2023-10-01", "dependsOn": [ "[concat('Microsoft.ContainerService/managedClusters/', parameters('resourceName'))]" ], "properties": { "maintenanceWindow": { "schedule": { "daily": null, "weekly": null, "absoluteMonthly": null, "relativeMonthly": { "intervalMonths": 1, "weekIndex": "First", "dayOfWeek": "Sunday" } }, "durationHours": 4, "utcOffset": "+00:00", "startDate": "2024-10-05", "startTime": "00:00" } } }, { "type": "Microsoft.ContainerService/managedClusters", "apiVersion": "[parameters('apiVersion')]", "sku": "[parameters('clusterSku')]", "identity": "[parameters('clusterIdentity')]", "dependsOn": [], "location": "[parameters('location')]", "name": "[parameters('resourceName')]", "extendedLocation": "[if(parameters('isLocationEdgeZone'), parameters('edgeZone'), null())]", "properties": { "kubernetesVersion": "[parameters('kubernetesVersion')]", "enableRBAC": "[parameters('enableRBAC')]", "dnsPrefix": "[parameters('dnsPrefix')]", "nodeResourceGroup": "[parameters('nodeResourceGroup')]", "disableLocalAccounts": "[parameters('disableLocalAccounts')]", "aadProfile": "[if(parameters('enableAadProfile'), variables('defaultAadProfile'), null())]", "autoUpgradeProfile": { "upgradeChannel": "[parameters('upgradeChannel')]", "nodeOSUpgradeChannel": "[parameters('nodeOSUpgradeChannel')]" }, "agentPoolProfiles": [ { "name": "agentpool", "osDiskSizeGB": "[parameters('osDiskSizeGB')]", "count": 2, "enableAutoScaling": true, "minCount": 2, "maxCount": 5, "vmSize": "Standard_DS2_v2", "osType": "Linux", "osSKU": "Ubuntu", "type": "VirtualMachineScaleSets", "mode": "System", "maxPods": 110, "availabilityZones": [], "nodeTaints": [], "enableNodePublicIP": false, "tags": {} } ], "apiServerAccessProfile": "[if(parameters('isPrivateClusterSupported'), variables('defaultApiServerAccessProfile'), null())]", "addonProfiles": { "azurepolicy": "[if(parameters('isAzurePolicySupported'), variables('defaultAzurePolicy'), null())]", "azureKeyvaultSecretsProvider": "[if(parameters('isSecretStoreCSIDDriverSupported'), variables('defaultSecrectStoreProvider'), null())]" }, "diskEncryptionSetID": "[if(parameters('enableDiskEncryptionSetID'), parameters('diskEncryptionSetID'), null())]", "networkProfile": { "loadBalancerSku": "[parameters('loadBalancerSku')]", "networkPlugin": "[parameters('networkPlugin')]", "networkPluginMode": "[parameters('networkPluginMode')]", "networkDataplane": "[parameters('networkDataplane')]", "networkPolicy": "[parameters('networkPolicy')]", "serviceCidr": "[parameters('serviceCidr')]", "dnsServiceIP": "[parameters('dnsServiceIP')]" }, "supportPlan": "[parameters('supportPlan')]", "serviceMeshProfile": { "mode": "[parameters('serviceMeshMode')]", "istio": { "revisions": [ "asm-1-21" ], "components": { "ingressGateways": [ { "enabled": "[parameters('istioInternalIngressGateway')]", "mode": "Internal" }, { "enabled": "[parameters('istioExternalIngressGateway')]", "mode": "External" } ] } } } }, "tags": "[parameters('clusterTags')]" } ], "outputs": { "controlPlaneFQDN": { "type": "string", "value": "[reference(concat('Microsoft.ContainerService/managedClusters/', parameters('resourceName'))).fqdn]" } } }
-
Kyle Berry 0 Reputation points
2024-10-03T05:49:14.46+00:00 I tried to install the automatic aks template to centralus and I'm getting a slightly different error.
Message: Insufficient regional vcpu quota left for location centralus. The tracking id is '8f6817b6-aaa4-44fb-ac5c-2c04dd8d20e7'
-
Zatloukal, Dominik 35 Reputation points
2024-10-03T06:46:59.3433333+00:00 Hi, thanks for replies, I just found what was the problem. There is no registered providers in newly created subscription, so I did not have registered Microsoft.Compute provider to create Compute resources. After I register it (Subscription -> left context menu choose Resource providers) validation is ok.
-
Zatloukal, Dominik 35 Reputation points
2024-10-03T06:52:44.9866667+00:00 @Kyle Berry I got also this error. It is because in new subscription, there are not set qoutas limit for cpus (at least I did not have set them). You need to increase quota for corresponding vcpu family which are you want to use in your AKS. You can do it in Subscription -> Usage and qoutas menu. For some vcpu family you can increase the limit from 0 to your desired count manually, for some of them, if manual increase fail, you will need to create support request and administrators will increase it for you. I did it yesterday.
Sign in to comment