Azure / Azure/bicep

Support `kubelogin`

Open
#17,752 2 comments 0 reactions 1 assignee Claimed by @shenglol View on GitHub
enhancement extensibility: general availability story: extensibility
Dominant language
Bicep
Stars
3.6k
Forks
830
Avg merge
1d 21m
Merged PRs (30d)
79

Description

Using `listClusterUserCredential()` for AzureAD authentication fails with error:

```
{
"status": "Failed",
"error": {
"code": "DeploymentFailed",
"target": ".....",
"message": "At least one resource deployment operation failed. Please list deployment operations for details. Please see https://aka.ms/arm-deployment-operations for usage details.",
"details": [
{
"code": "InvalidTemplateDeployment",
"message": "The template deployment 'kubernetes' is not valid according to the validation procedure. The tracking id is '0c00e1ec-4376-4d17-a3cd-e815fe8d9013'. See inner errors for details.",
"details": [
{
"code": "InvalidImportConfig",
"target": "/imports/kubernetes/config",
"message": "external exec failed due to: An error occurred trying to start process 'kubelogin' with working directory 'S:\\SvcFab\\_App\\ExtensibilityHostType_App9\\Extensibility.Host.ApiServicePkg.Code.1.629.0'. The system cannot find the file specified."
}
]
}
]
}
}
```

Input bicep

```bicep
// app.bicep
resource aks 'Microsoft.ContainerService/managedClusters@2025-05-01' existing = {
name: 'Test-AKS'
}

var kubeConfig = aks.listClusterUserCredential().kubeconfigs[0].value

module kubernetes 'k8s.bicep' = {
name: 'kubernetes'
params: {
kubeConfig: kubeConfig
}
}

// k8s.bicep
@secure()
param kubeConfig string

extension kubernetes with {
namespace: 'default'
kubeConfig: kubeConfig
}

resource cm 'core/ConfigMap@v1' = {
metadata: {
name: 'test'
namespace: 'default'
}
}

```

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.