Restart-AzureRmVM seems to return NULL with 1.6
Cmdlet(s)
Restart-AzureRmVM
PowerShell Version
5.0.10586.494
Module Version
1.6
OS Version
Win8, Win2012 R2
Description
Restart-AzureRmVM used to return result object with the properties such as 'IsSuccessStatusCode' and so on. With 1.6 Azure PowerShell, it seems to return $null all the time.
@singhkays Hey Kay, would you mind taking a look at this issue?
I'll defer to @hyonholee to see if anything changed in the code.
That's the second one. Here is another one with the same NULL result. Double-checking on my end, will post mode details.
Set-AzureRmVMCustomScriptExtension seems to return NULL with 1.6 #2820
Restart-AzureRmVM returns the operation status as 'Status' property. IsSuccessStatusCode gave wrong information about the operation result, so it was removed. The reason is that Restart-AzureRmVM calls async POST operation, and the client library polls the async operation result. 'IsSuccessStatusCode' gives the operation result of the polling operation, not the result of the original POST operation. Thus, even though the POST operation returns with a failure, 'IsSuccessStatusCode' gives a success result, since the polling operation was succeeded. So, I think the information returned by IsSuccessStatusCode is not useful and may misinform users.
Restart-AzureRmVM returns the operation status as 'Status' property. IsSuccessStatusCode gave wrong information about the operation result, so it was removed
@hyonholee removed? Breaking change.
Here are releases, cannot see anything related to such a breaking change. https://github.com/Azure/azure-powershell/releases https://github.com/Azure/azure-powershell/releases/tag/v1.6.0-July2016
Any breaking change impacts too much stuff.
In our case we have thousands of lines related to AzurePower Shell and tons of CI-ed builds. Average build take between one and two hours to complete. Having such breaking changes with the end to end workflows and CI build isn't pleasant experience. Enormous amount of time to fix, then test and get back all the CI builds. Seriously, guys.
Sorry that the explanation of the breaking change was not described in details in the release note. After the base of the client library was updated last December, IsSuccessStatusCode kept showing wrong information. The base library exposes the value for the status of polling operations, not the original operation. Now, the 'Status' property correctly shows the result of the original operation, so I suggest to refer this property instead of IsSuccessStatusCode.
Closing this issue as there has been no activity in a few months.
@avishnyakov please feel free to reopen this issue if this is still a problem.