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

The request content was invalid and could not be deserialized

Open navimondo opened this issue 9 years ago • 10 comments

Cmdlet(s)

PowerShell Version

PSVersion 5.1.15063.483

Module Version

ModuleType Version Name ExportedCommands


Manifest 4.2.0 Azure
Script 3.2.0 Azure.Storage
Script 3.2.0 AzureRM.Compute
Script 3.2.0 AzureRM.profile
Script 1.0.0.0 ISE
Manifest 3.1.0.0 Microsoft.PowerShell.Management
Manifest 3.1.0.0 Microsoft.PowerShell.Utility

OS Version

BuildVersion 10.0.15063.483

Description

The Azure PS script below was working before (don't know exact PS module version) but now it is broken with the latest Azure RM module :

Debug Output

New-AzureRmDisk : The request content was invalid and could not be deserialized: 'Could not find member 'AccountType' on object of type 'ResourceDefinition'. Path 'AccountType', line 2, position 17.'. ErrorCode: InvalidRequestContent ErrorMessage: The request content was invalid and could not be deserialized: 'Could not find member 'AccountType' on object of type 'ResourceDefinition'. Path 'AccountType', line 2, position 17.'. StatusCode: 400 ReasonPhrase: Bad Request OperationID : cf65427a-d34f-4d84-b63d-3f2e3a12dcf2 At E:\My Documents\Onedrive\VirtualMachines\CreateVMfromVHD.ps1:40 char:11

  • $osDisk = New-AzureRmDisk -DiskName "WebVMDEV1OSDisk1" `
  •       ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    
    • CategoryInfo : NotSpecified: (:) [New-AzureRmDisk], ComputeCloudException
    • FullyQualifiedErrorId : Microsoft.Azure.Commands.Compute.Common.ComputeCloudException,Microsoft.Azure.Commands.Compute.Automation.NewAzureRmDisk

Script/Steps for Reproduction

$location = "West Europe" $rgName = "RGMES"

$osDiskConfig = New-AzureRmDiskConfig -AccountType StandardLRS -Location $location -CreateOption Import -SourceUri "https://xxx.blob.core.windows.net/vmdisks/VM-GEN1-WIN10.vhd" $osDisk = New-AzureRmDisk -DiskName "WebVMDEV1OSDisk1" -Disk $osDiskConfig -ResourceGroupName $rgName


Any workaround?

Br,

Kris

navimondo avatar Jul 14 '17 06:07 navimondo

@navimondo Hey Kris, we are currently tracking this issue here: https://github.com/Azure/azure-powershell/issues/4309

We plan on getting a hot fix out for this early next week. Please let us know if you have any questions!

cormacpayne avatar Jul 14 '17 15:07 cormacpayne

@cormacpayne Would switching to a previous release solve the problem?

navimondo avatar Jul 14 '17 22:07 navimondo

@navimondo using Azure PowerShell 4.1.0 (AzureRM.Compute 3.1.0) should continue to work until the hot fix is available on ~~Monday~~ Tuesday.

Edit: Updated date of release to Tuesday.

cormacpayne avatar Jul 14 '17 22:07 cormacpayne

Any news?

ShaharZuberi avatar Jul 17 '17 14:07 ShaharZuberi

@ShaharZuberi we are looking to get version 4.2.1 of Azure PowerShell out tomorrow (Tuesday) that will contain the fix for this bug.

cormacpayne avatar Jul 17 '17 16:07 cormacpayne

Same issue here as well. waiting for the fix. Is the new version out yet?

binubk avatar Jul 18 '17 08:07 binubk

same here, still an issue, I have 3.2.0

ericcsinger avatar Jul 18 '17 13:07 ericcsinger

@navimondo @ShaharZuberi @binubk @ericcsinger Hey everyone, we just released version 4.2.1 of Azure PowerShell which includes a fix for this issue. You can find the different installation platforms, as well as information about the changes made, in the GitHub release: https://github.com/Azure/azure-powershell/releases/tag/v4.2.1-July2017

Please let us know if you have any other questions!

cormacpayne avatar Jul 18 '17 19:07 cormacpayne

Tested... Its working. Awesome !!!

binubk avatar Jul 19 '17 03:07 binubk

Tested as well and working, thanks!

ericcsinger avatar Jul 20 '17 11:07 ericcsinger