New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Get-AzVMRunCommand and Get-AzVmssVMRunCommand without -RunCommandName parameter fails to return list of RunCommands on VM #22403
Comments
Thanks for the feedback! We are routing this to the appropriate team for follow-up. cc @Drewm3, @TravisCragg-MSFT, @nikhilpatel909, @sandeepraichura, @hilaryw29, @GabstaMSFT. Issue DetailsDescription-Get-AzVMRunCommand without -RunCommandName parameter fails to return list of RunCommands on VM
Issue script & Debug outputPS C:\> Get-AzVMRunCommand -ResourceGroupName VivRG0 -VMName VivL
Get-AzVMRunCommand : Unable to cast object of type 'Microsoft.Azure.Management.Compute.Models.PSVirtualMachineRunCommand' to type
'Microsoft.Azure.Commands.Compute.Automation.Models.PSVirtualMachineRunCommandList'.
At line:1 char:1
+ Get-AzVMRunCommand -ResourceGroupName VivRG0 -VMName VivL
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : CloseError: (:) [Get-AzVMRunCommand], InvalidCastException
+ FullyQualifiedErrorId : Microsoft.Azure.Commands.Compute.Automation.GetAzureVmRunCommand Environment dataPS C:\> $PSVersionTable
Name Value
---- -----
PSVersion 5.1.22000.2003
PSEdition Desktop
PSCompatibleVersions {1.0, 2.0, 3.0, 4.0...}
BuildVersion 10.0.22000.2003
CLRVersion 4.0.30319.42000
WSManStackVersion 3.0
PSRemotingProtocolVersion 2.3
SerializationVersion 1.1.0.1 Module versions10.0.1 Error outputPS C:\> Get-AzVMRunCommand -ResourceGroupName VivRG0 -VMName VivL
Get-AzVMRunCommand : Unable to cast object of type 'Microsoft.Azure.Management.Compute.Models.PSVirtualMachineRunCommand' to type
'Microsoft.Azure.Commands.Compute.Automation.Models.PSVirtualMachineRunCommandList'.
At line:1 char:1
+ Get-AzVMRunCommand -ResourceGroupName VivRG0 -VMName VivL
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : CloseError: (:) [Get-AzVMRunCommand], InvalidCastException
+ FullyQualifiedErrorId : Microsoft.Azure.Commands.Compute.Automation.GetAzureVmRunCommand
|
Thanks for the feedback! We are routing this to the appropriate team for follow-up. cc @TravisCragg-MSFT, @sandeepraichura. Issue DetailsDescription-Get-AzVMRunCommand without -RunCommandName parameter fails to return list of RunCommands on VM
Issue script & Debug outputPS C:\> Get-AzVMRunCommand -ResourceGroupName VivRG0 -VMName VivL
Get-AzVMRunCommand : Unable to cast object of type 'Microsoft.Azure.Management.Compute.Models.PSVirtualMachineRunCommand' to type
'Microsoft.Azure.Commands.Compute.Automation.Models.PSVirtualMachineRunCommandList'.
At line:1 char:1
+ Get-AzVMRunCommand -ResourceGroupName VivRG0 -VMName VivL
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : CloseError: (:) [Get-AzVMRunCommand], InvalidCastException
+ FullyQualifiedErrorId : Microsoft.Azure.Commands.Compute.Automation.GetAzureVmRunCommand
PS C:\> Get-AzVmssVMRunCommand -ResourceGroupName VivRG0 -VMScaleSetName VivVMSS -InstanceId 0
Get-AzVmssVMRunCommand : Unable to cast object of type 'Microsoft.Azure.Management.Compute.Models.PSVirtualMachineRunCommand' to type
'Microsoft.Azure.Commands.Compute.Automation.Models.PSVirtualMachineRunCommandList'.
At line:1 char:1
+ Get-AzVmssVMRunCommand -ResourceGroupName VivRG0 -VMScaleSetName VivV ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : CloseError: (:) [Get-AzVmssVMRunCommand], InvalidCastException
+ FullyQualifiedErrorId : Microsoft.Azure.Commands.Compute.Automation.GetAzureVmssVMRunCommand Environment dataPS C:\> $PSVersionTable
Name Value
---- -----
PSVersion 5.1.22000.2003
PSEdition Desktop
PSCompatibleVersions {1.0, 2.0, 3.0, 4.0...}
BuildVersion 10.0.22000.2003
CLRVersion 4.0.30319.42000
WSManStackVersion 3.0
PSRemotingProtocolVersion 2.3
SerializationVersion 1.1.0.1 Module versions10.0.1 Error outputPS C:\> Get-AzVMRunCommand -ResourceGroupName VivRG0 -VMName VivL
Get-AzVMRunCommand : Unable to cast object of type 'Microsoft.Azure.Management.Compute.Models.PSVirtualMachineRunCommand' to type
'Microsoft.Azure.Commands.Compute.Automation.Models.PSVirtualMachineRunCommandList'.
At line:1 char:1
+ Get-AzVMRunCommand -ResourceGroupName VivRG0 -VMName VivL
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : CloseError: (:) [Get-AzVMRunCommand], InvalidCastException
+ FullyQualifiedErrorId : Microsoft.Azure.Commands.Compute.Automation.GetAzureVmRunCommand
PS C:\> Get-AzVmssVMRunCommand -ResourceGroupName VivRG0 -VMScaleSetName VivVMSS -InstanceId 0
Get-AzVmssVMRunCommand : Unable to cast object of type 'Microsoft.Azure.Management.Compute.Models.PSVirtualMachineRunCommand' to type
'Microsoft.Azure.Commands.Compute.Automation.Models.PSVirtualMachineRunCommandList'.
At line:1 char:1
+ Get-AzVmssVMRunCommand -ResourceGroupName VivRG0 -VMScaleSetName VivV ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : CloseError: (:) [Get-AzVmssVMRunCommand], InvalidCastException
+ FullyQualifiedErrorId : Microsoft.Azure.Commands.Compute.Automation.GetAzureVmssVMRunCommand
|
Terminating existing PowerShell sessions and starting a new PowerShell process seems to be an effective workaround for this bug. Tested in the latest PowerShell Core and Az Module versions. |
assigning to @nikhilpatel909 |
Hello from Compute PS team. We will address bug for September release. Thank you for submitting this bug item. |
@grizzlytheodore was this bug fixed? |
@grizzlytheodore checking if issue is now resolved for you? |
@nikhilpatel909 @GabstaMSFT hello. this bug was resolved so I will close this issue |
Good morning, I'm still experiencing the same issue to get the list of VM AzVMRunCommands without specifying RunCommandName parameter when the code runs as part of the powershell function in a function app. It works on occasional basis but not able to identify a pattern when it works and when not. The most of the time it fails with the following message: Code:
=========================================================================================================================================================================== Output:
`Settings: Function app settings: Hosts.json: requirements.psd1: Thank you in advance. |
@RobertMochnacky, could you make sure you are running the latest version by running "update-module az" ? |
Hello guys, |
@nikhilpatel909 could we get the above issue routed to ps functions? |
Addition based on the recent findings:
The problem I've described in the previous posts only happens when the 1st and 2nd function is in the same Function App. As soon as I move the 2nd Function to a separate function app it works all the time. |
Description
-Get-AzVMRunCommand without -RunCommandName parameter fails to return list of RunCommands on VM
Issue script & Debug output
Environment data
Module versions
Error output
The text was updated successfully, but these errors were encountered: