Cluster error

Roger Roger 7,181 Reputation points
2022-08-01T20:21:40.253+00:00

Hi All

i am executing the below syntax from the azure PowerShell i am getting the below error.

Connect-AzAccount  
$sec= ConvertTo-SecureString "XXXXXXXXXXXXXXXXXXXX" -AsPlainText -Force  
$Cre = New-Object -TypeName System.Management.Automation.PSCredential ("1111111111111111111111111111", $sec)  
New-AzAksCluster -ResourceGroupName myrg -Name test -ServicePrincipalIdAndSecret $Cre -NodeVmSize Standard_SKU -NodeMaxCount 5 -NodeMinCount 1 -EnableNodeAutoScaling  

when i use -GenerateSshKey nothing happens it takes long time. ignore Standard_SKU i have given correct sku name while executing

Note : Go to https://aka.ms/azps-changewarnings for steps to suppress this breaking change warning, and other information on breaking changes in Azure PowerShell.
New-AzAksCluster : Could not find SSH public key in default path 'C:\Users\admin.ssh\id_rsa.pub' which is required for creating k8s cluster. See https://learn.microsoft.com/en-us/azure/virtual-machines/linux/mac-create-ssh-keys
or https://learn.microsoft.com/en-us/azure/virtual-machines/linux/ssh-from-windows for generating a key pair manually; or you could try to add switch parameter -GenerateSshKey during calling New-AzAksCluster which will automatically
generate SSH key file if you have ssh-keygen installed.
At line:1 char:1

  • New-AzAksCluster -ResourceGroupName myrg -Name test...
  • ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  • CategoryInfo : CloseError: (:) [New-AzAksCluster], AzPSArgumentException
  • FullyQualifiedErrorId : Microsoft.Azure.Commands.Aks.NewAzureRmAks
Azure Kubernetes Service
Azure Kubernetes Service
An Azure service that provides serverless Kubernetes, an integrated continuous integration and continuous delivery experience, and enterprise-grade security and governance.
2,447 questions
0 comments No comments
{count} votes

Accepted answer
  1. shiva patpi 13,366 Reputation points Microsoft Employee Moderator
    2022-08-02T05:55:06.797+00:00

    Hello @Roger Roger ,
    I just tried the same command and it went through successfully. Only difference is Service Principal which gets created at the time of AKS cluster creation. After entering the SP creds it took sometime at the prompt (2 mins) but eventually went on to completion successfully.

    Couple of inputs:

    1. Can you try using Azure Portal CLI prompt?
    2. Try to delete everything under .ssh folder of C:\users\username
    3. Go through previous similar issue: https://github.com/MicrosoftDocs/azure-docs/issues/89337 and corresponding bug details https://github.com/Azure/azure-powershell/issues/17421

    227029-image.png

    0 comments No comments

1 additional answer

Sort by: Most helpful
  1. Roger Roger 7,181 Reputation points
    2022-08-02T10:04:45.783+00:00

    it worked for me from Azure portal CLi

    0 comments No comments

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.