Azure自定义脚本扩展问题

时间:2019-11-14 17:34:26

标签: azure powershell azure-functions

我正在尝试向虚拟机添加自定义脚本扩展,并运行以下命令,但是它给出了以下错误。

使用的命令:

Set-AzVMCustomScriptExtension -Location "East US" -VMName "TINFAD01" -Name "TINFAD01DSC" -StorageAccountName "p1caddraassbdevdevdiag" -StorageAccountKey "XXXXXX" -FileName "TINFAD01.ps1" -ContainerName "dscfiles"| Update-AzVM -Verbose
**Error** PS C:\WINDOWS\system32> Set-AzVMCustomScriptExtension -Location "East US" -VMName "TINFAD01" -Name "TINFAD01DSC" -StorageAccountName "p1caddraassbdevdevdiag" -StorageAccountKey "D4o3I7fzY3vuxhRHJ1yAEkOklCIETqmoK voq0ISDMb6wQqyVF5AVaNMl05v9foABwOeQ/+a604HioP7smE3gqQ==" -FileName "TINFAD01.ps1" -ContainerName "dscfiles" | Update-AzVM -Verbose

cmdlet Set-AzVMCustomScriptExtension at command pipeline position 1 Supply values for the following parameters: (Type !? for Help.) ResourceGroupName: p1cad-draas-sb-dev-dev Set-AzVMCustomScriptExtension : Object reference not set to an instance of an object. At line:1 char:1
+ Set-AzVMCustomScriptExtension -Location "East US" -VMName "TINFAD01"  ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : CloseError: (:) [Set-AzVMCustomScriptExtension], NullReferenceException
    + FullyQualifiedErrorId : Microsoft.Azure.Commands.Compute.SetAzureVMCustomScriptExtensionCommand

1 个答案:

答案 0 :(得分:1)

以下是powershell命令,用于将自定义扩展添加到虚拟机:

uber-trace-id

通过查看您的代码,它清楚地表明您没有提供资源名称:

rows_to_insert = [
    (u'Phred Phlyntstone', 32),
    (u'Wylma Phlyntstone', 29),
]

errors = client.insert_rows(table, rows_to_insert)  # API request

assert errors == []

请提供资源组信息,看看是否有帮助。

其他参考:

question

随时在您的对话中标记我,以寻求其他帮助。