Azure / azure-powershell

Microsoft Azure PowerShell
Other
4.26k stars 3.86k forks source link

Get-AzureRmStorageAccount Error converting value "FileStorage" to type 'System.Nullable`1[Microsoft.Azure.Management.Storage.Models.Kind] #17166

Closed ngelotte closed 2 years ago

ngelotte commented 2 years ago

Description

After added a new Storage account with the type of FileStorage in our azure subscription the command Get-AzureRmStorageAccount is now failing. It is used by the AzureFileCopyV4 in Azure Devops so I cannot switch to a different command. I found a the same issue a few years back but it was supposed to be resolved but this is with the latest version of the AzureRM module and it is still happening.

Issue script & Debug output

Status Code:
OK

Headers:
Pragma                        : no-cache
x-ms-original-request-ids     : bbd7d0f9-4d0d-45c9-b411-30b6486576b9,31639f7d-f00b-4178-b28b-3f7476519622,9e76e217-bf59-46dc-afea-44daf4c61701,9ba253c9-c222-49d1-afdf-f265441ff572
x-ms-ratelimit-remaining-subscription-reads: 11998
x-ms-request-id               : ***
x-ms-correlation-request-id   : ***
x-ms-routing-request-id       : WESTUS2:20220217T223130Z:c44d4e03-f528-4ef0-829c-89dd0f2d780f
Strict-Transport-Security     : max-age=31536000; includeSubDomains
X-Content-Type-Options        : nosniff
Cache-Control                 : no-cache
Date                          : Thu, 17 Feb 2022 22:31:29 GMT

Body:
{
Descripption of all of the storage accounts one of which has the folloing
"kind": "FileStorage",
}

Get-AzureRmStorageAccount : Unable to deserialize the response.
At line:1 char:1
+ Get-AzureRmStorageAccount
+ ~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : CloseError: (:) [Get-AzureRmStorageAccount], SerializationException
    + FullyQualifiedErrorId : Microsoft.Azure.Commands.Management.Storage.GetAzureStorageAccountCommand

DEBUG: AzureQoSEvent: CommandName - Get-AzureRmStorageAccount; IsSuccess - False; Duration - 00:00:00.4351851; Exception - Microsoft.Rest.SerializationException: Unable to deserialize the response. ---> 
Newtonsoft.Json.JsonSerializationException: Error converting value "FileStorage" to type 'System.Nullable`1[Microsoft.Azure.Management.Storage.Models.Kind]'. Path '', line 1, position 4743. ---> System.A
rgumentException: Requested value 'FileStorage' was not found.
   at System.Enum.TryParseEnum(Type enumType, String value, Boolean ignoreCase, EnumResult& parseResult)
   at System.Enum.Parse(Type enumType, String value, Boolean ignoreCase)
   at Newtonsoft.Json.Utilities.EnumUtils.ParseEnumName(String enumText, Boolean isNullable, Type t)
   at Newtonsoft.Json.Converters.StringEnumConverter.ReadJson(JsonReader reader, Type objectType, Object existingValue, JsonSerializer serializer)
   --- End of inner exception stack trace ---
   at Newtonsoft.Json.Converters.StringEnumConverter.ReadJson(JsonReader reader, Type objectType, Object existingValue, JsonSerializer serializer)
   at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.DeserializeConvertable(JsonConverter converter, JsonReader reader, Type objectType, Object existingValue)
   at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.Deserialize(JsonReader reader, Type objectType, Boolean checkAdditionalContent)
   at Newtonsoft.Json.Linq.JToken.ToObject(Type objectType, JsonSerializer jsonSerializer)
   at Microsoft.Rest.Serialization.TransformationJsonConverter.ReadJson(JsonReader reader, Type objectType, Object existingValue, JsonSerializer serializer)
   at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.DeserializeConvertable(JsonConverter converter, JsonReader reader, Type objectType, Object existingValue)
   at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.PopulateList(IList list, JsonReader reader, JsonArrayContract contract, JsonProperty containerProperty, String id)
   at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.CreateList(JsonReader reader, Type objectType, JsonContract contract, JsonProperty member, Object existingValue, String id)
   at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.SetPropertyValue(JsonProperty property, JsonConverter propertyConverter, JsonContainerContract containerContract, JsonProperty containerPr
operty, JsonReader reader, Object target)
   at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.PopulateObject(Object newObject, JsonReader reader, JsonObjectContract contract, JsonProperty member, String id)
   at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.CreateObject(JsonReader reader, Type objectType, JsonContract contract, JsonProperty member, JsonContainerContract containerContract, Json
Property containerMember, Object existingValue)
   at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.Deserialize(JsonReader reader, Type objectType, Boolean checkAdditionalContent)
   at Newtonsoft.Json.JsonSerializer.DeserializeInternal(JsonReader reader, Type objectType)
   at Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject[T](String json, JsonSerializerSettings settings)
   at Microsoft.Azure.Management.Storage.StorageAccountsOperations.<ListWithHttpMessagesAsync>d__10.MoveNext()
   --- End of inner exception stack trace ---
   at Microsoft.Azure.Management.Storage.StorageAccountsOperations.<ListWithHttpMessagesAsync>d__10.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at Microsoft.Azure.Management.Storage.StorageAccountsOperationsExtensions.<ListAsync>d__11.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at Microsoft.Azure.Management.Storage.StorageAccountsOperationsExtensions.List(IStorageAccountsOperations operations)
   at Microsoft.Azure.Commands.Management.Storage.GetAzureStorageAccountCommand.ExecuteCmdlet()
   at Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet.ProcessRecord();
DEBUG: Finish sending metric.
DEBUG: 2:31:30 PM - GetAzureStorageAccountCommand end processing.
DEBUG: 2:31:30 PM - GetAzureStorageAccountCommand end processing.

Environment data

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

Module versions

Script     5.8.4      AzureRM.Profile                     {Add-AzureRmEnvironment, Clear-AzureRmContext, Clear-AzureRmDefault, Connect-AzureRmAccount...}                                                 
Script     5.2.1      AzureRM.Storage                     {Add-AzureRmStorageAccountNetworkRule, Add-AzureRmStorageContainerLegalHold, Get-AzureRmStorageAccount, Get-AzureRmStorageAccountKey...}

Error output

DEBUG: 2:37:42 PM - ResolveError begin processing with ParameterSet 'AnyErrorParameterSet'.
DEBUG: 2:37:42 PM - using account id 'nick.gelotte@rainforgrowth.com'...
WARNING: Because the Az modules have all the capabilities of AzureRM modules and more, we will retire the AzureRM modules on 29 February 2024. Learn more about the migration to Az: http://aka.ms/azpsmigr
ate.

   HistoryId: 10

Message        : Unable to deserialize the response.
StackTrace     :    at Microsoft.Azure.Management.Storage.StorageAccountsOperations.<ListWithHttpMessagesAsync>d__10.MoveNext()
                 --- End of stack trace from previous location where exception was thrown ---
                    at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
                    at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
                    at Microsoft.Azure.Management.Storage.StorageAccountsOperationsExtensions.<ListAsync>d__11.MoveNext()
                 --- End of stack trace from previous location where exception was thrown ---
                    at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
                    at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
                    at Microsoft.Azure.Management.Storage.StorageAccountsOperationsExtensions.List(IStorageAccountsOperations operations)
                    at Microsoft.Azure.Commands.Management.Storage.GetAzureStorageAccountCommand.ExecuteCmdlet()
                    at Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet.ProcessRecord()
Exception      : Microsoft.Rest.SerializationException
InvocationInfo : {Get-AzureRmStorageAccount}
Line           : Get-AzureRmStorageAccount
Position       : At line:1 char:1
                 + Get-AzureRmStorageAccount
                 + ~~~~~~~~~~~~~~~~~~~~~~~~~
HistoryId      : 10

Message        : Error converting value "FileStorage" to type 'System.Nullable`1[Microsoft.Azure.Management.Storage.Models.Kind]'. Path '', line 1, position 4743.
StackTrace     :    at Newtonsoft.Json.Converters.StringEnumConverter.ReadJson(JsonReader reader, Type objectType, Object existingValue, JsonSerializer serializer)
                    at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.DeserializeConvertable(JsonConverter converter, JsonReader reader, Type objectType, Object existingValue)
                    at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.Deserialize(JsonReader reader, Type objectType, Boolean checkAdditionalContent)
                    at Newtonsoft.Json.Linq.JToken.ToObject(Type objectType, JsonSerializer jsonSerializer)
                    at Microsoft.Rest.Serialization.TransformationJsonConverter.ReadJson(JsonReader reader, Type objectType, Object existingValue, JsonSerializer serializer)
                    at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.DeserializeConvertable(JsonConverter converter, JsonReader reader, Type objectType, Object existingValue)
                    at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.PopulateList(IList list, JsonReader reader, JsonArrayContract contract, JsonProperty containerProperty, String id)
                    at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.CreateList(JsonReader reader, Type objectType, JsonContract contract, JsonProperty member, Object existingValue, String 
                 id)
                    at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.SetPropertyValue(JsonProperty property, JsonConverter propertyConverter, JsonContainerContract containerContract, 
                 JsonProperty containerProperty, JsonReader reader, Object target)
                    at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.PopulateObject(Object newObject, JsonReader reader, JsonObjectContract contract, JsonProperty member, String id)
                    at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.CreateObject(JsonReader reader, Type objectType, JsonContract contract, JsonProperty member, JsonContainerContract 
                 containerContract, JsonProperty containerMember, Object existingValue)
                    at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.Deserialize(JsonReader reader, Type objectType, Boolean checkAdditionalContent)
                    at Newtonsoft.Json.JsonSerializer.DeserializeInternal(JsonReader reader, Type objectType)
                    at Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject[T](String json, JsonSerializerSettings settings)
                    at Microsoft.Azure.Management.Storage.StorageAccountsOperations.<ListWithHttpMessagesAsync>d__10.MoveNext()
Exception      : Newtonsoft.Json.JsonSerializationException
InvocationInfo : {Get-AzureRmStorageAccount}
Line           : Get-AzureRmStorageAccount
Position       : At line:1 char:1
                 + Get-AzureRmStorageAccount
                 + ~~~~~~~~~~~~~~~~~~~~~~~~~
HistoryId      : 10

Message        : Requested value 'FileStorage' was not found.
StackTrace     :    at System.Enum.TryParseEnum(Type enumType, String value, Boolean ignoreCase, EnumResult& parseResult)
                    at System.Enum.Parse(Type enumType, String value, Boolean ignoreCase)
                    at Newtonsoft.Json.Utilities.EnumUtils.ParseEnumName(String enumText, Boolean isNullable, Type t)
                    at Newtonsoft.Json.Converters.StringEnumConverter.ReadJson(JsonReader reader, Type objectType, Object existingValue, JsonSerializer serializer)
Exception      : System.ArgumentException
InvocationInfo : {Get-AzureRmStorageAccount}
Line           : Get-AzureRmStorageAccount
Position       : At line:1 char:1
                 + Get-AzureRmStorageAccount
                 + ~~~~~~~~~~~~~~~~~~~~~~~~~
HistoryId      : 10

   HistoryId: 8

Message        : Unable to deserialize the response.
StackTrace     :    at Microsoft.Azure.Management.Storage.StorageAccountsOperations.<ListWithHttpMessagesAsync>d__10.MoveNext()
                 --- End of stack trace from previous location where exception was thrown ---
                    at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
                    at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
                    at Microsoft.Azure.Management.Storage.StorageAccountsOperationsExtensions.<ListAsync>d__11.MoveNext()
                 --- End of stack trace from previous location where exception was thrown ---
                    at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
                    at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
                    at Microsoft.Azure.Management.Storage.StorageAccountsOperationsExtensions.List(IStorageAccountsOperations operations)
                    at Microsoft.Azure.Commands.Management.Storage.GetAzureStorageAccountCommand.ExecuteCmdlet()
                    at Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet.ProcessRecord()
Exception      : Microsoft.Rest.SerializationException
InvocationInfo : {Get-AzureRmStorageAccount}
Line           : Get-AzureRmStorageAccount |out-file  C:\Users\ngelotte\Desktop\output.txt
Position       : At line:1 char:1
                 + Get-AzureRmStorageAccount |out-file  C:\Users\ngelotte\Desktop\output ...
                 + ~~~~~~~~~~~~~~~~~~~~~~~~~
HistoryId      : 8

Message        : Error converting value "FileStorage" to type 'System.Nullable`1[Microsoft.Azure.Management.Storage.Models.Kind]'. Path '', line 1, position 4743.
StackTrace     :    at Newtonsoft.Json.Converters.StringEnumConverter.ReadJson(JsonReader reader, Type objectType, Object existingValue, JsonSerializer serializer)
                    at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.DeserializeConvertable(JsonConverter converter, JsonReader reader, Type objectType, Object existingValue)
                    at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.Deserialize(JsonReader reader, Type objectType, Boolean checkAdditionalContent)
                    at Newtonsoft.Json.Linq.JToken.ToObject(Type objectType, JsonSerializer jsonSerializer)
                    at Microsoft.Rest.Serialization.TransformationJsonConverter.ReadJson(JsonReader reader, Type objectType, Object existingValue, JsonSerializer serializer)
                    at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.DeserializeConvertable(JsonConverter converter, JsonReader reader, Type objectType, Object existingValue)
                    at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.PopulateList(IList list, JsonReader reader, JsonArrayContract contract, JsonProperty containerProperty, String id)
                    at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.CreateList(JsonReader reader, Type objectType, JsonContract contract, JsonProperty member, Object existingValue, String 
                 id)
                    at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.SetPropertyValue(JsonProperty property, JsonConverter propertyConverter, JsonContainerContract containerContract, 
                 JsonProperty containerProperty, JsonReader reader, Object target)
                    at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.PopulateObject(Object newObject, JsonReader reader, JsonObjectContract contract, JsonProperty member, String id)
                    at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.CreateObject(JsonReader reader, Type objectType, JsonContract contract, JsonProperty member, JsonContainerContract 
                 containerContract, JsonProperty containerMember, Object existingValue)
                    at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.Deserialize(JsonReader reader, Type objectType, Boolean checkAdditionalContent)
                    at Newtonsoft.Json.JsonSerializer.DeserializeInternal(JsonReader reader, Type objectType)
                    at Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject[T](String json, JsonSerializerSettings settings)
                    at Microsoft.Azure.Management.Storage.StorageAccountsOperations.<ListWithHttpMessagesAsync>d__10.MoveNext()
Exception      : Newtonsoft.Json.JsonSerializationException
InvocationInfo : {Get-AzureRmStorageAccount}
Line           : Get-AzureRmStorageAccount |out-file  C:\Users\ngelotte\Desktop\output.txt
Position       : At line:1 char:1
                 + Get-AzureRmStorageAccount |out-file  C:\Users\ngelotte\Desktop\output ...
                 + ~~~~~~~~~~~~~~~~~~~~~~~~~
HistoryId      : 8

Message        : Requested value 'FileStorage' was not found.
StackTrace     :    at System.Enum.TryParseEnum(Type enumType, String value, Boolean ignoreCase, EnumResult& parseResult)
                    at System.Enum.Parse(Type enumType, String value, Boolean ignoreCase)
                    at Newtonsoft.Json.Utilities.EnumUtils.ParseEnumName(String enumText, Boolean isNullable, Type t)
                    at Newtonsoft.Json.Converters.StringEnumConverter.ReadJson(JsonReader reader, Type objectType, Object existingValue, JsonSerializer serializer)
Exception      : System.ArgumentException
InvocationInfo : {Get-AzureRmStorageAccount}
Line           : Get-AzureRmStorageAccount |out-file  C:\Users\ngelotte\Desktop\output.txt
Position       : At line:1 char:1
                 + Get-AzureRmStorageAccount |out-file  C:\Users\ngelotte\Desktop\output ...
                 + ~~~~~~~~~~~~~~~~~~~~~~~~~
HistoryId      : 8

   HistoryId: 7

Message        : The term 'C:\Users\ngelotte\Desktop\output.txt' is not recognized as the name of a cmdlet, function, script file, or operable program. Check the spelling of the name, or if a path was 
                 included, verify that the path is correct and try again.
StackTrace     :    at System.Management.Automation.CommandDiscovery.LookupCommandInfo(String commandName, CommandTypes commandTypes, SearchResolutionOptions searchResolutionOptions, CommandOrigin 
                 commandOrigin, ExecutionContext context)
                    at System.Management.Automation.CommandDiscovery.LookupCommandProcessor(String commandName, CommandOrigin commandOrigin, Nullable`1 useLocalScope)
                    at System.Management.Automation.ExecutionContext.CreateCommand(String command, Boolean dotSource)
                    at System.Management.Automation.PipelineOps.AddCommand(PipelineProcessor pipe, CommandParameterInternal[] commandElements, CommandBaseAst commandBaseAst, CommandRedirection[] 
                 redirections, ExecutionContext context)
                    at System.Management.Automation.PipelineOps.InvokePipeline(Object input, Boolean ignoreInput, CommandParameterInternal[][] pipeElements, CommandBaseAst[] pipeElementAsts, 
                 CommandRedirection[][] commandRedirections, FunctionContext funcContext)
                    at System.Management.Automation.Interpreter.ActionCallInstruction`6.Run(InterpretedFrame frame)
                    at System.Management.Automation.Interpreter.EnterTryCatchFinallyInstruction.Run(InterpretedFrame frame)
Exception      : System.Management.Automation.CommandNotFoundException
InvocationInfo : {}
Line           : Get-AzureRmStorageAccount |C:\Users\ngelotte\Desktop\output.txt
Position       : At line:1 char:28
                 + Get-AzureRmStorageAccount |C:\Users\ngelotte\Desktop\output.txt
                 +                            ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
HistoryId      : 7

   HistoryId: 6

Message        : Unable to deserialize the response.
StackTrace     :    at Microsoft.Azure.Management.Storage.StorageAccountsOperations.<ListWithHttpMessagesAsync>d__10.MoveNext()
                 --- End of stack trace from previous location where exception was thrown ---
                    at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
                    at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
                    at Microsoft.Azure.Management.Storage.StorageAccountsOperationsExtensions.<ListAsync>d__11.MoveNext()
                 --- End of stack trace from previous location where exception was thrown ---
                    at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
                    at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
                    at Microsoft.Azure.Management.Storage.StorageAccountsOperationsExtensions.List(IStorageAccountsOperations operations)
                    at Microsoft.Azure.Commands.Management.Storage.GetAzureStorageAccountCommand.ExecuteCmdlet()
                    at Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet.ProcessRecord()
Exception      : Microsoft.Rest.SerializationException
InvocationInfo : {Get-AzureRmStorageAccount}
Line           : Get-AzureRmStorageAccount
Position       : At line:1 char:1
                 + Get-AzureRmStorageAccount
                 + ~~~~~~~~~~~~~~~~~~~~~~~~~
HistoryId      : 6

Message        : Error converting value "FileStorage" to type 'System.Nullable`1[Microsoft.Azure.Management.Storage.Models.Kind]'. Path '', line 1, position 4743.
StackTrace     :    at Newtonsoft.Json.Converters.StringEnumConverter.ReadJson(JsonReader reader, Type objectType, Object existingValue, JsonSerializer serializer)
                    at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.DeserializeConvertable(JsonConverter converter, JsonReader reader, Type objectType, Object existingValue)
                    at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.Deserialize(JsonReader reader, Type objectType, Boolean checkAdditionalContent)
                    at Newtonsoft.Json.Linq.JToken.ToObject(Type objectType, JsonSerializer jsonSerializer)
                    at Microsoft.Rest.Serialization.TransformationJsonConverter.ReadJson(JsonReader reader, Type objectType, Object existingValue, JsonSerializer serializer)
                    at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.DeserializeConvertable(JsonConverter converter, JsonReader reader, Type objectType, Object existingValue)
                    at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.PopulateList(IList list, JsonReader reader, JsonArrayContract contract, JsonProperty containerProperty, String id)
                    at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.CreateList(JsonReader reader, Type objectType, JsonContract contract, JsonProperty member, Object existingValue, String 
                 id)
                    at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.SetPropertyValue(JsonProperty property, JsonConverter propertyConverter, JsonContainerContract containerContract, 
                 JsonProperty containerProperty, JsonReader reader, Object target)
                    at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.PopulateObject(Object newObject, JsonReader reader, JsonObjectContract contract, JsonProperty member, String id)
                    at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.CreateObject(JsonReader reader, Type objectType, JsonContract contract, JsonProperty member, JsonContainerContract 
                 containerContract, JsonProperty containerMember, Object existingValue)
                    at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.Deserialize(JsonReader reader, Type objectType, Boolean checkAdditionalContent)
                    at Newtonsoft.Json.JsonSerializer.DeserializeInternal(JsonReader reader, Type objectType)
                    at Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject[T](String json, JsonSerializerSettings settings)
                    at Microsoft.Azure.Management.Storage.StorageAccountsOperations.<ListWithHttpMessagesAsync>d__10.MoveNext()
Exception      : Newtonsoft.Json.JsonSerializationException
InvocationInfo : {Get-AzureRmStorageAccount}
Line           : Get-AzureRmStorageAccount
Position       : At line:1 char:1
                 + Get-AzureRmStorageAccount
                 + ~~~~~~~~~~~~~~~~~~~~~~~~~
HistoryId      : 6

Message        : Requested value 'FileStorage' was not found.
StackTrace     :    at System.Enum.TryParseEnum(Type enumType, String value, Boolean ignoreCase, EnumResult& parseResult)
                    at System.Enum.Parse(Type enumType, String value, Boolean ignoreCase)
                    at Newtonsoft.Json.Utilities.EnumUtils.ParseEnumName(String enumText, Boolean isNullable, Type t)
                    at Newtonsoft.Json.Converters.StringEnumConverter.ReadJson(JsonReader reader, Type objectType, Object existingValue, JsonSerializer serializer)
Exception      : System.ArgumentException
InvocationInfo : {Get-AzureRmStorageAccount}
Line           : Get-AzureRmStorageAccount
Position       : At line:1 char:1
                 + Get-AzureRmStorageAccount
                 + ~~~~~~~~~~~~~~~~~~~~~~~~~
HistoryId      : 6

   HistoryId: 2

Message        : Unable to deserialize the response.
StackTrace     :    at Microsoft.Azure.Management.Storage.StorageAccountsOperations.<ListWithHttpMessagesAsync>d__10.MoveNext()
                 --- End of stack trace from previous location where exception was thrown ---
                    at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
                    at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
                    at Microsoft.Azure.Management.Storage.StorageAccountsOperationsExtensions.<ListAsync>d__11.MoveNext()
                 --- End of stack trace from previous location where exception was thrown ---
                    at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
                    at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
                    at Microsoft.Azure.Management.Storage.StorageAccountsOperationsExtensions.List(IStorageAccountsOperations operations)
                    at Microsoft.Azure.Commands.Management.Storage.GetAzureStorageAccountCommand.ExecuteCmdlet()
                    at Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet.ProcessRecord()
Exception      : Microsoft.Rest.SerializationException
InvocationInfo : {Get-AzureRmStorageAccount}
Line           : Get-AzureRmStorageAccount
Position       : At line:1 char:1
                 + Get-AzureRmStorageAccount
                 + ~~~~~~~~~~~~~~~~~~~~~~~~~
HistoryId      : 2

Message        : Error converting value "FileStorage" to type 'System.Nullable`1[Microsoft.Azure.Management.Storage.Models.Kind]'. Path '', line 1, position 4743.
StackTrace     :    at Newtonsoft.Json.Converters.StringEnumConverter.ReadJson(JsonReader reader, Type objectType, Object existingValue, JsonSerializer serializer)
                    at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.DeserializeConvertable(JsonConverter converter, JsonReader reader, Type objectType, Object existingValue)
                    at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.Deserialize(JsonReader reader, Type objectType, Boolean checkAdditionalContent)
                    at Newtonsoft.Json.Linq.JToken.ToObject(Type objectType, JsonSerializer jsonSerializer)
                    at Microsoft.Rest.Serialization.TransformationJsonConverter.ReadJson(JsonReader reader, Type objectType, Object existingValue, JsonSerializer serializer)
                    at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.DeserializeConvertable(JsonConverter converter, JsonReader reader, Type objectType, Object existingValue)
                    at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.PopulateList(IList list, JsonReader reader, JsonArrayContract contract, JsonProperty containerProperty, String id)
                    at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.CreateList(JsonReader reader, Type objectType, JsonContract contract, JsonProperty member, Object existingValue, String 
                 id)
                    at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.SetPropertyValue(JsonProperty property, JsonConverter propertyConverter, JsonContainerContract containerContract, 
                 JsonProperty containerProperty, JsonReader reader, Object target)
                    at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.PopulateObject(Object newObject, JsonReader reader, JsonObjectContract contract, JsonProperty member, String id)
                    at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.CreateObject(JsonReader reader, Type objectType, JsonContract contract, JsonProperty member, JsonContainerContract 
                 containerContract, JsonProperty containerMember, Object existingValue)
                    at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.Deserialize(JsonReader reader, Type objectType, Boolean checkAdditionalContent)
                    at Newtonsoft.Json.JsonSerializer.DeserializeInternal(JsonReader reader, Type objectType)
                    at Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject[T](String json, JsonSerializerSettings settings)
                    at Microsoft.Azure.Management.Storage.StorageAccountsOperations.<ListWithHttpMessagesAsync>d__10.MoveNext()
Exception      : Newtonsoft.Json.JsonSerializationException
InvocationInfo : {Get-AzureRmStorageAccount}
Line           : Get-AzureRmStorageAccount
Position       : At line:1 char:1
                 + Get-AzureRmStorageAccount
                 + ~~~~~~~~~~~~~~~~~~~~~~~~~
HistoryId      : 2

Message        : Requested value 'FileStorage' was not found.
StackTrace     :    at System.Enum.TryParseEnum(Type enumType, String value, Boolean ignoreCase, EnumResult& parseResult)
                    at System.Enum.Parse(Type enumType, String value, Boolean ignoreCase)
                    at Newtonsoft.Json.Utilities.EnumUtils.ParseEnumName(String enumText, Boolean isNullable, Type t)
                    at Newtonsoft.Json.Converters.StringEnumConverter.ReadJson(JsonReader reader, Type objectType, Object existingValue, JsonSerializer serializer)
Exception      : System.ArgumentException
InvocationInfo : {Get-AzureRmStorageAccount}
Line           : Get-AzureRmStorageAccount
Position       : At line:1 char:1
                 + Get-AzureRmStorageAccount
                 + ~~~~~~~~~~~~~~~~~~~~~~~~~
HistoryId      : 2

DEBUG: AzureQoSEvent: CommandName - Resolve-AzureRmError; IsSuccess - True; Duration - 00:00:00.2658838; Exception - ;
DEBUG: Finish sending metric.
DEBUG: 2:37:43 PM - ResolveError end processing.
DEBUG: 2:37:43 PM - ResolveError end processing.
blueww commented 2 years ago

@ngelotte

Please use the latest Az.Storage module. The module you use is too old, and it depends on a old .net SDK which not work with some new storage account kind like FileStorage.

Please update to latest Az.Storage module and try again. See the migration guild here.

ghost commented 2 years ago

Thanks for the feedback! We are routing this to the appropriate team for follow-up. cc @xgithubtriage.

Issue Details
### Description After added a new Storage account with the type of FileStorage in our azure subscription the command Get-AzureRmStorageAccount is now failing. It is used by the AzureFileCopyV4 in Azure Devops so I cannot switch to a different command. I found a the same issue a few years back but it was supposed to be resolved but this is with the latest version of the AzureRM module and it is still happening. ### Issue script & Debug output ```PowerShell Status Code: OK Headers: Pragma : no-cache x-ms-original-request-ids : bbd7d0f9-4d0d-45c9-b411-30b6486576b9,31639f7d-f00b-4178-b28b-3f7476519622,9e76e217-bf59-46dc-afea-44daf4c61701,9ba253c9-c222-49d1-afdf-f265441ff572 x-ms-ratelimit-remaining-subscription-reads: 11998 x-ms-request-id : *** x-ms-correlation-request-id : *** x-ms-routing-request-id : WESTUS2:20220217T223130Z:c44d4e03-f528-4ef0-829c-89dd0f2d780f Strict-Transport-Security : max-age=31536000; includeSubDomains X-Content-Type-Options : nosniff Cache-Control : no-cache Date : Thu, 17 Feb 2022 22:31:29 GMT Body: { Descripption of all of the storage accounts one of which has the folloing "kind": "FileStorage", } Get-AzureRmStorageAccount : Unable to deserialize the response. At line:1 char:1 + Get-AzureRmStorageAccount + ~~~~~~~~~~~~~~~~~~~~~~~~~ + CategoryInfo : CloseError: (:) [Get-AzureRmStorageAccount], SerializationException + FullyQualifiedErrorId : Microsoft.Azure.Commands.Management.Storage.GetAzureStorageAccountCommand DEBUG: AzureQoSEvent: CommandName - Get-AzureRmStorageAccount; IsSuccess - False; Duration - 00:00:00.4351851; Exception - Microsoft.Rest.SerializationException: Unable to deserialize the response. ---> Newtonsoft.Json.JsonSerializationException: Error converting value "FileStorage" to type 'System.Nullable`1[Microsoft.Azure.Management.Storage.Models.Kind]'. Path '', line 1, position 4743. ---> System.A rgumentException: Requested value 'FileStorage' was not found. at System.Enum.TryParseEnum(Type enumType, String value, Boolean ignoreCase, EnumResult& parseResult) at System.Enum.Parse(Type enumType, String value, Boolean ignoreCase) at Newtonsoft.Json.Utilities.EnumUtils.ParseEnumName(String enumText, Boolean isNullable, Type t) at Newtonsoft.Json.Converters.StringEnumConverter.ReadJson(JsonReader reader, Type objectType, Object existingValue, JsonSerializer serializer) --- End of inner exception stack trace --- at Newtonsoft.Json.Converters.StringEnumConverter.ReadJson(JsonReader reader, Type objectType, Object existingValue, JsonSerializer serializer) at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.DeserializeConvertable(JsonConverter converter, JsonReader reader, Type objectType, Object existingValue) at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.Deserialize(JsonReader reader, Type objectType, Boolean checkAdditionalContent) at Newtonsoft.Json.Linq.JToken.ToObject(Type objectType, JsonSerializer jsonSerializer) at Microsoft.Rest.Serialization.TransformationJsonConverter.ReadJson(JsonReader reader, Type objectType, Object existingValue, JsonSerializer serializer) at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.DeserializeConvertable(JsonConverter converter, JsonReader reader, Type objectType, Object existingValue) at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.PopulateList(IList list, JsonReader reader, JsonArrayContract contract, JsonProperty containerProperty, String id) at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.CreateList(JsonReader reader, Type objectType, JsonContract contract, JsonProperty member, Object existingValue, String id) at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.SetPropertyValue(JsonProperty property, JsonConverter propertyConverter, JsonContainerContract containerContract, JsonProperty containerPr operty, JsonReader reader, Object target) at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.PopulateObject(Object newObject, JsonReader reader, JsonObjectContract contract, JsonProperty member, String id) at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.CreateObject(JsonReader reader, Type objectType, JsonContract contract, JsonProperty member, JsonContainerContract containerContract, Json Property containerMember, Object existingValue) at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.Deserialize(JsonReader reader, Type objectType, Boolean checkAdditionalContent) at Newtonsoft.Json.JsonSerializer.DeserializeInternal(JsonReader reader, Type objectType) at Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject[T](String json, JsonSerializerSettings settings) at Microsoft.Azure.Management.Storage.StorageAccountsOperations.d__10.MoveNext() --- End of inner exception stack trace --- at Microsoft.Azure.Management.Storage.StorageAccountsOperations.d__10.MoveNext() --- End of stack trace from previous location where exception was thrown --- at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) at Microsoft.Azure.Management.Storage.StorageAccountsOperationsExtensions.d__11.MoveNext() --- End of stack trace from previous location where exception was thrown --- at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) at Microsoft.Azure.Management.Storage.StorageAccountsOperationsExtensions.List(IStorageAccountsOperations operations) at Microsoft.Azure.Commands.Management.Storage.GetAzureStorageAccountCommand.ExecuteCmdlet() at Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet.ProcessRecord(); DEBUG: Finish sending metric. DEBUG: 2:31:30 PM - GetAzureStorageAccountCommand end processing. DEBUG: 2:31:30 PM - GetAzureStorageAccountCommand end processing. ``` ### Environment data ```PowerShell PSVersion 5.1.14393.4583 PSEdition Desktop PSCompatibleVersions {1.0, 2.0, 3.0, 4.0...} BuildVersion 10.0.14393.4583 CLRVersion 4.0.30319.42000 WSManStackVersion 3.0 PSRemotingProtocolVersion 2.3 SerializationVersion 1.1.0.1 ``` ### Module versions ```PowerShell Script 5.8.4 AzureRM.Profile {Add-AzureRmEnvironment, Clear-AzureRmContext, Clear-AzureRmDefault, Connect-AzureRmAccount...} Script 5.2.1 AzureRM.Storage {Add-AzureRmStorageAccountNetworkRule, Add-AzureRmStorageContainerLegalHold, Get-AzureRmStorageAccount, Get-AzureRmStorageAccountKey...} ``` ### Error output ```PowerShell DEBUG: 2:37:42 PM - ResolveError begin processing with ParameterSet 'AnyErrorParameterSet'. DEBUG: 2:37:42 PM - using account id 'nick.gelotte@rainforgrowth.com'... WARNING: Because the Az modules have all the capabilities of AzureRM modules and more, we will retire the AzureRM modules on 29 February 2024. Learn more about the migration to Az: http://aka.ms/azpsmigr ate. HistoryId: 10 Message : Unable to deserialize the response. StackTrace : at Microsoft.Azure.Management.Storage.StorageAccountsOperations.d__10.MoveNext() --- End of stack trace from previous location where exception was thrown --- at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) at Microsoft.Azure.Management.Storage.StorageAccountsOperationsExtensions.d__11.MoveNext() --- End of stack trace from previous location where exception was thrown --- at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) at Microsoft.Azure.Management.Storage.StorageAccountsOperationsExtensions.List(IStorageAccountsOperations operations) at Microsoft.Azure.Commands.Management.Storage.GetAzureStorageAccountCommand.ExecuteCmdlet() at Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet.ProcessRecord() Exception : Microsoft.Rest.SerializationException InvocationInfo : {Get-AzureRmStorageAccount} Line : Get-AzureRmStorageAccount Position : At line:1 char:1 + Get-AzureRmStorageAccount + ~~~~~~~~~~~~~~~~~~~~~~~~~ HistoryId : 10 Message : Error converting value "FileStorage" to type 'System.Nullable`1[Microsoft.Azure.Management.Storage.Models.Kind]'. Path '', line 1, position 4743. StackTrace : at Newtonsoft.Json.Converters.StringEnumConverter.ReadJson(JsonReader reader, Type objectType, Object existingValue, JsonSerializer serializer) at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.DeserializeConvertable(JsonConverter converter, JsonReader reader, Type objectType, Object existingValue) at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.Deserialize(JsonReader reader, Type objectType, Boolean checkAdditionalContent) at Newtonsoft.Json.Linq.JToken.ToObject(Type objectType, JsonSerializer jsonSerializer) at Microsoft.Rest.Serialization.TransformationJsonConverter.ReadJson(JsonReader reader, Type objectType, Object existingValue, JsonSerializer serializer) at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.DeserializeConvertable(JsonConverter converter, JsonReader reader, Type objectType, Object existingValue) at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.PopulateList(IList list, JsonReader reader, JsonArrayContract contract, JsonProperty containerProperty, String id) at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.CreateList(JsonReader reader, Type objectType, JsonContract contract, JsonProperty member, Object existingValue, String id) at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.SetPropertyValue(JsonProperty property, JsonConverter propertyConverter, JsonContainerContract containerContract, JsonProperty containerProperty, JsonReader reader, Object target) at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.PopulateObject(Object newObject, JsonReader reader, JsonObjectContract contract, JsonProperty member, String id) at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.CreateObject(JsonReader reader, Type objectType, JsonContract contract, JsonProperty member, JsonContainerContract containerContract, JsonProperty containerMember, Object existingValue) at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.Deserialize(JsonReader reader, Type objectType, Boolean checkAdditionalContent) at Newtonsoft.Json.JsonSerializer.DeserializeInternal(JsonReader reader, Type objectType) at Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject[T](String json, JsonSerializerSettings settings) at Microsoft.Azure.Management.Storage.StorageAccountsOperations.d__10.MoveNext() Exception : Newtonsoft.Json.JsonSerializationException InvocationInfo : {Get-AzureRmStorageAccount} Line : Get-AzureRmStorageAccount Position : At line:1 char:1 + Get-AzureRmStorageAccount + ~~~~~~~~~~~~~~~~~~~~~~~~~ HistoryId : 10 Message : Requested value 'FileStorage' was not found. StackTrace : at System.Enum.TryParseEnum(Type enumType, String value, Boolean ignoreCase, EnumResult& parseResult) at System.Enum.Parse(Type enumType, String value, Boolean ignoreCase) at Newtonsoft.Json.Utilities.EnumUtils.ParseEnumName(String enumText, Boolean isNullable, Type t) at Newtonsoft.Json.Converters.StringEnumConverter.ReadJson(JsonReader reader, Type objectType, Object existingValue, JsonSerializer serializer) Exception : System.ArgumentException InvocationInfo : {Get-AzureRmStorageAccount} Line : Get-AzureRmStorageAccount Position : At line:1 char:1 + Get-AzureRmStorageAccount + ~~~~~~~~~~~~~~~~~~~~~~~~~ HistoryId : 10 HistoryId: 8 Message : Unable to deserialize the response. StackTrace : at Microsoft.Azure.Management.Storage.StorageAccountsOperations.d__10.MoveNext() --- End of stack trace from previous location where exception was thrown --- at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) at Microsoft.Azure.Management.Storage.StorageAccountsOperationsExtensions.d__11.MoveNext() --- End of stack trace from previous location where exception was thrown --- at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) at Microsoft.Azure.Management.Storage.StorageAccountsOperationsExtensions.List(IStorageAccountsOperations operations) at Microsoft.Azure.Commands.Management.Storage.GetAzureStorageAccountCommand.ExecuteCmdlet() at Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet.ProcessRecord() Exception : Microsoft.Rest.SerializationException InvocationInfo : {Get-AzureRmStorageAccount} Line : Get-AzureRmStorageAccount |out-file C:\Users\ngelotte\Desktop\output.txt Position : At line:1 char:1 + Get-AzureRmStorageAccount |out-file C:\Users\ngelotte\Desktop\output ... + ~~~~~~~~~~~~~~~~~~~~~~~~~ HistoryId : 8 Message : Error converting value "FileStorage" to type 'System.Nullable`1[Microsoft.Azure.Management.Storage.Models.Kind]'. Path '', line 1, position 4743. StackTrace : at Newtonsoft.Json.Converters.StringEnumConverter.ReadJson(JsonReader reader, Type objectType, Object existingValue, JsonSerializer serializer) at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.DeserializeConvertable(JsonConverter converter, JsonReader reader, Type objectType, Object existingValue) at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.Deserialize(JsonReader reader, Type objectType, Boolean checkAdditionalContent) at Newtonsoft.Json.Linq.JToken.ToObject(Type objectType, JsonSerializer jsonSerializer) at Microsoft.Rest.Serialization.TransformationJsonConverter.ReadJson(JsonReader reader, Type objectType, Object existingValue, JsonSerializer serializer) at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.DeserializeConvertable(JsonConverter converter, JsonReader reader, Type objectType, Object existingValue) at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.PopulateList(IList list, JsonReader reader, JsonArrayContract contract, JsonProperty containerProperty, String id) at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.CreateList(JsonReader reader, Type objectType, JsonContract contract, JsonProperty member, Object existingValue, String id) at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.SetPropertyValue(JsonProperty property, JsonConverter propertyConverter, JsonContainerContract containerContract, JsonProperty containerProperty, JsonReader reader, Object target) at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.PopulateObject(Object newObject, JsonReader reader, JsonObjectContract contract, JsonProperty member, String id) at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.CreateObject(JsonReader reader, Type objectType, JsonContract contract, JsonProperty member, JsonContainerContract containerContract, JsonProperty containerMember, Object existingValue) at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.Deserialize(JsonReader reader, Type objectType, Boolean checkAdditionalContent) at Newtonsoft.Json.JsonSerializer.DeserializeInternal(JsonReader reader, Type objectType) at Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject[T](String json, JsonSerializerSettings settings) at Microsoft.Azure.Management.Storage.StorageAccountsOperations.d__10.MoveNext() Exception : Newtonsoft.Json.JsonSerializationException InvocationInfo : {Get-AzureRmStorageAccount} Line : Get-AzureRmStorageAccount |out-file C:\Users\ngelotte\Desktop\output.txt Position : At line:1 char:1 + Get-AzureRmStorageAccount |out-file C:\Users\ngelotte\Desktop\output ... + ~~~~~~~~~~~~~~~~~~~~~~~~~ HistoryId : 8 Message : Requested value 'FileStorage' was not found. StackTrace : at System.Enum.TryParseEnum(Type enumType, String value, Boolean ignoreCase, EnumResult& parseResult) at System.Enum.Parse(Type enumType, String value, Boolean ignoreCase) at Newtonsoft.Json.Utilities.EnumUtils.ParseEnumName(String enumText, Boolean isNullable, Type t) at Newtonsoft.Json.Converters.StringEnumConverter.ReadJson(JsonReader reader, Type objectType, Object existingValue, JsonSerializer serializer) Exception : System.ArgumentException InvocationInfo : {Get-AzureRmStorageAccount} Line : Get-AzureRmStorageAccount |out-file C:\Users\ngelotte\Desktop\output.txt Position : At line:1 char:1 + Get-AzureRmStorageAccount |out-file C:\Users\ngelotte\Desktop\output ... + ~~~~~~~~~~~~~~~~~~~~~~~~~ HistoryId : 8 HistoryId: 7 Message : The term 'C:\Users\ngelotte\Desktop\output.txt' is not recognized as the name of a cmdlet, function, script file, or operable program. Check the spelling of the name, or if a path was included, verify that the path is correct and try again. StackTrace : at System.Management.Automation.CommandDiscovery.LookupCommandInfo(String commandName, CommandTypes commandTypes, SearchResolutionOptions searchResolutionOptions, CommandOrigin commandOrigin, ExecutionContext context) at System.Management.Automation.CommandDiscovery.LookupCommandProcessor(String commandName, CommandOrigin commandOrigin, Nullable`1 useLocalScope) at System.Management.Automation.ExecutionContext.CreateCommand(String command, Boolean dotSource) at System.Management.Automation.PipelineOps.AddCommand(PipelineProcessor pipe, CommandParameterInternal[] commandElements, CommandBaseAst commandBaseAst, CommandRedirection[] redirections, ExecutionContext context) at System.Management.Automation.PipelineOps.InvokePipeline(Object input, Boolean ignoreInput, CommandParameterInternal[][] pipeElements, CommandBaseAst[] pipeElementAsts, CommandRedirection[][] commandRedirections, FunctionContext funcContext) at System.Management.Automation.Interpreter.ActionCallInstruction`6.Run(InterpretedFrame frame) at System.Management.Automation.Interpreter.EnterTryCatchFinallyInstruction.Run(InterpretedFrame frame) Exception : System.Management.Automation.CommandNotFoundException InvocationInfo : {} Line : Get-AzureRmStorageAccount |C:\Users\ngelotte\Desktop\output.txt Position : At line:1 char:28 + Get-AzureRmStorageAccount |C:\Users\ngelotte\Desktop\output.txt + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ HistoryId : 7 HistoryId: 6 Message : Unable to deserialize the response. StackTrace : at Microsoft.Azure.Management.Storage.StorageAccountsOperations.d__10.MoveNext() --- End of stack trace from previous location where exception was thrown --- at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) at Microsoft.Azure.Management.Storage.StorageAccountsOperationsExtensions.d__11.MoveNext() --- End of stack trace from previous location where exception was thrown --- at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) at Microsoft.Azure.Management.Storage.StorageAccountsOperationsExtensions.List(IStorageAccountsOperations operations) at Microsoft.Azure.Commands.Management.Storage.GetAzureStorageAccountCommand.ExecuteCmdlet() at Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet.ProcessRecord() Exception : Microsoft.Rest.SerializationException InvocationInfo : {Get-AzureRmStorageAccount} Line : Get-AzureRmStorageAccount Position : At line:1 char:1 + Get-AzureRmStorageAccount + ~~~~~~~~~~~~~~~~~~~~~~~~~ HistoryId : 6 Message : Error converting value "FileStorage" to type 'System.Nullable`1[Microsoft.Azure.Management.Storage.Models.Kind]'. Path '', line 1, position 4743. StackTrace : at Newtonsoft.Json.Converters.StringEnumConverter.ReadJson(JsonReader reader, Type objectType, Object existingValue, JsonSerializer serializer) at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.DeserializeConvertable(JsonConverter converter, JsonReader reader, Type objectType, Object existingValue) at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.Deserialize(JsonReader reader, Type objectType, Boolean checkAdditionalContent) at Newtonsoft.Json.Linq.JToken.ToObject(Type objectType, JsonSerializer jsonSerializer) at Microsoft.Rest.Serialization.TransformationJsonConverter.ReadJson(JsonReader reader, Type objectType, Object existingValue, JsonSerializer serializer) at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.DeserializeConvertable(JsonConverter converter, JsonReader reader, Type objectType, Object existingValue) at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.PopulateList(IList list, JsonReader reader, JsonArrayContract contract, JsonProperty containerProperty, String id) at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.CreateList(JsonReader reader, Type objectType, JsonContract contract, JsonProperty member, Object existingValue, String id) at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.SetPropertyValue(JsonProperty property, JsonConverter propertyConverter, JsonContainerContract containerContract, JsonProperty containerProperty, JsonReader reader, Object target) at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.PopulateObject(Object newObject, JsonReader reader, JsonObjectContract contract, JsonProperty member, String id) at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.CreateObject(JsonReader reader, Type objectType, JsonContract contract, JsonProperty member, JsonContainerContract containerContract, JsonProperty containerMember, Object existingValue) at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.Deserialize(JsonReader reader, Type objectType, Boolean checkAdditionalContent) at Newtonsoft.Json.JsonSerializer.DeserializeInternal(JsonReader reader, Type objectType) at Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject[T](String json, JsonSerializerSettings settings) at Microsoft.Azure.Management.Storage.StorageAccountsOperations.d__10.MoveNext() Exception : Newtonsoft.Json.JsonSerializationException InvocationInfo : {Get-AzureRmStorageAccount} Line : Get-AzureRmStorageAccount Position : At line:1 char:1 + Get-AzureRmStorageAccount + ~~~~~~~~~~~~~~~~~~~~~~~~~ HistoryId : 6 Message : Requested value 'FileStorage' was not found. StackTrace : at System.Enum.TryParseEnum(Type enumType, String value, Boolean ignoreCase, EnumResult& parseResult) at System.Enum.Parse(Type enumType, String value, Boolean ignoreCase) at Newtonsoft.Json.Utilities.EnumUtils.ParseEnumName(String enumText, Boolean isNullable, Type t) at Newtonsoft.Json.Converters.StringEnumConverter.ReadJson(JsonReader reader, Type objectType, Object existingValue, JsonSerializer serializer) Exception : System.ArgumentException InvocationInfo : {Get-AzureRmStorageAccount} Line : Get-AzureRmStorageAccount Position : At line:1 char:1 + Get-AzureRmStorageAccount + ~~~~~~~~~~~~~~~~~~~~~~~~~ HistoryId : 6 HistoryId: 2 Message : Unable to deserialize the response. StackTrace : at Microsoft.Azure.Management.Storage.StorageAccountsOperations.d__10.MoveNext() --- End of stack trace from previous location where exception was thrown --- at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) at Microsoft.Azure.Management.Storage.StorageAccountsOperationsExtensions.d__11.MoveNext() --- End of stack trace from previous location where exception was thrown --- at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) at Microsoft.Azure.Management.Storage.StorageAccountsOperationsExtensions.List(IStorageAccountsOperations operations) at Microsoft.Azure.Commands.Management.Storage.GetAzureStorageAccountCommand.ExecuteCmdlet() at Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet.ProcessRecord() Exception : Microsoft.Rest.SerializationException InvocationInfo : {Get-AzureRmStorageAccount} Line : Get-AzureRmStorageAccount Position : At line:1 char:1 + Get-AzureRmStorageAccount + ~~~~~~~~~~~~~~~~~~~~~~~~~ HistoryId : 2 Message : Error converting value "FileStorage" to type 'System.Nullable`1[Microsoft.Azure.Management.Storage.Models.Kind]'. Path '', line 1, position 4743. StackTrace : at Newtonsoft.Json.Converters.StringEnumConverter.ReadJson(JsonReader reader, Type objectType, Object existingValue, JsonSerializer serializer) at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.DeserializeConvertable(JsonConverter converter, JsonReader reader, Type objectType, Object existingValue) at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.Deserialize(JsonReader reader, Type objectType, Boolean checkAdditionalContent) at Newtonsoft.Json.Linq.JToken.ToObject(Type objectType, JsonSerializer jsonSerializer) at Microsoft.Rest.Serialization.TransformationJsonConverter.ReadJson(JsonReader reader, Type objectType, Object existingValue, JsonSerializer serializer) at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.DeserializeConvertable(JsonConverter converter, JsonReader reader, Type objectType, Object existingValue) at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.PopulateList(IList list, JsonReader reader, JsonArrayContract contract, JsonProperty containerProperty, String id) at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.CreateList(JsonReader reader, Type objectType, JsonContract contract, JsonProperty member, Object existingValue, String id) at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.SetPropertyValue(JsonProperty property, JsonConverter propertyConverter, JsonContainerContract containerContract, JsonProperty containerProperty, JsonReader reader, Object target) at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.PopulateObject(Object newObject, JsonReader reader, JsonObjectContract contract, JsonProperty member, String id) at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.CreateObject(JsonReader reader, Type objectType, JsonContract contract, JsonProperty member, JsonContainerContract containerContract, JsonProperty containerMember, Object existingValue) at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.Deserialize(JsonReader reader, Type objectType, Boolean checkAdditionalContent) at Newtonsoft.Json.JsonSerializer.DeserializeInternal(JsonReader reader, Type objectType) at Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject[T](String json, JsonSerializerSettings settings) at Microsoft.Azure.Management.Storage.StorageAccountsOperations.d__10.MoveNext() Exception : Newtonsoft.Json.JsonSerializationException InvocationInfo : {Get-AzureRmStorageAccount} Line : Get-AzureRmStorageAccount Position : At line:1 char:1 + Get-AzureRmStorageAccount + ~~~~~~~~~~~~~~~~~~~~~~~~~ HistoryId : 2 Message : Requested value 'FileStorage' was not found. StackTrace : at System.Enum.TryParseEnum(Type enumType, String value, Boolean ignoreCase, EnumResult& parseResult) at System.Enum.Parse(Type enumType, String value, Boolean ignoreCase) at Newtonsoft.Json.Utilities.EnumUtils.ParseEnumName(String enumText, Boolean isNullable, Type t) at Newtonsoft.Json.Converters.StringEnumConverter.ReadJson(JsonReader reader, Type objectType, Object existingValue, JsonSerializer serializer) Exception : System.ArgumentException InvocationInfo : {Get-AzureRmStorageAccount} Line : Get-AzureRmStorageAccount Position : At line:1 char:1 + Get-AzureRmStorageAccount + ~~~~~~~~~~~~~~~~~~~~~~~~~ HistoryId : 2 DEBUG: AzureQoSEvent: CommandName - Resolve-AzureRmError; IsSuccess - True; Duration - 00:00:00.2658838; Exception - ; DEBUG: Finish sending metric. DEBUG: 2:37:43 PM - ResolveError end processing. DEBUG: 2:37:43 PM - ResolveError end processing. ```
Author: ngelotte
Assignees: blueww
Labels: `Storage`, `Service Attention`, `question`, `customer-reported`, `AzureRM 6.x`, `needs-author-feedback`
Milestone: -
ngelotte commented 2 years ago

I got the problem resolved by moving to Az.Storage.

The real problem was that we are using a custom build agent for Azure dev ops and the AZCopy step in Devops checks to see if the new modules are installed and then falls back to the RM modules if they are not. So we just needed to install the new modules and AZ copy uses them.

blueww commented 2 years ago

@ngelotte Thanks for the update! I will close this issue. Feel free to contact us again if need any further assistance on Powershell.