【问题标题】:Azure reports password criteria not matchedAzure 报告密码条件不匹配
【发布时间】:2019-07-16 00:58:27
【问题描述】:

我正在使用 Terraform 在 Azure 上预配资源。它抱怨密码不符合密码政策。我虽然可能 var 文件给出了一些错误,但即使我在命令行上传递密码,它也会给我错误。

terraform.tfvars 中如下:

password="Hash#Dollar$135"

terraform plan 命令的命令行如下:

terraform plan -var 'password=Hash#Dollar$135' -out main.plan

错误信息如下:

azurerm_virtual_machine.tf-vm-cluster-app[4]: 1 error(s) occurred:

azurerm_virtual_machine.tf-vm-cluster-app.4: compute.VirtualMachinesClient#CreateOrUpdate: Failure sending request: StatusCode=400 -- Original Error: Code="InvalidParameter" Message="The supplied password must be between 8-123 characters long and must satisfy at least 3 of password complexity requirements from the following: \r\n1) Contains an uppercase character\r\n2) Contains a lowercase character\r\n3) Contains a numeric digit\r\n4) Contains a special character\r\n5) Control characters are not allowed" Target="adminPassword"

即使在 DEBUG 模式下,它也不会告诉我哪个字符错误或应该使用哪个字符。一个例子会更好。

2019-02-22T11:45:11.077+1100 [DEBUG] plugin.terraform-provider-azurerm_v1.22.1_x4: {
2019-02-22T11:45:11.077+1100 [DEBUG] plugin.terraform-provider-azurerm_v1.22.1_x4:   "error": {
2019-02-22T11:45:11.077+1100 [DEBUG] plugin.terraform-provider-azurerm_v1.22.1_x4:     "code": "InvalidParameter",
2019-02-22T11:45:11.077+1100 [DEBUG] plugin.terraform-provider-azurerm_v1.22.1_x4:     "message": "The supplied password must be between 8-123 characters long and must satisfy at least 3 of password complexity requirements from the following: \r\n1) Contains an uppercase character\r\n2) Contains a lowercase character\r\n3) Contains a numeric digit\r\n4) Contains a special character\r\n5) Control characters are not allowed",
2019-02-22T11:45:11.077+1100 [DEBUG] plugin.terraform-provider-azurerm_v1.22.1_x4:     "target": "adminPassword"
2019-02-22T11:45:11.077+1100 [DEBUG] plugin.terraform-provider-azurerm_v1.22.1_x4:   }
2019-02-22T11:45:11.077+1100 [DEBUG] plugin.terraform-provider-azurerm_v1.22.1_x4: }

我的第二个问题是,有没有办法查看密码值设置为什么值?

我执行了 terraform show,但看不到它设置的值。

【问题讨论】:

    标签: azure-active-directory terraform azure-virtual-machine terraform-provider-azure


    【解决方案1】:

    删除此问题。我忘记在 main.tf 文件中使用变量时使用 $ 。愚蠢的错误。

    【讨论】:

    • 你可以删除问题:)
    猜你喜欢
    • 2021-12-05
    • 1970-01-01
    • 1970-01-01
    • 2021-04-04
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多