powershell - 新的 AzResourceGroupDeployment : Cannot retrieve the dynamic parameters for the cmdlet

标签 powershell azure-resource-manager arm-template

虽然我知道答案,但我只是想我会把这个问题留给遇到此错误消息的其他人。我的搜索结果中似乎没有任何结果。

使用此命令运行 Azure 资源管理器模板时:

New-AzResourceGroupDeployment -WhatIf -ResourceGroupName my-rg -TemplateFile my-rg-tst-parameters.json -TemplateParameterFile .\my-rg-tst-parameters.json

我收到这个错误:

New-AzResourceGroupDeployment: Cannot retrieve the dynamic parameters for the cmdlet. Parameter type in parameters cannot be null or empty

最佳答案

这种情况下的错误是因为正在运行的命令将参数文件传递到它应该解析模板文件的位置。正确的命令是:

New-AzResourceGroupDeployment -WhatIf -ResourceGroupName my-rg -TemplateFile .\my-rg-template.json -TemplateParameterFile .\my-rg-tst-parameters.json

关于powershell - 新的 AzResourceGroupDeployment : Cannot retrieve the dynamic parameters for the cmdlet,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/63216954/

相关文章:

PowerShell 问题 - 我必须键入 ./才能运行 bat 文件

powershell - 永久点源文件?

azure-devops - 仅在 ARM 模板部署后才知道 ConnectionString 时如何生成 EF Core 迁移脚本?

linux - 用于创建 Linux VM 并向/etc/hosts 添加行的 Azure ARM 模板

powershell - 使用 PowerShell 随机 WebRequest 结果

powershell - 将 PowerShell 的默认输出编码更改为 UTF-8

azure - Azure VNET 中的子网地址范围确定

azure - Bicep - 如何更新字典对象

api - Azure 资源管理器 API 用户的订阅范围授权

azure-resource-manager - 使用 ARM 模板/powershell 部署逻辑应用