<p>I am trying to enable the local account on an AKS cluster (version 1.24.10) by running commands from an AzureDevOps yaml pipeline.</p>
<p>The “old” az aks command :  <code>az aks update -g &lt;myresourcegroup&gt; -n &lt;myclustername&gt; --enable-local</code> used to serve me well to enable a local account on an AKS cluster.
In the yaml pipeline, however, this does not seem to work and I resorted to running the <a href="https://learn.microsoft.com/en-us/powershell/module/az.aks/set-azakscluster?view=azps-9.7.1" rel="nofollow noreferrer">Set-AzAksCluster</a> command from within a AzurePowerShell@5 task</p>
<pre><code>      - task: AzurePowerShell@5
    displayName: 'disable-local-account'
    name: disablelocalaccount
    inputs:
      azureSubscription: 'myazsubscription' 
      ScriptType: InlineScript
      Inline: |
          Set-AzAksCluster -ResourceGroupName myresourcegrp -Name mycluster -DisableLocalAccount
      azurePowerShellVersion: LatestVersion
</code></pre>
<p>By passing the  -DisableLocalAccount switch to the command we can disable the local account on the cluster.
The enabling of the local account on the cluster just seems to elude me somehow…sigh.</p>
<p>Does anybody know if it is possible to enable the local account using the <a href="https://learn.microsoft.com/en-us/powershell/module/az.aks/set-azakscluster?view=azps-9.7.1" rel="nofollow noreferrer">Set-AzAksCluster</a> command? And if so, what is the correct way to go about this?</p>
<p>Many thanks!</p>
<p>Kind regards,<br />
Morné</p>

<p>Wow, great spot... The enable flag isn't there. You might want to raise this on the <a href="https://github.com/Azure/azure-powershell/discussions/categories/feature-requests" rel="nofollow noreferrer">Azure PowerShell GitHub</a>.</p>
<p>As a workaround, the Azure CLI does allow enabling of local accounts.</p>
<pre class="lang-bash prettyprint-override"><code>az aks update --name cluster --resource-group rg --enable-local-accounts
</code></pre>
<p><a href="https://learn.microsoft.com/en-us/cli/azure/aks?view=azure-cli-latest#az-aks-update" rel="nofollow noreferrer">https://learn.microsoft.com/en-us/cli/azure/aks?view=azure-cli-latest#az-aks-update</a></p>
