有没有办法使用 PowerShell 在 Azure 中接受 'Terms & Conditions'?
Is there a way to accept 'Terms & Conditions' in Azure using PowerShell?
我想使用 PowerShell 脚本自动化使用第三方资源的 ARM 模板,例如 'Docker for Azure',但我 运行 遇到了通过 "I agree to the terms and conditions stated above" 复选框。
有没有办法绕过这个问题或以某种方式自动接受 PowerShell 脚本中的条款和条件?
使用自动化时您不需要这样做,唯一的例外是 - 程序化部署。某些市场解决方案要求您启用编程部署,以便能够自动部署所述解决方案。这只能手动完成(讽刺意味强烈)。
这可以在解决方案页面或订阅边栏选项卡 > 编程部署上完成。
您可以使用这些 cmdlet 进行注册:
Get-AzureRmMarketplaceTerms -Publisher trendmicro -Product deep-security-vm-byol -Name dxxnbyol | Set-AzureRmMarketplaceTerms -Accept
这是接受trendmicro Deep Security的例子
如果我的理解是正确的。如果使用PowerShell部署模板,则不需要点击Terms & Conditions
。您可以将模板和参数 json 文件下载到本地,然后使用 New-AzureRmResourceGroupDeployment
通过脚本部署此模板。
使用以下脚本部署您的模板。
# existing resource group where you would like to deploy
$RGName="resourcegroupname"
# path to the template
$TemplateFile="c:\path\file.json"
#path to the parameter
$ParameterFile="c:\path\parameter.json"
# validate the template
Test-AzureRmResourceGroupDeployment -ResourceGroupName $RGName -TemplateFile $TemplateFile -TemplateParameterFile $ParameterFile
# deploy to the specified resource group
New-AzureRmResourceGroupDeployment -ResourceGroupName $RGName -TemplateFile $TemplateFile -TemplateParameterFile $ParameterFile -Verbose
我想使用 PowerShell 脚本自动化使用第三方资源的 ARM 模板,例如 'Docker for Azure',但我 运行 遇到了通过 "I agree to the terms and conditions stated above" 复选框。
有没有办法绕过这个问题或以某种方式自动接受 PowerShell 脚本中的条款和条件?
使用自动化时您不需要这样做,唯一的例外是 - 程序化部署。某些市场解决方案要求您启用编程部署,以便能够自动部署所述解决方案。这只能手动完成(讽刺意味强烈)。
这可以在解决方案页面或订阅边栏选项卡 > 编程部署上完成。
您可以使用这些 cmdlet 进行注册:
Get-AzureRmMarketplaceTerms -Publisher trendmicro -Product deep-security-vm-byol -Name dxxnbyol | Set-AzureRmMarketplaceTerms -Accept
这是接受trendmicro Deep Security的例子
如果我的理解是正确的。如果使用PowerShell部署模板,则不需要点击Terms & Conditions
。您可以将模板和参数 json 文件下载到本地,然后使用 New-AzureRmResourceGroupDeployment
通过脚本部署此模板。
使用以下脚本部署您的模板。
# existing resource group where you would like to deploy
$RGName="resourcegroupname"
# path to the template
$TemplateFile="c:\path\file.json"
#path to the parameter
$ParameterFile="c:\path\parameter.json"
# validate the template
Test-AzureRmResourceGroupDeployment -ResourceGroupName $RGName -TemplateFile $TemplateFile -TemplateParameterFile $ParameterFile
# deploy to the specified resource group
New-AzureRmResourceGroupDeployment -ResourceGroupName $RGName -TemplateFile $TemplateFile -TemplateParameterFile $ParameterFile -Verbose