Kubernetes Load Balancer 403 AuthorizationFailed and InvalidApiVersionParameter

Timo Notheisen 20 Reputation points
2024-11-20T16:05:57.4066667+00:00

When deploying a Kubernetes Service (type LoadBalancer), the service shows the following event:

Warning  SyncLoadBalancerFailed  1s (x2 over 7s)  service-controller  Error syncing load balancer: failed to ensure load balancer: Retriable: false, RetryAfter: 0s, HTTPStatusCode: 403, RawError: {"error":{"code":"AuthorizationFailed","message":"The client '
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.
2,187 questions
0 comments No comments
{count} votes

Accepted answer
  1. Nikhil Duserla 3,460 Reputation points Microsoft Vendor
    2024-11-21T22:08:44.33+00:00

    Hi @Timo Notheisen ,

    Thank you for reaching out to us again and confirming that the issue has been resolved.

    As an original poster cannot accept their own answer, I am reposting it so that you can accept it an answer. Accepted answer will help other community members navigate to the appropriate solutions.

    Issue: Kubernetes Load Balancer 403 AuthorizationFailed and InvalidApiVersionParameter

    Solution: Turned out we had an error in the value of the service.beta.kubernetes.io/azure-load-balancer-resource-group annotation. We've been passing the resource group id the whole time. But it seems you have to use the resource group name instead.

    This fixes both problems (the missing permission and the wrong API version).

    User's image

    0 comments No comments

1 additional answer

Sort by: Most helpful
  1. Nikhil Duserla 3,460 Reputation points Microsoft Vendor
    2024-11-20T19:33:29.5566667+00:00

    Hi @Timo Notheisen,

    Welcome to the Microsoft Q&A Platform! Thank you for asking your question here.

    Based on your inquiry, we understand you're facing an issue. The error message you received indicates that the API version 2022-07-01 in your request is invalid. It also provides a list of supported API versions for the operation you're attempting.

    Please review your configuration or code to locate where the API version is set to 2022-07-01 and update it to one of the supported versions listed in the error message.

    PUT https://management.azure.com/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}?api-version=2024-08-01
    
    

    If you have any further queries, do let us know.

    If the answer has been helpful, we appreciate hearing from you and would love to help others who may have the same question. Accepting answers helps increase visibility of this question for other members of the Microsoft Q&A community.


Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.