Unable to update service principle

Collins, Nick 41 Reputation points
2021-04-07T21:48:38.157+00:00

I am currently unable to update my service principle for my AKS cluster. I am trying to update the credentials by following this guide: https://learn.microsoft.com/en-us/azure/aks/update-credentials

Whenever I run the az aks update-credentials step I get the following error:

Deployment failed. Correlation ID: de7d345a-009b-40f2-95c7-466b9157e481. Category: ClientError; SubCode: InvalidResourceReference; Dependency: Azure Resource Manager; OrginalError Code="InvalidResourceReference" Message="Resource /subscriptions/xxxx/resourceGroups/ICMUS-STAGING/providers/Microsoft.Network/virtualNetworks/ICMUS-STAGING referenced by resource /subscriptions/xxxx/resourceGroups/MC_ICMUS-STAGING-CLUSTER_ICMUS-STAGING-CLUSTER_WESTUS2/providers/Microsoft.Compute/virtualMachineScaleSets/aks-default-41547229-vmss was not found. Please make sure that the referenced resource exists, and that both resources are in the same region." Details=[{"code":"NotFound","message":"Resource /subscriptions/xxxx/resourceGroups/ICMUS-STAGING/providers/Microsoft.Network/virtualNetworks/ICMUS-STAGING not found."}]

I find this error message to be particularly odd

If I go into the Resource Explorer on the portal and navigate to the VMSS referenced in the error message, there is no reference to the missing virtualNetworks. This may be because I moved the VNET to a new resource group. The Resource Explorer in the portal reflects this change, but the CLI is not.

Any clue on how to fix this issue? There seems to be some disconnect with the Resource Explorer.

Azure Kubernetes Service (AKS)
Azure Kubernetes Service (AKS)
An Azure service that provides serverless Kubernetes, an integrated continuous integration and continuous delivery experience, and enterprise-grade security and governance.
1,855 questions
Microsoft Entra ID
Microsoft Entra ID
A Microsoft Entra identity service that provides identity management and access control capabilities. Replaces Azure Active Directory.
19,457 questions
{count} votes

Accepted answer
  1. singhh-msft 2,431 Reputation points
    2021-04-08T17:28:36.937+00:00

    @Collins, Nick , thank you for the information. I got in touch with PG on this issue, you can't change AKS resources to different resource groups (as it is not supported by AKS currently). You will have to open a support ticket so the support team can fix it. Please use the steps here to raise a support ticket. If you do not have a support plan, please send an email with subject line “Attn:Harshita” to AzCommunity[at]Microsoft[dot]com referencing subscription ID and a link to this thread (for context) and we will gladly assist you further.

    ---------------------

    Please "Accept the answer" if the information helped you. This will help us and others in the community as well.


1 additional answer

Sort by: Most helpful
  1. Collins, Nick 41 Reputation points
    2021-04-08T00:30:26.89+00:00

    I also tried to use the REST API to create a new NodePool in the correct Subnet: https://learn.microsoft.com/en-us/rest/api/aks/agentpools/createorupdate#linuxosconfig

    I get the following error:

    {  
      "code": "NotFound",  
      "message": "Failed to get a VNet: icmus-staging."  
    }  
    

    This is with setting the vnetSubnetID field to the ID of the vNet that I changed resource groups

    1 person found this answer helpful.
    0 comments No comments