Azure-docs: Creating cluster fails with Windows password validation error - every time

Created on 4 Jul 2019  Â·  8Comments  Â·  Source: MicrosoftDocs/azure-docs

Running az 2.0.68 with aks-preview 0.4.5.

az aks create step fails with a validation error for the Windows admin password:

validation error: Parameter 'ManagedClusterWindowsProfile.admin_password' must conform to the following pattern: '^(?=.*[a-z])(?=.*[A-Z])(?=.*[!@#$%\\^&\\*\\(\\)])[a-zA-Z\\d!@#$%\\^&\\*\\(\\)]{12,123}$'.

The doc say that if this happens, to try again with a new RG in a new region, but that doesn't work for me. I've tried multiple RGs in East and West US and West Europe, using ever more complex passwords, and I get this error every time.


Document Details

⚠ Do not edit this section. It is required for docs.microsoft.com ➟ GitHub issue linking.

Pri2 container-servicsvc cxp product-question triaged

Most helpful comment

First I've issued

$windowsPassword = "RES4Ever!"
$windowsUser = "WindowsMaster"
az aks create --resource-group k8s-win --name k8s-win-test --node-count 1 --enable-addons monitoring --kubernetes-version 1.14.0 --generate-ssh-keys --windows-admin-username $windowsUser --windows-admin-password $windowsPassword --enable-vmss --networ
k-plugin azure

Which had this output:

The behavior of this command has been altered by the following extension: aks-preview
Finished service principal creation[##################################]  100.0000%validation error: Parameter 'ManagedClusterWindowsProfile.admin_password' must conform to the following pattern: '^(?=.*[a-z])(?=.*[A-Z])(?=.*[!@#$%\\^&\\*\\(\\)])[a-zA-Z\\d!@#$%\\^&\\*\\(\\)]{12,123}$'

So I ran this command (first password did not match length requirement):

$windowsPassword = "P@ssw0rd1234"
az aks create --resource-group k8s-win --name k8s-win-test --node-count 1 --enable-addons monitoring --kubernetes-version 1.14.0 --generate-ssh-keys --windows-admin-username $windowsUser --windows-admin-password $windowsPassword --enable-vmss --networ
k-plugin azure
The behavior of this command has been altered by the following extension: aks-preview
validation error: Parameter 'ManagedClusterWindowsProfile.admin_password' must conform to the following pattern: '^(?=.*[a-z])(?=.*[A-Z])(?=.*[!@#$%\\^&\\*\\(\\)])[a-zA-Z\\d!@#$%\\^&\\*\\(\\)]{12,123}$'

So I've decided to find a matching password on REGEX101 against regular expression from error message! Got no match.

Few minutes ago I've isseud again:

$windowsPassword = "P@ssw0rd1234!"
az aks create --resource-group k8s-win --name k8s-win-test --node-count 1 --enable-addons monitoring --kubernetes-version 1.14.0 --generate-ssh-keys --windows-admin-username $windowsUser --windows-admin-password $windowsPassword --enable-vmss --networ
k-plugin azure

The cluster is now created!

I can't find reason why it failed before!

All 8 comments

Hi @sixeyed Thank you for your feedback! We will review and provide an update as appropriate.

I got the same but fixed it by changing the password to a new one that uses only allowed characters and then everything worked!

@sixeyed
Can you set a password with the below constraints and let me know.
These requirements apply for the windows virtual machines.

  • Password must have 3 of the following: 1 lower case character, 1 upper case character, 1 number, and 1 special character.
  • The value must be between 12 and 72 characters long.

@asicoe I hope your password satisfied the above requirements. Let me know

please-close

Tried few minutes ago with different password combinations but none of them matched!
Tried even with example from Microsoft sample, "P@ssw0rd1234!".
It has one lower case character, it has one uppercase character, it has 1 number, it has 1 special character, it is longer than 12 and lower than 72.
Still not working!

@andreivirgiltudor
can you give me the command which you tried and the error which you got

First I've issued

$windowsPassword = "RES4Ever!"
$windowsUser = "WindowsMaster"
az aks create --resource-group k8s-win --name k8s-win-test --node-count 1 --enable-addons monitoring --kubernetes-version 1.14.0 --generate-ssh-keys --windows-admin-username $windowsUser --windows-admin-password $windowsPassword --enable-vmss --networ
k-plugin azure

Which had this output:

The behavior of this command has been altered by the following extension: aks-preview
Finished service principal creation[##################################]  100.0000%validation error: Parameter 'ManagedClusterWindowsProfile.admin_password' must conform to the following pattern: '^(?=.*[a-z])(?=.*[A-Z])(?=.*[!@#$%\\^&\\*\\(\\)])[a-zA-Z\\d!@#$%\\^&\\*\\(\\)]{12,123}$'

So I ran this command (first password did not match length requirement):

$windowsPassword = "P@ssw0rd1234"
az aks create --resource-group k8s-win --name k8s-win-test --node-count 1 --enable-addons monitoring --kubernetes-version 1.14.0 --generate-ssh-keys --windows-admin-username $windowsUser --windows-admin-password $windowsPassword --enable-vmss --networ
k-plugin azure
The behavior of this command has been altered by the following extension: aks-preview
validation error: Parameter 'ManagedClusterWindowsProfile.admin_password' must conform to the following pattern: '^(?=.*[a-z])(?=.*[A-Z])(?=.*[!@#$%\\^&\\*\\(\\)])[a-zA-Z\\d!@#$%\\^&\\*\\(\\)]{12,123}$'

So I've decided to find a matching password on REGEX101 against regular expression from error message! Got no match.

Few minutes ago I've isseud again:

$windowsPassword = "P@ssw0rd1234!"
az aks create --resource-group k8s-win --name k8s-win-test --node-count 1 --enable-addons monitoring --kubernetes-version 1.14.0 --generate-ssh-keys --windows-admin-username $windowsUser --windows-admin-password $windowsPassword --enable-vmss --networ
k-plugin azure

The cluster is now created!

I can't find reason why it failed before!

ok. If you face the issue again please open a new issue and then we will troubleshoot.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

Ponant picture Ponant  Â·  3Comments

monteledwards picture monteledwards  Â·  3Comments

jebeld17 picture jebeld17  Â·  3Comments

DeepPuddles picture DeepPuddles  Â·  3Comments

jharbieh picture jharbieh  Â·  3Comments