azure-powershell icon indicating copy to clipboard operation
azure-powershell copied to clipboard

Restart-AzureRmVM seems to return NULL with 1.6

Open avishnyakov opened this issue 10 years ago • 7 comments

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.

avishnyakov avatar Sep 01 '16 07:09 avishnyakov

@singhkays Hey Kay, would you mind taking a look at this issue?

cormacpayne avatar Sep 01 '16 16:09 cormacpayne

I'll defer to @hyonholee to see if anything changed in the code.

singhkays avatar Sep 01 '16 16:09 singhkays

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

avishnyakov avatar Sep 05 '16 23:09 avishnyakov

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.

hyonholee avatar Sep 07 '16 21:09 hyonholee

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.

avishnyakov avatar Sep 08 '16 07:09 avishnyakov

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.

hyonholee avatar Sep 10 '16 00:09 hyonholee

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.

cormacpayne avatar Mar 04 '17 01:03 cormacpayne