Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

azuredevops_serviceendpoint_kubernetes - An error occured while fetching the AKS cluster #1078

Open
ValeruS opened this issue Jun 18, 2024 · 2 comments
Labels

Comments

@ValeruS
Copy link

ValeruS commented Jun 18, 2024

Community Note

  • Please vote on this issue by adding a 👍 reaction to the original issue to help the community and maintainers prioritize this request
  • Please do not leave "+1" or "me too" comments, they generate extra noise for issue followers and do not help prioritize the request
  • If you are interested in working on this issue or have submitted a pull request, please leave a comment

Terraform (and Azure DevOps Provider) Version

Terraform v1.8.5
provider microsoft/azuredevops v1.1.1

Affected Resource(s)

  • azuredevops_serviceendpoint_kubernetes

Terraform Configuration Files

resource "azuredevops_serviceendpoint_kubernetes" "name" {
  project_id            = var.project_id
  service_endpoint_name = var.service_endpoint_name
  apiserver_url         = var.apiserver_url
  authorization_type    = "AzureSubscription"

  azure_subscription {
    subscription_id   = var.subscription_id
    subscription_name = var.subscription_name
    tenant_id         = var.tenant_id
    resourcegroup_id  = var.resourcegroup_id
    namespace         = var.namespace
    cluster_name      = var.cluster_name
    cluster_admin     = false
  }
}

Debug Output

Panic Output

Expected Behavior

Apply complete successfully

Actual Behavior

waiting for service endpoint ready. Error looking up service endpoint given ID (REDACTED) and project ID (REDACCTED): map[state:Failed statusMessage:An error occured while fetching the AKS cluster. Internal error: Failed to query service connection API: 'https://management.azure.com/subscriptions/ID/resourcegroups/subscriptions/OTHERID/resourceGroups/RG_NAME/providers/Microsoft.ContainerService/managedClusters/aks_name?api-version=2018-03-31'. Status Code: 'BadRequest', Response from server: '{"error":{"code":"InvalidApiVersionParameter","message":"The api-version '2018-03-31' is invalid. The supported versions are '2024-03-01,2023-07-01,2023-07-01-preview,2023-03-01-preview,2022-12-01,2022-11-01-preview,2022-09-01,2022-06-01,2022-05-01,2022-03-01-preview,2022-01-01,2021-04-01,2021-01-01,2020-10-01,2020-09-01,2020-08-01,2020-07-01,2020-06-01,2020-05-01,2020-01-01,2019-11-01,2019-10-01,2019-09-01,2019-08-01,2019-07-01,2019-06-01,2019-05-10,2019-05-01,2019-03-01,2018-11-01,2018-09-01,2018-08-01,2018-07-01,2018-06-01,2018-05-01,2018-02-01,2018-01-01,2017-12-01,2017-08-01,2017-06-01,2017-05-10,2017-05-01,2017-03-01,2016-09-01,2016-07-01,2016-06-01,2016-02-01,2015-11-01,2015-01-01,2014-04-01-preview,2014-04-01,2014-01-01,2013-03-01,2014-02-26,2014-04'."}}']

Steps to Reproduce

  1. terraform apply

Important Factoids

References

  • #0000
@xuzhang3 xuzhang3 added the bug label Jun 26, 2024
@xuzhang3
Copy link
Collaborator

xuzhang3 commented Jul 2, 2024

@ValeruS I cannot creation this this normally the network or permission issue. The user/PAT in ADO org cannot get the k8s cluster information. Can you create the service connection via portal? For example the k8s can only be access via private network

@xuzhang3 xuzhang3 added question and removed bug labels Jul 2, 2024
@xuzhang3 xuzhang3 changed the title An error occured while fetching the AKS cluster azuredevops_serviceendpoint_kubernetes - An error occured while fetching the AKS cluster Jul 3, 2024
@xuzhang3
Copy link
Collaborator

xuzhang3 commented Jul 3, 2024

If I disable the public network access, I will get the same error.
image

Error:  waiting for service endpoint ready. Error looking up service endpoint given ID (...) and project ID (...): map[state:Failed statusMessage:The URL resolves to address "https://.../api/v1/namespaces/default/serviceaccounts?pretty=false", which is in a special purpose range that is not allowed in a Service Endpoint.]  
Error:  waiting for service endpoint ready. Error looking up service endpoint given ID (...) and project ID (...): map[state:Failed statusMessage:The URL resolves to address "https://.../api/v1/namespaces/default/serviceaccounts?pretty=false", which is in a special purpose range that is not allowed in a Service Endpoint.]  

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants