Azure / azure-powershell

Microsoft Azure PowerShell
Other
4.21k stars 3.81k forks source link

Remove-AzContainerGroup fails with deserialization error #9955

Closed nickstenning closed 2 years ago

nickstenning commented 5 years ago

Description

Running Remove-AzContainerGroup with the -ResourceId parameter results in a deserialization error when handling container groups with user-assigned identities.

> Remove-AzContainerGroup -ResourceId "/subscriptions/<subId>/resourceGroups/<rgName>/providers/Microsoft.ContainerInstance/containerGroups/<containerName>"
Remove-AzContainerGroup : Unable to deserialize the response.
At line:1 char:1
+ Remove-AzContainerGroup -ResourceId "/subscriptions/<subId> ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo          : CloseError: (:) [Remove-AzContainerGroup], SerializationException
+ FullyQualifiedErrorId : Microsoft.Azure.Commands.ContainerInstance.RemoveAzureContainerGroupCommand

Steps to reproduce

  1. Run Remove-AzContainerGroup -ResourceId <ResourceId> against a container group with an associated user-assigned identity.

Environment data

Name                           Value
----                           -----
PSVersion                      6.2.2
PSEdition                      Core
GitCommitId                    6.2.2
OS                             Microsoft Windows 10.0.18362
Platform                       Win32NT
PSCompatibleVersions           {1.0, 2.0, 3.0, 4.0…}
PSRemotingProtocolVersion      2.3
SerializationVersion           1.1.0.1
WSManStackVersion              3.0

Module versions

    Directory: C:\Users\xxxxxx\Documents\PowerShell\Modules

ModuleType Version    Name                                PSEdition ExportedCommands
---------- -------    ----                                --------- ----------------
Script     2.6.0      Az                                  Core,Desk
Script     1.6.2      Az.Accounts                         Core,Desk {Disable-AzDataCollection, Disable-AzContextAutosave, Enable-AzDataCollection, Enable-AzContextAutosave…}
Script     1.0.1      Az.Advisor                          Core,Desk {Get-AzAdvisorRecommendation, Enable-AzAdvisorRecommendation, Disable-AzAdvisorRecommendation, Get-AzAdvisorC…
Script     1.0.2      Az.Aks                              Core,Desk {Get-AzAks, New-AzAks, Remove-AzAks, Import-AzAksCredential…}
Script     1.1.1      Az.AnalysisServices                 Core,Desk {Resume-AzAnalysisServicesServer, Suspend-AzAnalysisServicesServer, Get-AzAnalysisServicesServer, Remove-AzAn…
Script     1.3.0      Az.ApiManagement                    Core,Desk {Add-AzApiManagementApiToProduct, Add-AzApiManagementProductToGroup, Add-AzApiManagementRegion, Add-AzApiMana…
Script     1.0.2      Az.ApplicationInsights              Core,Desk {Get-AzApplicationInsights, New-AzApplicationInsights, Remove-AzApplicationInsights, Set-AzApplicationInsight…
Script     1.3.2      Az.Automation                       Core,Desk {Get-AzAutomationHybridWorkerGroup, Remove-AzAutomationHybridWorkerGroup, Get-AzAutomationJobOutputRecord, Im…
Script     1.1.1      Az.Batch                            Core,Desk {Remove-AzBatchAccount, Get-AzBatchAccount, Get-AzBatchAccountKey, New-AzBatchAccount…}
Script     1.0.1      Az.Billing                          Core,Desk {Get-AzBillingInvoice, Get-AzBillingPeriod, Get-AzEnrollmentAccount, Get-AzConsumptionBudget…}
Script     1.3.1      Az.Cdn                              Core,Desk {Get-AzCdnProfile, Get-AzCdnProfileSsoUrl, New-AzCdnProfile, Remove-AzCdnProfile…}
Script     1.2.1      Az.CognitiveServices                Core,Desk {Get-AzCognitiveServicesAccount, Get-AzCognitiveServicesAccountKey, Get-AzCognitiveServicesAccountSku, Get-Az…
Script     2.5.0      Az.Compute                          Core,Desk {Remove-AzAvailabilitySet, Get-AzAvailabilitySet, New-AzAvailabilitySet, Update-AzAvailabilitySet…}
Script     1.0.1      Az.ContainerInstance                Core,Desk {New-AzContainerGroup, Get-AzContainerGroup, Remove-AzContainerGroup, Get-AzContainerInstanceLog}
Script     1.1.0      Az.ContainerRegistry                Core,Desk {New-AzContainerRegistry, Get-AzContainerRegistry, Update-AzContainerRegistry, Remove-AzContainerRegistry…}
Script     1.2.0      Az.DataFactory                      Core,Desk {Set-AzDataFactoryV2, Update-AzDataFactoryV2, Get-AzDataFactoryV2, Remove-AzDataFactoryV2…}
Script     1.0.1      Az.DataLakeAnalytics                Core,Desk {Get-AzDataLakeAnalyticsDataSource, New-AzDataLakeAnalyticsCatalogCredential, Remove-AzDataLakeAnalyticsCatal…
Script     1.2.2      Az.DataLakeStore                    Core,Desk {Get-AzDataLakeStoreTrustedIdProvider, Remove-AzDataLakeStoreTrustedIdProvider, Remove-AzDataLakeStoreFirewal…
Script     1.0.1      Az.DeploymentManager                Core,Desk {Get-AzDeploymentManagerArtifactSource, New-AzDeploymentManagerArtifactSource, Set-AzDeploymentManagerArtifac…
Script     1.0.0      Az.DevTestLabs                      Core,Desk {Get-AzDtlAllowedVMSizesPolicy, Get-AzDtlAutoShutdownPolicy, Get-AzDtlAutoStartPolicy, Get-AzDtlVMsPerLabPoli…
Script     1.1.1      Az.Dns                              Core,Desk {Get-AzDnsRecordSet, New-AzDnsRecordConfig, Remove-AzDnsRecordSet, Set-AzDnsRecordSet…}
Script     1.2.2      Az.EventGrid                        Core,Desk {New-AzEventGridTopic, Get-AzEventGridTopic, Set-AzEventGridTopic, New-AzEventGridTopicKey…}
Script     1.4.0      Az.EventHub                         Core,Desk {New-AzEventHubNamespace, Get-AzEventHubNamespace, Set-AzEventHubNamespace, Remove-AzEventHubNamespace…}
Script     1.1.1      Az.FrontDoor                        Core,Desk {New-AzFrontDoor, Get-AzFrontDoor, Set-AzFrontDoor, Remove-AzFrontDoor…}
Script     2.0.1      Az.HDInsight                        Core,Desk {Get-AzHDInsightJob, New-AzHDInsightSqoopJobDefinition, Wait-AzHDInsightJob, New-AzHDInsightStreamingMapReduc…
Script     1.2.1      Az.IotHub                           Core,Desk {Add-AzIotHubKey, Get-AzIotHubEventHubConsumerGroup, Get-AzIotHubConnectionString, Get-AzIotHubJob…}
Script     1.3.1      Az.KeyVault                         Core,Desk {Add-AzKeyVaultCertificate, Update-AzKeyVaultCertificate, Stop-AzKeyVaultCertificateOperation, Get-AzKeyVault…
Script     1.3.1      Az.LogicApp                         Core,Desk {Get-AzIntegrationAccountAgreement, Get-AzIntegrationAccountAssembly, Get-AzIntegrationAccountBatchConfigurat…
Script     1.1.1      Az.MachineLearning                  Core,Desk {Move-AzMlCommitmentAssociation, Get-AzMlCommitmentAssociation, Get-AzMlCommitmentPlanUsageHistory, Remove-Az…
Script     1.0.1      Az.ManagedServices                  Core,Desk {Get-AzManagedServicesAssignment, New-AzManagedServicesAssignment, Remove-AzManagedServicesAssignment, Get-Az…
Script     1.0.1      Az.MarketplaceOrdering              Core,Desk {Get-AzMarketplaceTerms, Set-AzMarketplaceTerms}
Script     1.1.0      Az.Media                            Core,Desk {Sync-AzMediaServiceStorageKey, Set-AzMediaServiceKey, Get-AzMediaServiceKey, Get-AzMediaServiceNameAvailabil…
Script     1.2.2      Az.Monitor                          Core,Desk {Get-AzMetricDefinition, Get-AzMetric, Remove-AzLogProfile, Get-AzLogProfile…}
Script     1.13.0     Az.Network                          Core,Desk {Add-AzApplicationGatewayAuthenticationCertificate, Get-AzApplicationGatewayAuthenticationCertificate, New-Az…
Script     1.1.0      Az.NotificationHubs                 Core,Desk {Get-AzNotificationHub, Get-AzNotificationHubAuthorizationRule, Get-AzNotificationHubListKey, Get-AzNotificat…
Script     1.3.3      Az.OperationalInsights              Core,Desk {New-AzOperationalInsightsAzureActivityLogDataSource, New-AzOperationalInsightsCustomLogDataSource, Disable-A…
Script     1.1.3      Az.PolicyInsights                   Core,Desk {Get-AzPolicyEvent, Get-AzPolicyState, Get-AzPolicyStateSummary, Get-AzPolicyRemediation…}
Script     1.1.0      Az.PowerBIEmbedded                  Core,Desk {Remove-AzPowerBIWorkspaceCollection, Get-AzPowerBIWorkspaceCollection, Get-AzPowerBIWorkspaceCollectionAcces…
Script     1.4.4      Az.RecoveryServices                 Core,Desk {Get-AzRecoveryServicesBackupProperty, Get-AzRecoveryServicesVault, Get-AzRecoveryServicesVaultSettingsFile, …
Script     1.1.0      Az.RedisCache                       Core,Desk {Remove-AzRedisCachePatchSchedule, New-AzRedisCacheScheduleEntry, Get-AzRedisCachePatchSchedule, New-AzRedisC…
Script     1.0.2      Az.Relay                            Core,Desk {New-AzRelayNamespace, Get-AzRelayNamespace, Set-AzRelayNamespace, Remove-AzRelayNamespace…}
Script     1.6.2      Az.Resources                        Core,Desk {Get-AzProviderOperation, Remove-AzRoleAssignment, Get-AzRoleAssignment, New-AzRoleAssignment…}
Script     1.4.0      Az.ServiceBus                       Core,Desk {New-AzServiceBusNamespace, Get-AzServiceBusNamespace, Set-AzServiceBusNamespace, Remove-AzServiceBusNamespac…
Script     1.1.2      Az.ServiceFabric                    Core,Desk {Add-AzServiceFabricApplicationCertificate, Add-AzServiceFabricClientCertificate, Add-AzServiceFabricClusterC…
Script     1.0.3      Az.SignalR                          Core,Desk {New-AzSignalR, Get-AzSignalR, Get-AzSignalRKey, New-AzSignalRKey…}
Script     1.14.1     Az.Sql                              Core,Desk {Get-AzSqlDatabaseTransparentDataEncryption, Get-AzSqlDatabaseTransparentDataEncryptionActivity, Set-AzSqlDat…
Script     1.6.0      Az.Storage                          Core,Desk {Get-AzStorageAccount, Get-AzStorageAccountKey, New-AzStorageAccount, New-AzStorageAccountKey…}
Script     1.2.0      Az.StorageSync                      Core,Desk {Invoke-AzStorageSyncCompatibilityCheck, New-AzStorageSyncService, Get-AzStorageSyncService, Remove-AzStorage…
Script     1.0.0      Az.StreamAnalytics                  Core,Desk {Get-AzStreamAnalyticsFunction, Get-AzStreamAnalyticsDefaultFunctionDefinition, New-AzStreamAnalyticsFunction…
Script     1.0.2      Az.TrafficManager                   Core,Desk {Add-AzTrafficManagerCustomHeaderToEndpoint, Remove-AzTrafficManagerCustomHeaderFromEndpoint, Add-AzTrafficMa…
Script     1.4.1      Az.Websites                         Core,Desk {Get-AzAppServicePlan, Set-AzAppServicePlan, New-AzAppServicePlan, Remove-AzAppServicePlan…}
Script     0.7.3      posh-git                            Desk      {Invoke-NullCoalescing, Add-PoshGitToProfile, Get-PromptPath, Write-GitStatus…}

    Directory: C:\program files\powershell\6\Modules

ModuleType Version    Name                                PSEdition ExportedCommands
---------- -------    ----                                --------- ----------------
Manifest   6.1.0.0    CimCmdlets                          Core      {Get-CimAssociatedInstance, Get-CimClass, Get-CimInstance, Get-CimSession…}
Manifest   1.2.3.0    Microsoft.PowerShell.Archive        Desk      {Compress-Archive, Expand-Archive}
Manifest   6.1.0.0    Microsoft.PowerShell.Diagnostics    Core      {Get-WinEvent, New-WinEvent}
Manifest   6.1.0.0    Microsoft.PowerShell.Host           Core      {Start-Transcript, Stop-Transcript}
Manifest   6.1.0.0    Microsoft.PowerShell.Management     Core      {Add-Content, Clear-Content, Clear-ItemProperty, Join-Path…}
Manifest   6.1.0.0    Microsoft.PowerShell.Security       Core      {Get-Acl, Set-Acl, Get-PfxCertificate, Get-Credential…}
Manifest   6.1.0.0    Microsoft.PowerShell.Utility        Core      {Export-Alias, Get-Alias, Import-Alias, New-Alias…}
Manifest   6.1.0.0    Microsoft.WSMan.Management          Core      {Disable-WSManCredSSP, Enable-WSManCredSSP, Get-WSManCredSSP, Set-WSManQuickConfig…}
Script     1.3.2      PackageManagement                   Desk      {Find-Package, Get-Package, Get-PackageProvider, Get-PackageSource…}
Script     2.1.3      PowerShellGet                       Desk      {Find-Command, Find-DSCResource, Find-Module, Find-RoleCapability…}
Script     0.0        PSDesiredStateConfiguration         Desk      {ValidateNodeResourceSource, Test-ConflictingResources, Get-PublicKeyFromStore, StrongConnect…}
Script     6.1.0.0    PSDiagnostics                       Core      {Disable-PSTrace, Disable-PSWSManCombinedTrace, Disable-WSManTrace, Enable-PSTrace…}
Script     2.0.0      PSReadLine                          Desk      {Get-PSReadLineKeyHandler, Set-PSReadLineKeyHandler, Remove-PSReadLineKeyHandler, Get-PSReadLineOption…}
Binary     1.1.2      ThreadJob                           Desk      Start-ThreadJob

    Directory: C:\WINDOWS\system32\WindowsPowerShell\v1.0\Modules

ModuleType Version    Name                                PSEdition ExportedCommands
---------- -------    ----                                --------- ----------------
Manifest   1.0.0.0    AppBackgroundTask                   Core,Desk {Disable-AppBackgroundTaskDiagnosticLog, Enable-AppBackgroundTaskDiagnosticLog, Set-AppBackgroundTaskResource…
Manifest   2.0.1.0    Appx                                Core,Desk {Add-AppxPackage, Get-AppxPackage, Get-AppxPackageManifest, Remove-AppxPackage…}
Script     1.0.0.0    AssignedAccess                      Core,Desk {Clear-AssignedAccess, Get-AssignedAccess, Set-AssignedAccess}
Manifest   1.0.0.0    BitLocker                           Core,Desk {Unlock-BitLocker, Suspend-BitLocker, Resume-BitLocker, Remove-BitLockerKeyProtector…}
Manifest   1.0.0.0    BranchCache                         Core,Desk {Add-BCDataCacheExtension, Clear-BCCache, Disable-BC, Disable-BCDowngrading…}
Manifest   1.0        Defender                            Core,Desk {Get-MpPreference, Set-MpPreference, Add-MpPreference, Remove-MpPreference…}
Manifest   1.0.2.0    DeliveryOptimization                Core,Desk {Delete-DeliveryOptimizationCache, Get-DeliveryOptimizationStatus, Set-DeliveryOptimizationStatus, Get-Delive…
Manifest   1.0.0.0    DirectAccessClientComponents        Core,Desk {Disable-DAManualEntryPointSelection, Enable-DAManualEntryPointSelection, Get-DAClientExperienceConfiguration…
Script     3.0        Dism                                Core,Desk {Add-AppxProvisionedPackage, Add-WindowsDriver, Add-WindowsCapability, Add-WindowsImage…}
Manifest   1.0.0.0    DnsClient                           Core,Desk {Resolve-DnsName, Clear-DnsClientCache, Get-DnsClient, Get-DnsClientCache…}
Manifest   1.0.0.0    EventTracingManagement              Core,Desk {Start-EtwTraceSession, New-EtwTraceSession, Get-EtwTraceSession, Update-EtwTraceSession…}
Manifest   1.0.0.0    HgsClient                           Core,Desk {Get-HgsAttestationBaselinePolicy, Get-HgsClientConfiguration, Test-HgsClientConfiguration, Set-HgsClientConf…
Manifest   1.0.0.0    HgsDiagnostics                      Core,Desk {New-HgsTraceTarget, Get-HgsTrace, Get-HgsTraceFileData, Test-HgsTraceTarget}
Binary     2.0.0.0    Hyper-V                             Core,Desk {Add-VMAssignableDevice, Add-VMDvdDrive, Add-VMFibreChannelHba, Add-VMGpuPartitionAdapter…}
Binary     1.1        Hyper-V                             Core,Desk {Add-VMDvdDrive, Add-VMFibreChannelHba, Add-VMHardDiskDrive, Add-VMMigrationNetwork…}
Manifest   2.0.0.0    International                       Core,Desk {Get-WinDefaultInputMethodOverride, Set-WinDefaultInputMethodOverride, Get-WinHomeLocation, Set-WinHomeLocati…
Manifest   3.0.0.0    Microsoft.PowerShell.Diagnostics    Core,Desk {Get-WinEvent, Get-Counter, Import-Counter, Export-Counter…}
Manifest   1.0.0.0    Microsoft.PowerShell.LocalAccounts  Core,Desk {Add-LocalGroupMember, Disable-LocalUser, Enable-LocalUser, Get-LocalGroup…}
Manifest   3.1.0.0    Microsoft.PowerShell.Management     Core,Desk {Add-Content, Clear-Content, Clear-ItemProperty, Join-Path…}
Manifest   1.0        MMAgent                             Core,Desk {Disable-MMAgent, Enable-MMAgent, Set-MMAgent, Get-MMAgent…}
Manifest   2.0.0.0    NetAdapter                          Core,Desk {Disable-NetAdapter, Disable-NetAdapterBinding, Disable-NetAdapterChecksumOffload, Disable-NetAdapterEncapsul…
Manifest   1.0.0.0    NetConnection                       Core,Desk {Get-NetConnectionProfile, Set-NetConnectionProfile}
Manifest   1.0.0.0    NetEventPacketCapture               Core,Desk {New-NetEventSession, Remove-NetEventSession, Get-NetEventSession, Set-NetEventSession…}
Manifest   2.0.0.0    NetLbfo                             Core,Desk {Add-NetLbfoTeamMember, Add-NetLbfoTeamNic, Get-NetLbfoTeam, Get-NetLbfoTeamMember…}
Manifest   1.0.0.0    NetNat                              Core,Desk {Get-NetNat, Get-NetNatExternalAddress, Get-NetNatStaticMapping, Get-NetNatSession…}
Manifest   2.0.0.0    NetQos                              Core,Desk {Get-NetQosPolicy, Set-NetQosPolicy, Remove-NetQosPolicy, New-NetQosPolicy}
Manifest   2.0.0.0    NetSecurity                         Core,Desk {Get-DAPolicyChange, New-NetIPsecAuthProposal, New-NetIPsecMainModeCryptoProposal, New-NetIPsecQuickModeCrypt…
Manifest   1.0.0.0    NetSwitchTeam                       Core,Desk {New-NetSwitchTeam, Remove-NetSwitchTeam, Get-NetSwitchTeam, Rename-NetSwitchTeam…}
Manifest   1.0.0.0    NetTCPIP                            Core,Desk {Get-NetIPAddress, Get-NetIPInterface, Get-NetIPv4Protocol, Get-NetIPv6Protocol…}
Manifest   1.0.0.0    NetworkConnectivityStatus           Core,Desk {Get-DAConnectionStatus, Get-NCSIPolicyConfiguration, Reset-NCSIPolicyConfiguration, Set-NCSIPolicyConfigurat…
Manifest   1.0.0.0    NetworkSwitchManager                Core,Desk {Disable-NetworkSwitchEthernetPort, Enable-NetworkSwitchEthernetPort, Get-NetworkSwitchEthernetPort, Remove-N…
Manifest   1.0.0.0    NetworkTransition                   Core,Desk {Add-NetIPHttpsCertBinding, Disable-NetDnsTransitionConfiguration, Disable-NetIPHttpsProfile, Disable-NetNatT…
Manifest   1.0.0.0    PcsvDevice                          Core,Desk {Get-PcsvDevice, Start-PcsvDevice, Stop-PcsvDevice, Restart-PcsvDevice…}
Manifest   1.0.0.0    PnpDevice                           Core,Desk {Get-PnpDevice, Get-PnpDeviceProperty, Enable-PnpDevice, Disable-PnpDevice}
Manifest   1.1        PrintManagement                     Core,Desk {Add-Printer, Add-PrinterDriver, Add-PrinterPort, Get-PrintConfiguration…}
Binary     1.0.11     ProcessMitigations                  Core,Desk {Get-ProcessMitigation, Set-ProcessMitigation, ConvertTo-ProcessMitigationPolicy}
Manifest   1.0.0.0    ScheduledTasks                      Core,Desk {Get-ScheduledTask, Set-ScheduledTask, Register-ScheduledTask, Unregister-ScheduledTask…}
Manifest   2.0.0.0    SecureBoot                          Core,Desk {Confirm-SecureBootUEFI, Set-SecureBootUEFI, Get-SecureBootUEFI, Format-SecureBootUEFI…}
Manifest   2.0.0.0    SmbShare                            Core,Desk {Get-SmbShare, Remove-SmbShare, Set-SmbShare, Block-SmbShareAccess…}
Manifest   2.0.0.0    SmbWitness                          Core,Desk {Get-SmbWitnessClient, Move-SmbWitnessClient, gsmbw, msmbw…}
Manifest   1.0.0.0    StartLayout                         Core,Desk {Export-StartLayout, Import-StartLayout, Export-StartLayoutEdgeAssets, Get-StartApps}
Manifest   2.0.0.0    Storage                             Core,Desk {Add-InitiatorIdToMaskingSet, Add-PartitionAccessPath, Add-PhysicalDisk, Add-StorageFaultDomain…}
Manifest   1.0.0.0    TroubleshootingPack                 Core,Desk {Get-TroubleshootingPack, Invoke-TroubleshootingPack}
Manifest   2.0.0.0    TrustedPlatformModule               Core,Desk {Get-Tpm, Initialize-Tpm, Clear-Tpm, Unblock-Tpm…}
Binary     2.1.639.0  UEV                                 Core,Desk
Manifest   2.0.0.0    VpnClient                           Core,Desk {Add-VpnConnection, Set-VpnConnection, Remove-VpnConnection, Get-VpnConnection…}
Manifest   1.0.0.0    Wdac                                Core,Desk {Get-OdbcDriver, Set-OdbcDriver, Get-OdbcDsn, Add-OdbcDsn…}
Manifest   2.0.0.0    Whea                                Core,Desk {Get-WheaMemoryPolicy, Set-WheaMemoryPolicy}
Manifest   1.0.0.0    WindowsDeveloperLicense             Core,Desk {Get-WindowsDeveloperLicense, Unregister-WindowsDeveloperLicense, Show-WindowsDeveloperLicenseRegistration}
Script     1.0        WindowsErrorReporting               Core,Desk {Enable-WindowsErrorReporting, Disable-WindowsErrorReporting, Get-WindowsErrorReporting}
Manifest   1.0.0.0    WindowsSearch                       Core,Desk {Get-WindowsSearchSetting, Set-WindowsSearchSetting}
Manifest   1.0.0.0    WindowsUpdate                       Core,Desk Get-WindowsUpdateLog
Manifest   1.0.0.2    WindowsUpdateProvider               Core,Desk {Get-WUAVersion, Get-WULastInstallationDate, Get-WULastScanSuccessDate, Get-WUIsPendingReboot…}

Debug output

I've <redacted> some information in what follows.

> Remove-AzContainerGroup -ResourceId "/subscriptions/<subId>/resourceGroups/<rgName>/providers/Microsoft.ContainerInstance/containerGroups/<containerName>"
DEBUG: 3:33:17 PM - RemoveAzureContainerGroupCommand begin processing with ParameterSet 'RemoveContainerGroupByResourceIdParamSet'.
DEBUG: 3:33:17 PM - using account id '<redacted>@microsoft.com'...
DEBUG: [Common.Authentication]: Authenticating using Account: '<redacted>@microsoft.com', environment: 'AzureCloud', tenant: '72f988bf-86f1-41af-91ab-2d7cd011db47'
DEBUG: [Common.Authentication]: Authenticating using configuration values: Domain: '72f988bf-86f1-41af-91ab-2d7cd011db47', Endpoint: 'https://login.microsoftonline.com/', ClientId: '1950a258-227b-4e31-a9cf-717495945fc2', ClientRedirect: 'urn:ietf:wg:oauth:2.0:oob', ResourceClientUri: 'https://management.core.windows.net/', ValidateAuthority: 'True'
DEBUG: [Common.Authentication]: Acquiring token using context with Authority 'https://login.microsoftonline.com/72f988bf-86f1-41af-91ab-2d7cd011db47/', CorrelationId: '00000000-0000-0000-0000-000000000000', ValidateAuthority: 'True'
DEBUG: [Common.Authentication]: Acquiring token using AdalConfiguration with Domain: '72f988bf-86f1-41af-91ab-2d7cd011db47', AdEndpoint: 'https://login.microsoftonline.com/', ClientId: '1950a258-227b-4e31-a9cf-717495945fc2', ClientRedirectUri: urn:ietf:wg:oauth:2.0:oob
DEBUG: [ADAL]: Information: 2019-09-03T13:33:17.6406876Z: bac527c6-7937-41fa-babf-6c009b20a23b - LoggerBase.cs: ADAL PCL.CoreCLR with assembly version '3.19.2.6005', file version '3.19.50302.0130' and informational version '2a8bec6c4c76d0c1ef819b55bdc3cda2d2605056' is running...

DEBUG: [ADAL]: Information: 2019-09-03T13:33:17.6407809Z: bac527c6-7937-41fa-babf-6c009b20a23b - LoggerBase.cs: ADAL PCL.CoreCLR with assembly version '3.19.2.6005', file version '3.19.50302.0130' and informational version '2a8bec6c4c76d0c1ef819b55bdc3cda2d2605056' is running...

DEBUG: [ADAL]: Information: 2019-09-03T13:33:17.6408418Z: bac527c6-7937-41fa-babf-6c009b20a23b - LoggerBase.cs: === Token Acquisition started:                                             CacheType: null
        Authentication Target: User
        , Authority Host: login.microsoftonline.com

DEBUG: [ADAL]: Information: 2019-09-03T13:33:17.6408876Z: bac527c6-7937-41fa-babf-6c009b20a23b - LoggerBase.cs: === 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: null
        Authentication Target: User

DEBUG: [ADAL]: Verbose: 2019-09-03T13:33:17.6410873Z: bac527c6-7937-41fa-babf-6c009b20a23b - LoggerBase.cs: Loading from cache.
DEBUG: [ADAL]: Verbose: 2019-09-03T13:33:17.6412636Z: bac527c6-7937-41fa-babf-6c009b20a23b - LoggerBase.cs: Loading from cache.
DEBUG: [ADAL]: Information: 2019-09-03T13:33:17.6470064Z: 00000000-0000-0000-0000-000000000000 - LoggerBase.cs: Deserialized 4 items to token cache.
DEBUG: [ADAL]: Verbose: 2019-09-03T13:33:17.6471566Z: bac527c6-7937-41fa-babf-6c009b20a23b - LoggerBase.cs: Looking up cache for a token...
DEBUG: [ADAL]: Verbose: 2019-09-03T13:33:17.6472210Z: bac527c6-7937-41fa-babf-6c009b20a23b - LoggerBase.cs: Looking up cache for a token...
DEBUG: [ADAL]: Information: 2019-09-03T13:33:17.6473351Z: bac527c6-7937-41fa-babf-6c009b20a23b - LoggerBase.cs: An item matching the requested resource was found in the cache
DEBUG: [ADAL]: Information: 2019-09-03T13:33:17.6473866Z: bac527c6-7937-41fa-babf-6c009b20a23b - LoggerBase.cs: An item matching the requested resource was found in the cache
DEBUG: [ADAL]: Information: 2019-09-03T13:33:17.6474763Z: bac527c6-7937-41fa-babf-6c009b20a23b - LoggerBase.cs: 50.7152421283333 minutes left until token in cache expires
DEBUG: [ADAL]: Information: 2019-09-03T13:33:17.6475261Z: bac527c6-7937-41fa-babf-6c009b20a23b - LoggerBase.cs: 50.7152421283333 minutes left until token in cache expires
DEBUG: [ADAL]: Information: 2019-09-03T13:33:17.6475735Z: bac527c6-7937-41fa-babf-6c009b20a23b - LoggerBase.cs: A matching item (access token or refresh token or both) was found in the cache

DEBUG: [ADAL]: Information: 2019-09-03T13:33:17.6476217Z: bac527c6-7937-41fa-babf-6c009b20a23b - LoggerBase.cs: A matching item (access token or refresh token or both) was found in the cache

DEBUG: [ADAL]: Information: 2019-09-03T13:33:17.6477212Z: bac527c6-7937-41fa-babf-6c009b20a23b - LoggerBase.cs: === Token Acquisition finished successfully. An access token was returned: Expiration Time: 9/3/2019 2:24:00 PM +00:00

DEBUG: [ADAL]: Information: 2019-09-03T13:33:17.6477770Z: bac527c6-7937-41fa-babf-6c009b20a23b - LoggerBase.cs: === Token Acquisition finished successfully. An access token was returned: Expiration Time: 9/3/2019 2:24:00 PM +00:00Access Token Hash: <redacted>
         User id: <redacted>

DEBUG: [Common.Authentication]: Authenticating using Account: '<redacted>@microsoft.com', environment: 'AzureCloud', tenant: '72f988bf-86f1-41af-91ab-2d7cd011db47'
DEBUG: [Common.Authentication]: Authenticating using configuration values: Domain: '72f988bf-86f1-41af-91ab-2d7cd011db47', Endpoint: 'https://login.microsoftonline.com/', ClientId: '1950a258-227b-4e31-a9cf-717495945fc2', ClientRedirect: 'urn:ietf:wg:oauth:2.0:oob', ResourceClientUri: 'https://management.core.windows.net/', ValidateAuthority: 'True'
DEBUG: [Common.Authentication]: Acquiring token using context with Authority 'https://login.microsoftonline.com/72f988bf-86f1-41af-91ab-2d7cd011db47/', CorrelationId: '00000000-0000-0000-0000-000000000000', ValidateAuthority: 'True'
DEBUG: [Common.Authentication]: Acquiring token using AdalConfiguration with Domain: '72f988bf-86f1-41af-91ab-2d7cd011db47', AdEndpoint: 'https://login.microsoftonline.com/', ClientId: '1950a258-227b-4e31-a9cf-717495945fc2', ClientRedirectUri: urn:ietf:wg:oauth:2.0:oob
DEBUG: [ADAL]: Information: 2019-09-03T13:33:17.6489951Z: 67c50967-1d24-477a-ae49-43135f38954d - LoggerBase.cs: ADAL PCL.CoreCLR with assembly version '3.19.2.6005', file version '3.19.50302.0130' and informational version '2a8bec6c4c76d0c1ef819b55bdc3cda2d2605056' is running...

DEBUG: [ADAL]: Information: 2019-09-03T13:33:17.6491302Z: 67c50967-1d24-477a-ae49-43135f38954d - LoggerBase.cs: ADAL PCL.CoreCLR with assembly version '3.19.2.6005', file version '3.19.50302.0130' and informational version '2a8bec6c4c76d0c1ef819b55bdc3cda2d2605056' is running...

DEBUG: [ADAL]: Information: 2019-09-03T13:33:17.6492533Z: 67c50967-1d24-477a-ae49-43135f38954d - LoggerBase.cs: === Token Acquisition started:                                             CacheType: null
        Authentication Target: User
        , Authority Host: login.microsoftonline.com

DEBUG: [ADAL]: Information: 2019-09-03T13:33:17.6493305Z: 67c50967-1d24-477a-ae49-43135f38954d - LoggerBase.cs: === 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: null
        Authentication Target: User

DEBUG: [ADAL]: Verbose: 2019-09-03T13:33:17.6495070Z: 67c50967-1d24-477a-ae49-43135f38954d - LoggerBase.cs: Loading from cache.
DEBUG: [ADAL]: Verbose: 2019-09-03T13:33:17.6495917Z: 67c50967-1d24-477a-ae49-43135f38954d - LoggerBase.cs: Loading from cache.
DEBUG: [ADAL]: Information: 2019-09-03T13:33:17.6503774Z: 00000000-0000-0000-0000-000000000000 - LoggerBase.cs: Deserialized 4 items to token cache.

DEBUG: [ADAL]: Verbose: 2019-09-03T13:33:17.6505313Z: 67c50967-1d24-477a-ae49-43135f38954d - LoggerBase.cs: Looking up cache for a token...
DEBUG: [ADAL]: Verbose: 2019-09-03T13:33:17.6506268Z: 67c50967-1d24-477a-ae49-43135f38954d - LoggerBase.cs: Looking up cache for a token...
DEBUG: [ADAL]: Information: 2019-09-03T13:33:17.6507635Z: 67c50967-1d24-477a-ae49-43135f38954d - LoggerBase.cs: An item matching the requested resource was found in the cache
DEBUG: [ADAL]: Information: 2019-09-03T13:33:17.6508358Z: 67c50967-1d24-477a-ae49-43135f38954d - LoggerBase.cs: An item matching the requested resource was found in the cache
DEBUG: [ADAL]: Information: 2019-09-03T13:33:17.6509637Z: 67c50967-1d24-477a-ae49-43135f38954d - LoggerBase.cs: 50.7151840566667 minutes left until token in cache expires
DEBUG: [ADAL]: Information: 2019-09-03T13:33:17.6510340Z: 67c50967-1d24-477a-ae49-43135f38954d - LoggerBase.cs: 50.7151840566667 minutes left until token in cache expires
DEBUG: [ADAL]: Information: 2019-09-03T13:33:17.6511012Z: 67c50967-1d24-477a-ae49-43135f38954d - LoggerBase.cs: A matching item (access token or refresh token or both) was found in the cache

DEBUG: [ADAL]: Information: 2019-09-03T13:33:17.6511705Z: 67c50967-1d24-477a-ae49-43135f38954d - LoggerBase.cs: A matching item (access token or refresh token or both) was found in the cache

DEBUG: [ADAL]: Information: 2019-09-03T13:33:17.6512991Z: 67c50967-1d24-477a-ae49-43135f38954d - LoggerBase.cs: === Token Acquisition finished successfully. An access token was returned: Expiration Time: 9/3/2019 2:24:00 PM +00:00

DEBUG: [ADAL]: Information: 2019-09-03T13:33:17.6513780Z: 67c50967-1d24-477a-ae49-43135f38954d - LoggerBase.cs: === Token Acquisition finished successfully. An access token was returned: Expiration Time: 9/3/2019 2:24:00 PM +00:00Access Token Hash: CGA/MYRzoQePCK4u8LTlX5Nm48/M0GxoRfz+FPAM3o8=
         User id: 5236c9a3-ca70-4acd-849f-294e22886e69

DEBUG: [Common.Authentication]: Renewing Token with Type: 'Bearer', Expiry: '09/03/2019 14:24:00 +00:00', MultipleResource? 'True', Tenant: '72f988bf-86f1-41af-91ab-2d7cd011db47', UserId: '<redacted>@microsoft.com'
DEBUG: [Common.Authentication]: User info for token DisplayId: '<redacted>@microsoft.com', Name: <redacted>, IdProvider: 'https://sts.windows.net/72f988bf-86f1-41af-91ab-2d7cd011db47/', Uid: '<redacted>'
DEBUG: [Common.Authentication]: Checking token expiration, token expires '09/03/2019 14:24:00 +00:00' Comparing to '09/03/2019 13:33:17 +00:00' With threshold '00:05:00', calculated time until token expiry: '00:50:42.9078418'
DEBUG: ============================ HTTP REQUEST ============================
HTTP Method:
GET

Absolute Uri:
https://management.azure.com//subscriptions/<redacted>/resourceGroups/<redacted>/providers/Microsoft.ContainerInstance/containerGroups/<redacted>?api-version=2018-10-01

Headers:
x-ms-client-request-id        : ef1da146-0302-4cf4-9084-182bc185a7d6
Accept-Language               : en-US

Body:

DEBUG: ============================ HTTP RESPONSE ============================
Status Code:
OK

Headers:
Cache-Control                 : no-cache
Pragma                        : no-cache
Vary                          : Accept-Encoding
x-ms-request-id               : centralus:861e0414-1e46-4f5c-816a-268343481c32
x-ms-ratelimit-remaining-subscription-reads: 11997
x-ms-correlation-request-id   : befb9402-591a-4ffb-b043-4456684fcc25
x-ms-routing-request-id       : FRANCESOUTH:20190903T133318Z:befb9402-591a-4ffb-b043-4456684fcc25
Strict-Transport-Security     : max-age=31536000; includeSubDomains
X-Content-Type-Options        : nosniff
Date                          : Tue, 03 Sep 2019 13:33:17 GMT

Body:
{
  "properties": {
    "provisioningState": "Succeeded",
    "containers": [
      {
        "name": "<redacted>",
        "properties": {
          "image": "<redacted>",
          "ports": [
            {
              "protocol": "TCP",
              "port": 80
            }
          ],
          "environmentVariables": [],
          "instanceView": {
            "restartCount": 0,
            "currentState": {
              "state": "Running",
              "startTime": "2019-09-03T11:44:00Z",
              "detailStatus": ""
            },
            "events": [...]
          },
          "resources": {
            "requests": {
              "memoryInGB": 8.0,
              "cpu": 4.0
            }
          }
        }
      }
    ],
    "imageRegistryCredentials": [
      {
        "server": "<redacted>",
        "username": "<redacted>"
      }
    ],
    "restartPolicy": "Always",
    "ipAddress": {
      "ports": [
        {
          "protocol": "TCP",
          "port": 80
        }
      ],
      "ip": "<redacted>",
      "type": "Public"
    },
    "osType": "Linux",
    "instanceView": {
      "events": [],
      "state": "Running"
    }
  },
  "identity": {
    "userAssignedIdentities": {
      "/subscriptions/<redacted>/resourcegroups/<redacted>/providers/Microsoft.ManagedIdentity/userAssignedIdentities/<redacted>": {
        "principalId": "<redacted>",
        "clientId": "<redacted>"
      }
    },
    "tenantId": "72f988bf-86f1-41af-91ab-2d7cd011db47",
    "type": "UserAssigned"
  },
  "id": "/subscriptions/<redacted>/resourceGroups/<redacted>/providers/Microsoft.ContainerInstance/containerGroups/<redacted>",
  "name": "<redacted>",
  "type": "Microsoft.ContainerInstance/containerGroups",
  "location": "centralus",
  "tags": {}
}

Remove-AzContainerGroup : Unable to deserialize the response.
At line:1 char:1
+ Remove-AzContainerGroup -ResourceId "/subscriptions/<redacted> ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo          : CloseError: (:) [Remove-AzContainerGroup], SerializationException
+ FullyQualifiedErrorId : Microsoft.Azure.Commands.ContainerInstance.RemoveAzureContainerGroupCommand
DEBUG: AzureQoSEvent: CommandName - Remove-AzContainerGroup; IsSuccess - False; Duration - 00:00:01.2717449; Exception - Microsoft.Rest.SerializationException: Unable to deserialize the response. ---> Newtonsoft.Json.JsonSerializationException: Error converting value "UserAssigned" to type 'System.Nullable`1[Microsoft.Azure.Management.Internal.Resources.Models.ResourceIdentityType]'. Path 'identity.type', line 1, position 1784. ---> System.ArgumentException: Requested value 'UserAssigned' was not found.
   at Newtonsoft.Json.Utilities.EnumUtils.ParseEnum(Type enumType, NamingStrategy namingStrategy, String value, Boolean disallowNumber)
   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.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.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 Newtonsoft.Json.JsonSerializer.Deserialize(JsonReader reader, Type objectType)
   at Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject[T](String json, JsonSerializerSettings settings)
   at Microsoft.Azure.Management.Internal.Resources.ResourcesOperations.GetByIdWithHttpMessagesAsync(String resourceId, String apiVersion, Dictionary`2 customHeaders, CancellationToken cancellationToken)
   --- End of inner exception stack trace ---
   at Microsoft.Azure.Management.Internal.Resources.ResourcesOperations.GetByIdWithHttpMessagesAsync(String resourceId, String apiVersion, Dictionary`2 customHeaders, CancellationToken cancellationToken)
   at Microsoft.Azure.Management.Internal.Resources.ResourcesOperationsExtensions.GetByIdAsync(IResourcesOperations operations, String resourceId, String apiVersion, CancellationToken cancellationToken)
   at Microsoft.Azure.Management.Internal.Resources.ResourcesOperationsExtensions.GetById(IResourcesOperations operations, String resourceId, String apiVersion)
   at Microsoft.Azure.Commands.ContainerInstance.RemoveAzureContainerGroupCommand.ExecuteCmdlet()
   at Microsoft.WindowsAzure.Commands.Utilities.Common.CmdletExtensions.<>c__3`1.<ExecuteSynchronouslyOrAsJob>b__3_0(T c)
   at Microsoft.WindowsAzure.Commands.Utilities.Common.CmdletExtensions.ExecuteSynchronouslyOrAsJob[T](T cmdlet, Action`1 executor)
   at Microsoft.WindowsAzure.Commands.Utilities.Common.CmdletExtensions.ExecuteSynchronouslyOrAsJob[T](T cmdlet)
   at Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet.ProcessRecord();
DEBUG: Finish sending metric.
DEBUG: 3:33:19 PM - RemoveAzureContainerGroupCommand end processing.
DEBUG: 3:33:19 PM - RemoveAzureContainerGroupCommand end processing.

Error output

> Resolve-AzError -Last
DEBUG: 3:40:20 PM - ResolveError begin processing with ParameterSet 'LastErrorParameterSet'.
DEBUG: 3:40:20 PM - using account id '<redacted>@microsoft.com'...

   HistoryId: 14
Message        : Unable to deserialize the response.
StackTrace     :    at Microsoft.Azure.Management.Internal.Resources.ResourcesOperations.GetByIdWithHttpMessagesAsync(String resourceId, String apiVersion, Dictionary`2
                 customHeaders, CancellationToken cancellationToken)
                    at Microsoft.Azure.Management.Internal.Resources.ResourcesOperationsExtensions.GetByIdAsync(IResourcesOperations operations, String resourceId, String
                 apiVersion, CancellationToken cancellationToken)
                    at Microsoft.Azure.Management.Internal.Resources.ResourcesOperationsExtensions.GetById(IResourcesOperations operations, String resourceId, String apiVersion)
                    at Microsoft.Azure.Commands.ContainerInstance.RemoveAzureContainerGroupCommand.ExecuteCmdlet()
                    at Microsoft.WindowsAzure.Commands.Utilities.Common.CmdletExtensions.<>c__3`1.<ExecuteSynchronouslyOrAsJob>b__3_0(T c)
                    at Microsoft.WindowsAzure.Commands.Utilities.Common.CmdletExtensions.ExecuteSynchronouslyOrAsJob[T](T cmdlet, Action`1 executor)
                    at Microsoft.WindowsAzure.Commands.Utilities.Common.CmdletExtensions.ExecuteSynchronouslyOrAsJob[T](T cmdlet)
                    at Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet.ProcessRecord()
Exception      : Microsoft.Rest.SerializationException
InvocationInfo : {Remove-AzContainerGroup}
Line           : Remove-AzContainerGroup -ResourceId
                 "/subscriptions/<redacted>/resourceGroups/<redacted>/providers/Microsoft.ContainerInstance/containerGroups/<redacted>"  Position       : At line:1 char:1
                 + Remove-AzContainerGroup -ResourceId "/subscriptions/<redacted> ...
                 + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
HistoryId      : 14

Message        : Error converting value "UserAssigned" to type 'System.Nullable`1[Microsoft.Azure.Management.Internal.Resources.Models.ResourceIdentityType]'. Path
                 'identity.type', line 1, position 1784.
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.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.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 Newtonsoft.Json.JsonSerializer.Deserialize(JsonReader reader, Type objectType)
                    at Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject[T](String json, JsonSerializerSettings settings)
                    at Microsoft.Azure.Management.Internal.Resources.ResourcesOperations.GetByIdWithHttpMessagesAsync(String resourceId, String apiVersion, Dictionary`2
                 customHeaders, CancellationToken cancellationToken)
Exception      : Newtonsoft.Json.JsonSerializationException
InvocationInfo : {Remove-AzContainerGroup}
Line           : Remove-AzContainerGroup -ResourceId
                 "/subscriptions/<redacted>/resourceGroups/<redacted>/providers/Microsoft.ContainerInstance/containerGroups/<redacted>"  Position       : At line:1 char:1
                 + Remove-AzContainerGroup -ResourceId "/subscriptions/<redacted> ...
                 + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
HistoryId      : 14

Message        : Requested value 'UserAssigned' was not found.
StackTrace     :    at Newtonsoft.Json.Utilities.EnumUtils.ParseEnum(Type enumType, NamingStrategy namingStrategy, String value, Boolean disallowNumber)
                    at Newtonsoft.Json.Converters.StringEnumConverter.ReadJson(JsonReader reader, Type objectType, Object existingValue, JsonSerializer serializer)
Exception      : System.ArgumentException
InvocationInfo : {Remove-AzContainerGroup}
Line           : Remove-AzContainerGroup -ResourceId
                 "/subscriptions/<redacted>/resourceGroups/<redacted>/providers/Microsoft.ContainerInstance/containerGroups/<redacted>"  Position       : At line:1 char:1
                 + Remove-AzContainerGroup -ResourceId "/subscriptions/<redacted> ...
                 + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
HistoryId      : 14

DEBUG: AzureQoSEvent: CommandName - Resolve-AzError; IsSuccess - True; Duration - 00:00:00.0588866; Exception - ;
DEBUG: Finish sending metric.
DEBUG: 3:40:21 PM - ResolveError end processing.
DEBUG: 3:40:21 PM - ResolveError end processing.
cormacpayne commented 5 years ago

@jluk @yangl900 would you mind taking a look at this issue?

jluk commented 5 years ago

@cormacpayne I've assigned @dkkapur given neither Anders nor myself work on ACI anymore

BethanyZhou commented 2 years ago

Hi @nickstenning ,

Sorry for late response. I noticed you was using Az.ContainerInstance 1.0.1.

From version 2.0.0, we don't support running Remove-AzContainerGroup -ResourceId <ResourceId>. If you want to do similar thing like that, please upgrade Az.ContainerInstance to its latest version and use:

PS C:\Users\bez> $c = New-Object -TypeName Microsoft.Azure.PowerShell.Cmdlets.ContainerInstance.Models.ContainerInstanceIdentity
PS C:\Users\bez> $c.Id = $containerGroup.Id
PS C:\Users\bez> Remove-AzContainerGroup -InputObject $c

Please let me know if you still have issue on latest Az.ContainerInstance

ghost commented 2 years ago

Hi, we're sending this friendly reminder because we haven't heard back from you in a while. We need more information about this issue to help address it. Please be sure to give us your input within the next 7 days. If we don't hear back from you within 14 days of this comment the issue will be automatically closed. Thank you!