如何通过PowerShell启用BGINFO扩展? [英] How do I enable the BGINFO extension via powershell?

查看:64
本文介绍了如何通过PowerShell启用BGINFO扩展?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

写主机在< VMNAME>上启用BGInfo



Set-AzureRmVMBginfoExtension -Name BGInfo -vmname< VMNAME> -ResourceGroupName< RESOURCEGROUP> -TypeHandlerVersion
2.1 -Location eastus


< VMNAME>由实际VMName替换


< RESOURGEGROUP>由VM所在的资源组取代



根据文档,这应该有效。


不是。


如何重新加/修这个?

解决方案

I   am使用此命令:




VM
= Get-AzureRmVM -ResourceGroupName iidrtest rg -Name< VMNAME> ;


Set-AzureRmVMBootDiagnostics -VM


VM
-Enable -ResourceGroupName cloud-shell-storage-eastus -StorageAccountName< STORAGEACCOUNTNAME>


< VMNAME>由我在azure中的实际VM名称替换


< STORAGEACCOUNTNAME>被实际的storageaccount名称取代






Write-host Enabling BGInfo on <VMNAME>

Set-AzureRmVMBginfoExtension -Name BGInfo -vmname <VMNAME> -ResourceGroupName <RESOURCEGROUP> -TypeHandlerVersion 2.1 -Location eastus

<VMNAME> is replaced by actual VMName

<RESOURGEGROUP> is replaced by the resourcegroup the VM is in 

According to the documentation, this should work.

It isn't.

How can I reoubleshoot/fix this?

解决方案

I am using this command:


VM = Get-AzureRmVM -ResourceGroupName iidrtestrg -Name <VMNAME> ;

Set-AzureRmVMBootDiagnostics -VM


VM -Enable -ResourceGroupName cloud-shell-storage-eastus -StorageAccountName <STORAGEACCOUNTNAME>

<VMNAME> is replaced by my actual VM name in azure

<STORAGEACCOUNTNAME> is replaced by the actual storageaccount name


这篇关于如何通过PowerShell启用BGINFO扩展?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆