I facing issue which getting aks cluster credentials in Runbook. I am using Powershell for this.
My PowerShell Script,
Install-Module -Name Kubernetes -AllowClobber -Scope CurrentUser
Import-Module -Name Az
Import-Module -Name Az.Aks
Import-Module -Name Kubernetes
Connect-AzAccount -Identity
Set-AzContext -SubscriptionId "8ab15eb5-cd64-4b44-a934-8e798f6c13e1"
$AzureContext = (Connect-AzAccount -Identity).context
Kubectl get nodes
$kubeconfig = Get-AzAksCredential -ResourceGroupName $resourceGroupName -Name $aksClusterName -Admin
ERROR I am getting is ,
Please share your suggestion to achieve this.
Thank You