Azure / Azure/azure-powershell

Export-AzAutomationDscNodeReportContent : Unable to deserialize the response.

Open
#9,663 9 comments 1 reaction 1 assignee Claimed by @vikram-m View on GitHub
act-codegen-extensibility-squad Automation customer-reported Service Attention
Dominant language
C#
Stars
4.8k
Forks
4.3k
Avg merge
3d 14h
Merged PRs (30d)
54

Description

## Description
I am facing the issue of **Unable to deserialize the response.** while using the **Export-AzAutomationDscNodeReportContent** cmdlet. I even tried to update the AZ module to it's latest version, still facing the same issue.

## Steps to reproduce

```powershell

$Node = Get-AzAutomationDscNode -ResourceGroupName "RG01" -AutomationAccountName "AC01" -Name "NA01"
$Report = Get-AzAutomationDscNodeReport -ResourceGroupName "RG01" -AutomationAccountName "AC01" -NodeId "xxxxxxxx-c7d8-11e8-a941-xxxxxxxxx" -Latest
$Report | Export-AzAutomationDscNodeReportContent -OutputFolder "C:\Users\sss\test.txt"

```

## Environment data

```
$PSVersionTable

Name Value
---- -----
PSVersion 5.1.16299.1146
PSEdition Desktop
PSCompatibleVersions {1.0, 2.0, 3.0, 4.0...}
BuildVersion 10.0.16299.1146
CLRVersion 4.0.30319.42000
WSManStackVersion 3.0
PSRemotingProtocolVersion 2.3
SerializationVersion 1.1.0.1

```

## Module versions

```
Get-Module Az.Automation -ListAvailable

Directory: C:\Program Files\WindowsPowerShell\Modules

ModuleType Version Name ExportedCommands
---------- ------- ---- ----------------
Script 1.3.0 Az.Automation {Get-AzAutomationHybridWorker...
Script 1.2.2 Az.Automation {Get-AzAutomationHybridWorker...
Script 1.0.0 Az.Automation {Get-AzAutomationHybridWorker...

```

## Error output

```
Resolve-AzError

HistoryId: 2

Message : Unable to deserialize the response.
StackTrace : at Microsoft.Azure.Management.Automation.NodeReportsOperations.d__7.MoveNext()
--- End of stack trace from previous location where exception was thrown
---
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebu
ggerNotification(Task task)
at Microsoft.Azure.Management.Automation.NodeReportsOperationsExtensio
ns.d__5.MoveNext()
--- End of stack trace from previous location where exception was thrown
---
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebu
ggerNotification(Task task)
at Microsoft.Azure.Management.Automation.NodeReportsOperationsExtensio
ns.GetContent(INodeReportsOperations operations, String
resourceGroupName, String automationAccountName, String nodeId, String
reportId)
at Microsoft.Azure.Commands.Automation.Common.AutomationPSClient.GetDs
cNodeReportContent(String resourceGroupName, String
automationAccountName, Guid nodeId, Guid reportId, String outputFolder,
Boolean overwriteExistingFile)
at Microsoft.Azure.Commands.Automation.Cmdlet.ExportAzureAutomationDsc
NodeReportContent.ExecuteCmdlet()
at Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet.Proc
essRecord()
Exception : Microsoft.Rest.SerializationException
InvocationInfo : {Export-AzAutomationDscNodeReportContent}
Line : $Report | Export-AzAutomationDscNodeReportContent -OutputFolder
"C:\Users\nh411mf\Desktop"
Position : At line:3 char:11
+ $Report | Export-AzAutomationDscNodeReportContent -OutputFolder "C:\U
...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
HistoryId : 2

Message : Additional text encountered after finished reading JSON content: {. Path
'', line 3, position 0.
StackTrace : at Newtonsoft.Json.JsonTextReader.Read()
at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.Deserial
ize(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.Automation.NodeReportsOperations.d__7.MoveNext()
Exception : Newtonsoft.Json.JsonReaderException
InvocationInfo : {Export-AzAutomationDscNodeReportContent}
Line : $Report | Export-AzAutomationDscNodeReportContent -OutputFolder
"C:\Users\nh411mf\Desktop"
Position : At line:3 char:11
+ $Report | Export-AzAutomationDscNodeReportContent -OutputFolder "C:\U
...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
HistoryId : 2
```

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.