Skip to content

Powershell update 11.07.2017 cannot create managed disk #4309

@cadumi

Description

@cadumi

Cmdlet(s)

New-AzureRmDisk

PowerShell Version

Instructions: to get PowerShell version, type $PSVersionTable and look for the value associated with PSVersion

Name Value


PSVersion 5.1.15063.483
PSEdition Desktop
PSCompatibleVersions {1.0, 2.0, 3.0, 4.0...}
BuildVersion 10.0.15063.483
CLRVersion 4.0.30319.42000
WSManStackVersion 3.0
PSRemotingProtocolVersion 2.3
SerializationVersion 1.1.0.1

Module Version

Cmdlet New-AzureRmDisk 3.2.0 AzureRM.Compute
Cmdlet New-AzureRmDiskConfig 3.2.0 AzureRM.Compute

OS Version

Windows 10

Description

Since the update to the latest PS version released on 11.07 the below error is received when trying to create a managed disk using powershell

Debug Output

Instructions: to get Debug Output, set $DebugPreference="Continue" and then execute the cmdlet or script causing the issue

PS C:\Users\cadumi> C:\Temp\Cases\Scripts\create managed disk.ps1
DEBUG: 10:39:37 AM - NewAzureRmDiskConfigCommand begin processing with ParameterSet '__AllParameterSets'.
DEBUG: 10:39:37 AM - using account id 'cadumi@microsoft.com'...
DEBUG: AzureQoSEvent: CommandName - New-AzureRmDiskConfig; IsSuccess - True; Duration - 00:00:00.0278850; Exception - ;
DEBUG: Finish sending metric.
DEBUG: 10:39:38 AM - NewAzureRmDiskConfigCommand end processing.
DEBUG: 10:39:38 AM - NewAzureRmDiskConfigCommand end processing.
DEBUG: 10:39:38 AM - NewAzureRmDisk begin processing with ParameterSet 'DefaultParameter'.
DEBUG: 10:39:38 AM - using account id 'cadumi@microsoft.com'...
DEBUG: [Common.Authentication]: Authenticating using Account: 'cadumi@microsoft.com', environment: 'AzureCloud', tenant: '72f988bf-86f1-41af-91ab-2d7cd011db47'
DEBUG: Microsoft.IdentityModel.Clients.ActiveDirectory Information: 2 :
DEBUG: 07/13/2017 08:39:38: ac788e95-a652-40b4-a208-558b6742119a - AcquireTokenHandlerBase: === Token Acquisition started:
Authority: https://login.microsoftonline.com/72f988bf-86f1-41af-91ab-2d7cd011db47/
Resource: https://management.core.windows.net/
ClientId: 1950a258-227b-4e31-a9cf-717495945fc2
CacheType: Microsoft.Azure.Commands.Common.Authentication.ProtectedFileTokenCache (3 items)
Authentication Target: User

DEBUG: Microsoft.IdentityModel.Clients.ActiveDirectory Information: 2 :
DEBUG: 07/13/2017 08:39:38: - TokenCache: Deserialized 3 items to token cache.

DEBUG: Microsoft.IdentityModel.Clients.ActiveDirectory Verbose: 1 :
DEBUG: 07/13/2017 08:39:38: ac788e95-a652-40b4-a208-558b6742119a - TokenCache: Looking up cache for a token...

DEBUG: Microsoft.IdentityModel.Clients.ActiveDirectory Information: 2 :
DEBUG: 07/13/2017 08:39:38: ac788e95-a652-40b4-a208-558b6742119a - TokenCache: An item matching the requested resource was found in the cache

DEBUG: Microsoft.IdentityModel.Clients.ActiveDirectory Verbose: 1 :
DEBUG: 07/13/2017 08:39:38: ac788e95-a652-40b4-a208-558b6742119a - TokenCache: 39.8619416383333 minutes left until token in cache expires

DEBUG: Microsoft.IdentityModel.Clients.ActiveDirectory Information: 2 :
DEBUG: 07/13/2017 08:39:38: ac788e95-a652-40b4-a208-558b6742119a - TokenCache: A matching item (access token or refresh token or both) was found in the cache

DEBUG: Microsoft.IdentityModel.Clients.ActiveDirectory Information: 2 :
DEBUG: 07/13/2017 08:39:38: ac788e95-a652-40b4-a208-558b6742119a - AcquireTokenHandlerBase: === Token Acquisition finished successfully. An access token was retuned:
Access Token Hash: g0TlXn9VNwI18NeZfKpFCsyTjmfA6s19+2rIaGyJfBU=
Refresh Token Hash: Us2JHK+I3QBUnXIG2qXLUSzjfWO/DjFJ1u+ipLQwChc=
Expiration Time: 07/13/2017 09:19:30 +00:00
User Hash: He+qD1+VFS0D8IFWRlv0btszk9GT1AqdKPYwE1LpfEE=

DEBUG: Microsoft.IdentityModel.Clients.ActiveDirectory Information: 2 :
DEBUG: 07/13/2017 08:39:38: a9885ef2-02bb-412b-b9ea-11015045d85a - AcquireTokenHandlerBase: === Token Acquisition started:
Authority: https://login.microsoftonline.com/72f988bf-86f1-41af-91ab-2d7cd011db47/
Resource: https://management.core.windows.net/
ClientId: 1950a258-227b-4e31-a9cf-717495945fc2
CacheType: Microsoft.Azure.Commands.Common.Authentication.ProtectedFileTokenCache (3 items)
Authentication Target: User

DEBUG: Microsoft.IdentityModel.Clients.ActiveDirectory Information: 2 :
DEBUG: 07/13/2017 08:39:38: - TokenCache: Deserialized 3 items to token cache.

DEBUG: Microsoft.IdentityModel.Clients.ActiveDirectory Verbose: 1 :
DEBUG: 07/13/2017 08:39:38: a9885ef2-02bb-412b-b9ea-11015045d85a - TokenCache: Looking up cache for a token...

DEBUG: Microsoft.IdentityModel.Clients.ActiveDirectory Information: 2 :
DEBUG: 07/13/2017 08:39:38: a9885ef2-02bb-412b-b9ea-11015045d85a - TokenCache: An item matching the requested resource was found in the cache

DEBUG: Microsoft.IdentityModel.Clients.ActiveDirectory Verbose: 1 :
DEBUG: 07/13/2017 08:39:38: a9885ef2-02bb-412b-b9ea-11015045d85a - TokenCache: 39.861671805 minutes left until token in cache expires

DEBUG: Microsoft.IdentityModel.Clients.ActiveDirectory Information: 2 :
DEBUG: 07/13/2017 08:39:38: a9885ef2-02bb-412b-b9ea-11015045d85a - TokenCache: A matching item (access token or refresh token or both) was found in the cache

DEBUG: Microsoft.IdentityModel.Clients.ActiveDirectory Information: 2 :
DEBUG: 07/13/2017 08:39:38: a9885ef2-02bb-412b-b9ea-11015045d85a - AcquireTokenHandlerBase: === Token Acquisition finished successfully. An access token was retuned:
Access Token Hash: g0TlXn9VNwI18NeZfKpFCsyTjmfA6s19+2rIaGyJfBU=
Refresh Token Hash: Us2JHK+I3QBUnXIG2qXLUSzjfWO/DjFJ1u+ipLQwChc=
Expiration Time: 07/13/2017 09:19:30 +00:00
User Hash: He+qD1+VFS0D8IFWRlv0btszk9GT1AqdKPYwE1LpfEE=

DEBUG: ============================ HTTP REQUEST ============================

HTTP Method:
PUT

Absolute Uri:
https://management.azure.com/subscriptions/fd16f25a-aa1e-40fd-a8a3-1b5c1fb994d5/resourceGroups/norbert/providers/Microsoft.Compute/disks/testdisk1307?api-version=2017-03-30

Headers:
x-ms-client-request-id : 10eebd7b-a56e-4c6e-b56e-0d67942e5c7a
accept-language : en-US

Body:
{
"AccountType": "StandardLRS",
"sku": {
"name": "Standard_LRS"
},
"properties": {
"creationData": {
"createOption": "Empty"
},
"diskSizeGB": 2048
},
"location": "West Europe"
}

DEBUG: ============================ HTTP RESPONSE ============================

Status Code:
BadRequest

Headers:
Pragma : no-cache
x-ms-failure-cause : gateway
x-ms-request-id : d397bbd6-fe15-4d5c-adf5-885e11597d39
x-ms-correlation-request-id : d397bbd6-fe15-4d5c-adf5-885e11597d39
x-ms-routing-request-id : WESTUS2:20170713T083940Z:d397bbd6-fe15-4d5c-adf5-885e11597d39
Strict-Transport-Security : max-age=31536000; includeSubDomains
Cache-Control : no-cache
Date : Thu, 13 Jul 2017 08:39:39 GMT

Body:
{
"error": {
"code": "InvalidRequestContent",
"message": "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.'
."
}
}

DEBUG: AzureQoSEvent: CommandName - New-AzureRmDisk; IsSuccess - True; Duration - 00:00:01.5398051; Exception - ;
DEBUG: Finish sending metric.
DEBUG: 10:39:40 AM - NewAzureRmDisk end processing.
DEBUG: 10:39:40 AM - NewAzureRmDisk end processing.
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 : d397bbd6-fe15-4d5c-adf5-885e11597d39
At C:\Temp\Cases\Scripts\create managed disk.ps1:6 char:14

  • ... dataDisk2 = New-AzureRmDisk -DiskName $dataDiskName -Disk (New-AzureR ...
  •             ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    
    • CategoryInfo : NotSpecified: (:) [New-AzureRmDisk], ComputeCloudException
    • FullyQualifiedErrorId : Microsoft.Azure.Commands.Compute.Common.ComputeCloudException,Microsoft.Azure.Commands.Compute.Automation.NewAzureRmDisk

Script/Steps for Reproduction

Create Managed disk using PS:
$rgName = 'norbert'
$location = 'West Europe'
$dataDiskName = 'testdisk1307'

$dataDisk2 = New-AzureRmDisk -DiskName $dataDiskName -Disk (New-AzureRmDiskConfig -AccountType StandardLRS -Location $location -CreateOption Empty -DiskSizeGB 2048) -ResourceGroupName $rgName

Metadata

Metadata

Labels

ComputeService AttentionThis issue is responsible by Azure service team.

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions