问题描述
大家好,
我正在尝试在自动化脚本中使用此命令来禁用现有的自动缩放规则
I'm tryin to use this command in my automation script to disable a existing autoscale rule
https://docs.microsoft.com/zh-cn/powershell/module/azurerm.batch/disable-azurebatchautoscale?view=azurermps-6.9.0
https://docs.microsoft.com/en-us/powershell/module/azurerm.batch/disable-azurebatchautoscale?view=azurermps-6.9.0
https://docs.microsoft.com/zh-cn/dotnet/api/microsoft.azure.commands.batch.batchaccountcontext?view=azurerm-ps
https://docs.microsoft.com/en-us/dotnet/api/microsoft.azure.commands.batch.batchaccountcontext?view=azurerm-ps
但是我对输入参数的值感到困惑
But I'm kind of confused about the value for the input parameter
-BatchContext < BatchAccountContext>
-BatchContext <BatchAccountContext>
我尝试使用输出 命令get-azurermcontext作为此参数的输入,但没有运气
I've tried using the output of command get-azurermcontext as input to this parameter but no luck
[Microsoft.Azure.Commands.Batch.BatchAccountContext] $ context = Get-AzureRmContext
[Microsoft.Azure.Commands.Batch.BatchAccountContext]$context=Get-AzureRmContext
有什么想法吗?
推荐答案
要通过批处理服务数据平面进行身份验证,您需要创建一个BatchAccountContext,这意味着您需要获取批处理帐户密钥.
To authenticate with the Batch service data plane, you need to create a BatchAccountContext, which means you'll need to get the Batch account keys.
有关更多信息:
https://docs.microsoft.com/zh-cn/azure/batch/batch-powershell-cmdlets-get-started#create-a-batchaccountcontext-object
https://docs.microsoft.com/en-us/azure/batch/batch-powershell-cmdlets-get-started#create-a-batchaccountcontext-object
谢谢!
Brian
这篇关于Disable-AzureBatchAutoScale的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!