Azure / Azure/azure-powershell

Get-AzSecurityContact: Unable to deserialize the response.

Open
#27,595 5 comments 1 reaction 0 assignees View on GitHub
act-codegen-extensibility-squad bug customer-reported Possible-Solution Security Service Attention Similar-Issue
Dominant language
C#
Stars
4.8k
Forks
4.3k
Avg merge
3d 14h
Merged PRs (30d)
54

Description

### Description

Getting below message when running Get-AzSecurityContact for a subscription from cloud shell
Get-AzSecurityContact: Unable to deserialize the response.

### Issue script & Debug output

```PowerShell
Get-AzSecurityContact
```

### Environment data

```PowerShell
Name Value
---- -----
PSVersion 7.5.0
PSEdition Core
GitCommitId 7.5.0
OS Microsoft Azure Linux 3.0
Platform Unix
PSCompatibleVersions {1.0, 2.0, 3.0, 4.0…}
PSRemotingProtocolVersion 2.3
SerializationVersion 1.1.0.1
WSManStackVersion 3.0
```

### Module versions

```PowerShell
ModuleType Version PreRelease Name PSEdition ExportedCommands
---------- ------- ---------- ---- --------- ----------------
Script 0.11.1 Az.Subscription Core,Desk {Disable-AzSubscription, Enable-AzSubscription, Get-AzSubscription…

Directory: /usr/local/share/powershell/Modules

ModuleType Version PreRelease Name PSEdition ExportedCommands
---------- ------- ---------- ---- --------- ----------------
Script 13.4.0 Az Core,Desk
Script 4.1.0 Az.Accounts Core,Desk {Disable-AzDataCollection, Disable-AzContextAutosave, Enable-AzDat…
Script 2.1.0 Az.Advisor Core,Desk {Disable-AzAdvisorRecommendation, Enable-AzAdvisorRecommendation, …
Script 6.1.1 Az.Aks Core,Desk {Disable-AzAksAddOn, Enable-AzAksAddOn, Get-AzAksCluster, Get-AzAk…
Script 1.2.0 Az.AnalysisServices Core,Desk {Add-AzAnalysisServicesAccount, Export-AzAnalysisServicesInstanceL…
Script 4.1.0 Az.ApiManagement Core,Desk {Add-AzApiManagementApiToGateway, Add-AzApiManagementApiToProduct,…
Script 2.0.1 Az.App Core,Desk {Disable-AzContainerAppRevision, Enable-AzContainerAppRevision, Ge…
Script 1.4.1 Az.AppConfiguration Core,Desk {Clear-AzAppConfigurationDeletedStore, Get-AzAppConfigurationDelet…
Script 2.3.0 Az.ApplicationInsights Core,Desk {Get-AzApplicationInsights, Get-AzApplicationInsightsApiKey, Get-A…
Script 1.1.0 Az.ArcResourceBridge Core,Desk {Get-AzArcResourceBridge, Get-AzArcResourceBridgeApplianceCredenti…
Script 2.1.0 Az.Attestation Core,Desk {Add-AzAttestationPolicySigner, Get-AzAttestationPolicy, Get-AzAtt…
Script 1.1.0 Az.Automanage Core,Desk {Get-AzAutomanageBestPractice, Get-AzAutomanageConfigProfile, Get-…
Script 1.11.1 Az.Automation Core,Desk {Export-AzAutomationDscConfiguration, Export-AzAutomationDscNodeRe…
Script 3.7.0 Az.Batch Core,Desk {Disable-AzBatchAutoScale, Disable-AzBatchComputeNodeScheduling, D…
Script 2.2.0 Az.Billing Core,Desk {Get-AzBillingAccount, Get-AzBillingInvoice, Get-AzBillingPeriod, …
Script 3.3.1 Az.Cdn Core,Desk {Clear-AzCdnEndpointContent, Clear-AzFrontDoorCdnEndpointContent, …
Script 2.1.0 Az.CloudService Core,Desk {Get-AzCloudService, Get-AzCloudServiceInstanceView, Get-AzCloudSe…
Script 1.16.0 Az.CognitiveServices Core,Desk {Add-AzCognitiveServicesAccountNetworkRule, Get-AzCognitiveService…
Script 9.2.0 Az.Compute Core,Desk {Add-AzImageDataDisk, Add-AzVhd, Add-AzVMAdditionalUnattendContent…
Script 1.1.0 Az.ConfidentialLedger Core,Desk {Get-AzConfidentialLedger, New-AzConfidentialLedger, New-AzConfide…
Script 1.1.1 Az.ConnectedMachine Core,Desk {Connect-AzConnectedMachine, Get-AzConnectedExtensionMetadata, Get…
Script 4.1.1 Az.ContainerInstance Core,Desk {Add-AzContainerInstanceOutput, Get-AzContainerGroup, Get-AzContai…
Script 4.3.0 Az.ContainerRegistry Core,Desk {Connect-AzContainerRegistry, Get-AzContainerRegistryManifest, Get…
Script 1.18.0 Az.CosmosDB Core,Desk {Get-AzCosmosDBAccount, Get-AzCosmosDBAccountKey, Get-AzCosmosDBCa…
Script 1.2.1 Az.DataBoxEdge Core,Desk {Get-AzDataBoxEdgeBandwidthSchedule, Get-AzDataBoxEdgeDevice, Get-…
Script 1.10.0 Az.Databricks Core,Desk {Get-AzDatabricksAccessConnector, Get-AzDatabricksOutboundNetworkD…
Script 1.19.1 Az.DataFactory Core,Desk {Add-AzDataFactoryV2DataFlowDebugSessionPackage, Add-AzDataFactory…
Script 1.1.0 Az.DataLakeAnalytics Core,Desk {Add-AzDataLakeAnalyticsDataSource, Add-AzDataLakeAnalyticsFirewal…
Script 1.4.0 Az.DataLakeStore Core,Desk {Add-AzDataLakeStoreFirewallRule, Add-AzDataLakeStoreItemContent, …
Script 2.6.1 Az.DataProtection Core,Desk {Backup-AzDataProtectionBackupInstanceAdhoc, Edit-AzDataProtection…
Script 1.1.1 Az.DataShare Core,Desk {Get-AzDataShare, Get-AzDataShareAccount, Get-AzDataShareDataSet, …
Script 5.4.1 Az.DesktopVirtualization Core,Desk {Disconnect-AzWvdUserSession, Expand-AzWvdMsixImage, Get-AzWvdAppA…
Script 2.0.1 Az.DevCenter Core,Desk {Connect-AzDevCenterAdminCatalog, Connect-AzDevCenterAdminProjectC…
Script 1.1.0 Az.DevTestLabs Core,Desk {Get-AzDtlAllowedVMSizesPolicy, Get-AzDtlAutoShutdownPolicy, Get-A…
Script 1.3.1 Az.Dns Core,Desk {Add-AzDnsRecordConfig, Get-AzDnsRecordSet, Get-AzDnsZone, New-AzD…
Script 1.1.1 Az.DnsResolver Core,Desk {Get-AzDnsForwardingRuleset, Get-AzDnsForwardingRulesetForwardingR…
Script 1.2.1 Az.ElasticSan Core,Desk {Add-AzElasticSanVolumeGroupNetworkRule, Get-AzElasticSan, Get-AzE…
Script 2.2.0 Az.EventGrid Core,Desk {Disable-AzEventGridPartnerTopic, Enable-AzEventGridPartnerDestina…
Script 5.2.0 Az.EventHub Core,Desk {New-AzEventHubAuthorizationRuleSASToken, Approve-AzEventHubPrivat…
Script 1.12.0 Az.FrontDoor Core,Desk {Disable-AzFrontDoorCustomDomainHttps, Enable-AzFrontDoorCustomDom…
Script 4.2.0 Az.Functions Core,Desk {Get-AzFunctionApp, Get-AzFunctionAppAvailableLocation, Get-AzFunc…
Script 6.3.1 Az.HDInsight Core,Desk {Add-AzHDInsightClusterIdentity, Add-AzHDInsightComponentVersion, …
Script 2.1.0 Az.HealthcareApis Core,Desk {Get-AzHealthcareApisService, Get-AzHealthcareApisWorkspace, Get-A…
Script 1.0.0 Az.HealthDataAIServices Core,Desk {Get-AzDeidService, New-AzDeidService, Remove-AzDeidService, Updat…
Script 2.8.0 Az.IotHub Core,Desk {Add-AzIotHubCertificate, Add-AzIotHubConfiguration, Add-AzIotHubD…
Script 6.3.1 Az.KeyVault Core,Desk {Add-AzKeyVaultCertificate, Add-AzKeyVaultCertificateContact, Add-…
Script 2.4.0 Az.Kusto Core,Desk {Add-AzKustoClusterCalloutPolicy, Add-AzKustoClusterLanguageExtens…
Script 1.1.0 Az.LoadTesting Core,Desk {Get-AzLoad, New-AzLoad, Remove-AzLoad, Update-AzLoad}
Script 1.6.0 Az.LogicApp Core,Desk {Get-AzIntegrationAccount, Get-AzIntegrationAccountAgreement, Get-…
Script 1.2.0 Az.MachineLearning Core,Desk {Add-AzMlWebServiceRegionalProperty, Export-AzMlWebService, Get-Az…
Script 1.2.0 Az.MachineLearningServices Core,Desk {Get-AzMLServiceQuota, Get-AzMLServiceUsage, Get-AzMLServiceVMSize…
Script 1.5.1 Az.Maintenance Core,Desk {Get-AzApplyUpdate, Get-AzConfigurationAssignment, Get-AzMaintenan…
Script 1.3.1 Az.ManagedServiceIdentity Core,Desk {Get-AzFederatedIdentityCredential, Get-AzSystemAssignedIdentity, …
Script 3.1.0 Az.ManagedServices Core,Desk {Get-AzManagedServicesAssignment, Get-AzManagedServicesDefinition,…
Script 2.1.0 Az.MarketplaceOrdering Core,Desk {Get-AzMarketplaceTerms, Invoke-AzMarketplaceSignTerms, Set-AzMark…
Script 1.2.0 Az.Media Core,Desk {Get-AzMediaService, Get-AzMediaServiceKey, Get-AzMediaServiceName…
Script 2.7.0 Az.Migrate Core,Desk {Get-AzMigrateDiscoveredServer, Get-AzMigrateJob, Get-AzMigrateLoc…
Script 6.0.2 Az.Monitor Core,Desk {Add-AzLogProfile, Add-AzMetricAlertRule, Add-AzMetricAlertRuleV2,…
Script 1.3.0 Az.MySql Core,Desk {Get-AzMySqlConfiguration, Get-AzMySqlConnectionString, Get-AzMySq…
Script 7.15.1 Az.Network Core,Desk {Add-AzApplicationGatewayAuthenticationCertificate, Add-AzApplicat…
Script 1.1.0 Az.NetworkCloud Core,Desk {Deploy-AzNetworkCloudCluster, Disable-AzNetworkCloudStorageApplia…
Script 1.2.0 Az.Nginx Core,Desk {Get-AzNginxCertificate, Get-AzNginxConfiguration, Get-AzNginxDepl…
Script 1.2.0 Az.NotificationHubs Core,Desk {Get-AzNotificationHub, Get-AzNotificationHubAuthorizationRule, Ge…
Script 3.3.0 Az.OperationalInsights Core,Desk {Disable-AzOperationalInsightsIISLogCollection, Disable-AzOperatio…
Script 1.1.0 Az.Oracle Core,Desk {Add-AzOracleCloudVMClusterVM, Get-AzOracleAutonomousDatabase, Get…
Script 1.7.1 Az.PolicyInsights Core,Desk {Get-AzPolicyAttestation, Get-AzPolicyEvent, Get-AzPolicyMetadata,…
Script 1.2.0 Az.PostgreSql Core,Desk {Get-AzPostgreSqlConfiguration, Get-AzPostgreSqlConnectionString, …
Script 2.1.0 Az.PowerBIEmbedded Core,Desk {Get-AzPowerBIEmbeddedCapacity, New-AzPowerBIEmbeddedCapacity, Rem…
Script 1.2.0 Az.PrivateDns Core,Desk {Add-AzPrivateDnsRecordConfig, Get-AzPrivateDnsRecordSet, Get-AzPr…
Script 7.6.0 Az.RecoveryServices Core,Desk {Add-AzRecoveryServicesAsrReplicationProtectedItemDisk, Backup-AzR…
Script 1.11.0 Az.RedisCache Core,Desk {Export-AzRedisCache, Get-AzRedisCache, Get-AzRedisCacheFirewallRu…
Script 1.4.1 Az.RedisEnterpriseCache Core,Desk {Export-AzRedisEnterpriseCache, Get-AzRedisEnterpriseCache, Get-Az…
Script 2.1.0 Az.Relay Core,Desk {Get-AzRelayAuthorizationRule, Get-AzRelayHybridConnection, Get-Az…
Script 1.2.0 Az.ResourceGraph Core,Desk {Search-AzGraph, Get-AzResourceGraphQuery, New-AzResourceGraphQuer…
Script 1.3.0 Az.ResourceMover Core,Desk {Add-AzResourceMoverMoveResource, Get-AzResourceMoverMoveCollectio…
Script 7.10.0 Az.Resources Core,Desk {Export-AzResourceGroup, Export-AzTemplateSpec, Get-AzDenyAssignme…
Script 1.8.0 Az.Security Core,Desk {Add-AzSecurityAdaptiveNetworkHardening, Add-AzSecuritySqlVulnerab…
Script 3.2.0 Az.SecurityInsights Core,Desk {Get-AzSentinelAlertRule, Get-AzSentinelAlertRuleAction, Get-AzSen…
Script 4.1.1 Az.ServiceBus Core,Desk {New-AzServiceBusAuthorizationRuleSASToken, Test-AzServiceBusNameA…
Script 3.5.0 Az.ServiceFabric Core,Desk {Add-AzServiceFabricClientCertificate, Add-AzServiceFabricManagedC…
Script 2.1.0 Az.SignalR Core,Desk {Get-AzSignalR, Get-AzSignalRKey, Get-AzSignalRUsage, New-AzSignal…
Script 6.0.2 Az.Sql Core,Desk {Add-AzSqlDatabaseToFailoverGroup, Add-AzSqlElasticJobStep, Add-Az…
Script 2.4.0 Az.SqlVirtualMachine Core,Desk {Assert-AzSqlVMEntraAuth, Get-AzAvailabilityGroupListener, Get-AzS…
Script 2.5.0 Az.StackHCI Core,Desk {Add-AzStackHCIVMAttestation, Disable-AzStackHCIAttestation, Disab…
Script 1.1.0 Az.StackHCIVM Core,Desk {Add-AzStackHCIVMVirtualMachineDataDisk, Add-AzStackHCIVMVirtualMa…
Script 8.3.0 Az.Storage Core,Desk {Add-AzRmStorageContainerLegalHold, Add-AzStorageAccountManagement…
Script 1.5.0 Az.StorageMover Core,Desk {Get-AzStorageMover, Get-AzStorageMoverAgent, Get-AzStorageMoverEn…
Script 2.5.0 Az.StorageSync Core,Desk {Get-AzStorageSyncCloudEndpoint, Get-AzStorageSyncGroup, Get-AzSto…
Script 2.1.0 Az.StreamAnalytics Core,Desk {Get-AzStreamAnalyticsCluster, Get-AzStreamAnalyticsClusterStreami…
Script 2.1.0 Az.Support Core,Desk {Get-AzSupportChatTranscript, Get-AzSupportChatTranscriptsNoSubscr…
Script 3.2.0 Az.Synapse Core,Desk {Add-AzSynapseDataFlowDebugSessionPackage, Add-AzSynapseTriggerSub…
Script 1.1.3 Az.Tools.Predictor Core {Enable-AzPredictor, Disable-AzPredictor, Open-AzPredictorSurvey, …
Script 1.3.0 Az.TrafficManager Core,Desk {Add-AzTrafficManagerCustomHeaderToEndpoint, Add-AzTrafficManagerC…
Script 3.4.0 Az.Websites Core,Desk {Add-AzWebAppAccessRestrictionRule, Add-AzWebAppTrafficRouting, Ed…
Script 1.0.0 Az.Workloads Core,Desk {Get-AzWorkloadsMonitor, Get-AzWorkloadsProviderInstance, Get-AzWo…
Script 0.0.0.10 AzureAD.Standard.Preview Desk {Get-AzureADDirectoryRoleTemplate, Get-AzureADContact, Remove-Azur…
Script 0.9.3 AzurePSDrive Desk
Script 3.7.2 ExchangeOnlineManagement Desk {Add-VivaModuleFeaturePolicy, Add-VivaOrgInsightsDelegatedRole, Ge…
Script 4.7.0 GuestConfiguration Desk {New-GuestConfigurationPackage, Get-GuestConfigurationPackageCompl…
Script 2.26.1 Microsoft.Graph.Applications Core,Desk {Add-MgApplicationKey, Add-MgApplicationPassword, Add-MgServicePri…
Script 2.26.1 Microsoft.Graph.Authentication Core,Desk {Connect-MgGraph, Disconnect-MgGraph, Get-MgContext, Invoke-MgGrap…
Script 2.26.1 Microsoft.Graph.Groups Core,Desk {Add-MgGroupFavorite, Add-MgGroupToLifecyclePolicy, Confirm-MgGrou…
Script 2.26.1 Microsoft.Graph.Identity.Directory… Core,Desk {Confirm-MgContactMemberGroup, Confirm-MgContactMemberObject, Conf…
Script 2.26.1 Microsoft.Graph.Identity.Governance Core,Desk {Add-MgIdentityGovernanceAccessReviewDefinitionInstanceDecision, G…
Script 2.26.1 Microsoft.Graph.Identity.SignIns Core,Desk {Confirm-MgRiskyServicePrincipalCompromised, Confirm-MgRiskyUserCo…
Script 2.26.1 Microsoft.Graph.Users.Actions Core,Desk {Confirm-MgUserMemberGroup, Confirm-MgUserMemberObject, Export-MgU…
Script 2.26.1 Microsoft.Graph.Users.Functions Core,Desk {Export-MgUserDeviceAndAppManagementData, Get-MgUserDelta, Get-MgU…
Binary 1.1.2 Microsoft.PowerShell.SecretManagem… Core {Register-SecretVault, Unregister-SecretVault, Get-SecretVault, Se…
Binary 1.0.6 Microsoft.PowerShell.SecretStore Core {Unlock-SecretStore, Set-SecretStorePassword, Get-SecretStoreConfi…
Manifest 1.2.1111 MicrosoftPowerBIMgmt Desk
Binary 1.2.1111 MicrosoftPowerBIMgmt.Admin Desk {Add-PowerBIEncryptionKey, Get-PowerBIEncryptionKey, Get-PowerBIWo…
Binary 1.2.1111 MicrosoftPowerBIMgmt.Capacities Desk Get-PowerBICapacity
Binary 1.2.1111 MicrosoftPowerBIMgmt.Data Desk {Add-PowerBIDataset, Set-PowerBITable, New-PowerBIDataset, New-Pow…
Binary 1.2.1111 MicrosoftPowerBIMgmt.Profile Desk {Connect-PowerBIServiceAccount, Disconnect-PowerBIServiceAccount, …
Binary 1.2.1111 MicrosoftPowerBIMgmt.Reports Desk {Get-PowerBIReport, New-PowerBIReport, Export-PowerBIReport, Get-P…
Binary 1.2.1111 MicrosoftPowerBIMgmt.Workspaces Desk {Get-PowerBIWorkspace, Get-PowerBIWorkspaceMigrationStatus, Add-Po…
Script 6.9.0 MicrosoftTeams Core,Desk {Add-TeamChannelUser, Add-TeamUser, Connect-MicrosoftTeams, Discon…
Script 0.9.3 PSCloudShellUtility Desk {Get-AzCommand, Invoke-AzVMCommand, Enable-AzVMPSRemoting, Disable…
Script 2.3.6 PSReadLine Desk {Get-PSReadLineKeyHandler, Set-PSReadLineKeyHandler, Remove-PSRead…
Binary 0.8.1 SHiPS Desk
Script 22.3.0 SqlServer Core,Desk {Add-RoleMember, Add-SqlAvailabilityDatabase, Add-SqlAvailabilityG…

Directory: /opt/microsoft/powershell/7/Modules

ModuleType Version PreRelease Name PSEdition ExportedCommands
---------- ------- ---------- ---- --------- ----------------
Manifest 1.2.5 Microsoft.PowerShell.Archive Desk {Compress-Archive, Expand-Archive}
Manifest 7.0.0.0 Microsoft.PowerShell.Host Core {Start-Transcript, Stop-Transcript}
Manifest 7.0.0.0 Microsoft.PowerShell.Management Core {Add-Content, Clear-Content, Clear-ItemProperty, Join-Path…}
Binary 1.1.0 Microsoft.PowerShell.PSResourceGet Core,Desk {Compress-PSResource, Find-PSResource, Get-InstalledPSResource, Ge…
Manifest 7.0.0.0 Microsoft.PowerShell.Security Core {Get-Credential, Get-ExecutionPolicy, Set-ExecutionPolicy, Convert…
Manifest 7.0.0.0 Microsoft.PowerShell.Utility Core {Export-Alias, Get-Alias, Import-Alias, New-Alias…}
Script 1.4.8.1 PackageManagement Desk {Find-Package, Get-Package, Get-PackageProvider, Get-PackageSource…
Script 2.2.5 PowerShellGet Desk {Find-Command, Find-DSCResource, Find-Module, Find-RoleCapability…}
Script 2.3.6 PSReadLine Desk {Get-PSReadLineKeyHandler, Set-PSReadLineKeyHandler, Remove-PSRead…
Binary 2.0.3 ThreadJob Desk Start-ThreadJob
```

### Error output

```PowerShell
Message : Cannot deserialize the current JSON array (e.g. [1,2,3]) into type
'Microsoft.Azure.Management.Security.Models.Page`1[Microsoft.Azure.Management.Security.Models.SecurityContact]' because the type
requires a JSON object (e.g. {"name":"value"}) to deserialize correctly.
To fix this error either change the JSON to a JSON object (e.g. {"name":"value"}) or change the deserialized type to an array or
a type that implements a collection interface (e.g. ICollection, IList) like List that can be deserialized from a JSON array.
JsonArrayAttribute can also be added to the type to force it to deserialize from a JSON array.
Path '', line 1, position 1.
StackTrace : at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.CreateList(JsonReader reader, Type objectType, JsonContract
contract, JsonProperty member, Object existingValue, String id)
at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.CreateValueInternal(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.Security.SecurityContactsOperations.ListWithHttpMessagesAsync(Dictionary`2 customHeaders,
CancellationToken cancellationToken)
Exception : Newtonsoft.Json.JsonSerializationException
InvocationInfo : {Get-AzSecurityContact}
Line : Get-AzSecurityContact
Position : At line:1 char:1
+ Get-AzSecurityContact
+ ~~~~~~~~~~~~~~~~~~~~~
HistoryId : 3
```

Contributor guide

Open the contributing guide

Research direction

Start by reproducing Get-AzSecurityContact in Azure Cloud Shell with the reported PowerShell environment and inspect the command's response deserialization path. The issue is resolved when the command successfully returns security contacts instead of reporting that the response cannot be deserialized.

Written by the indexing model from the issue text.

Assessment

Tech stack
azure, powershell
Domain
cloud, security
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Quiet
Clarity
Needs clarification
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.