问题描述
我知道您可以使用以下命令从Azure CLI启动/停止容器实例az容器停止--name mycontainer-资源组myResourceGroupVM
但是由于在我的组织中,azure cli给出了访问被拒绝"错误,所以我想知道如何使用Powershell或ARM进行相同的操作.我无法从文档中获取任何Powershell cmdlet来启动或停止Conrainer实例.请帮忙.
我参考了以下文档:
此外,它还在Azure门户上显示状态:
I know you can start / stop container instance from Azure CLI using below commandaz container stop --name mycontainer --resource-group myResourceGroupVM
but since in my org azure cli gives "Access is denied" error i want to know how to do same using powershell or ARM. I am unable to get any powershell cmdlet to start or stop conrainer instance from documentation. Please help.
I referred below documentation for same:https://docs.microsoft.com/en-us/powershell/module/azurerm.containerinstance/?view=azurermps-6.9.0#container_instances
Also could anyone tell me why I get "Access is denied." for all az (CLI ) commands?
You can use the PowerShell cmdlet to stop the ACI and the cmdlet will like this:
Invoke-AzureRmResourceAction -ResourceGroupName yourResourceGroup -ResourceName yourContainerGroup -Action Stop -ResourceType Microsoft.ContainerInstance/containerGroups
The result of the PowerShell cmdlet like this:
Also, it shows the state on the Azure Portal:
这篇关于如何使用Powershell命令或ARM命令启动停止Azure容器实例的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!