Azure / azure-powershell

Microsoft Azure PowerShell
Other
4.22k stars 3.83k forks source link

Get-AzNetworkProfile failure #11418

Closed PleaseStopAsking closed 2 months ago

PleaseStopAsking commented 4 years ago

Description

Any attempt at using the Get-AzNetworkProfile cmdlet fails.

Steps to reproduce

  1. Create a network profile using some means. Mine is created during an ARM deployment.
  2. Attempt to grab the network profile info via PS with...
Get-AzNetworkProfile

Environment data

Name                           Value
----                           -----
PSVersion                      7.0.0
PSEdition                      Core
GitCommitId                    7.0.0
OS                             Darwin 19.3.0 Darwin Kernel Version 19.3.0: Thu Jan  9 20:58:23 PST 2020; root:xnu-6153.81.5~1/RELEASE_X86_64
Platform                       Unix
PSCompatibleVersions           {1.0, 2.0, 3.0, 4.0…}
PSRemotingProtocolVersion      2.3
SerializationVersion           1.1.0.1
WSManStackVersion              3.0

Module versions

ModuleType Version    PreRelease Name                                PSEdition ExportedCommands
---------- -------    ---------- ----                                --------- ----------------
Binary     4.0.3.0               AWS.Tools.Common                    Core,Desk {Clear-AWSHistory, Set-AWSHistoryConfiguration, Initialize-AWSDefaultConfiguration, Clear-AWSDefaultConfiguration…}
Binary     4.0.3.0               AWS.Tools.EC2                       Core,Desk {Add-EC2CapacityReservation, Add-EC2ClassicLinkVpc, Add-EC2InternetGateway, Add-EC2NetworkInterface…}
Binary     4.0.3.0               AWS.Tools.IdentityManagement        Core,Desk {Add-IAMClientIDToOpenIDConnectProvider, Add-IAMRoleTag, Add-IAMRoleToInstanceProfile, Add-IAMUserTag…}
Script     1.0.1.0               AWS.Tools.Installer                 Core,Desk {Uninstall-AWSToolsModule, Install-AWSToolsModule, Update-AWSToolsModule}
Binary     4.0.3.0               AWS.Tools.SecurityToken             Core,Desk {Convert-STSAuthorizationMessage, Get-STSAccessKeyInfo, Get-STSCallerIdentity, Get-STSFederationToken…}
Script     3.6.1                 Az                                  Core,Desk 
Script     1.7.3                 Az.Accounts                         Core,Desk {Disable-AzDataCollection, Disable-AzContextAutosave, Enable-AzDataCollection, Enable-AzContextAutosave…}
Script     1.1.1                 Az.Advisor                          Core,Desk {Get-AzAdvisorRecommendation, Enable-AzAdvisorRecommendation, Disable-AzAdvisorRecommendation, Get-AzAdvisorConfigura…
Script     1.0.3                 Az.Aks                              Core,Desk {Get-AzAks, New-AzAks, Remove-AzAks, Import-AzAksCredential…}
Script     1.1.2                 Az.AnalysisServices                 Core,Desk {Resume-AzAnalysisServicesServer, Suspend-AzAnalysisServicesServer, Get-AzAnalysisServicesServer, Remove-AzAnalysisSe…
Script     1.4.0                 Az.ApiManagement                    Core,Desk {Add-AzApiManagementApiToProduct, Add-AzApiManagementProductToGroup, Add-AzApiManagementRegion, Add-AzApiManagementUs…
Script     1.0.3                 Az.ApplicationInsights              Core,Desk {Get-AzApplicationInsights, New-AzApplicationInsights, Remove-AzApplicationInsights, Set-AzApplicationInsightsPricing…
Script     1.3.6                 Az.Automation                       Core,Desk {Get-AzAutomationHybridWorkerGroup, Remove-AzAutomationHybridWorkerGroup, Get-AzAutomationJobOutputRecord, Import-AzA…
Script     2.0.2                 Az.Batch                            Core,Desk {Remove-AzBatchAccount, Get-AzBatchAccount, Get-AzBatchAccountKey, New-AzBatchAccount…}
Script     1.0.2                 Az.Billing                          Core,Desk {Get-AzBillingInvoice, Get-AzBillingPeriod, Get-AzEnrollmentAccount, Get-AzConsumptionBudget…}
Script     1.4.2                 Az.Cdn                              Core,Desk {Get-AzCdnProfile, Get-AzCdnProfileSsoUrl, New-AzCdnProfile, Remove-AzCdnProfile…}
Script     1.2.3                 Az.CognitiveServices                Core,Desk {Get-AzCognitiveServicesAccount, Get-AzCognitiveServicesAccountKey, Get-AzCognitiveServicesAccountSku, Get-AzCognitiv…
Script     3.5.0                 Az.Compute                          Core,Desk {Remove-AzAvailabilitySet, Get-AzAvailabilitySet, New-AzAvailabilitySet, Update-AzAvailabilitySet…}
Script     1.0.3                 Az.ContainerInstance                Core,Desk {New-AzContainerGroup, Get-AzContainerGroup, Remove-AzContainerGroup, Get-AzContainerInstanceLog}
Script     1.1.1                 Az.ContainerRegistry                Core,Desk {New-AzContainerRegistry, Get-AzContainerRegistry, Update-AzContainerRegistry, Remove-AzContainerRegistry…}
Script     1.1.0                 Az.DataBoxEdge                      Core,Desk {Get-AzDataBoxEdgeJob, Get-AzDataBoxEdgeDevice, Invoke-AzDataBoxEdgeDevice, New-AzDataBoxEdgeDevice…}
Script     1.6.1                 Az.DataFactory                      Core,Desk {Set-AzDataFactoryV2, Update-AzDataFactoryV2, Get-AzDataFactoryV2, Remove-AzDataFactoryV2…}
Script     1.0.2                 Az.DataLakeAnalytics                Core,Desk {Get-AzDataLakeAnalyticsDataSource, New-AzDataLakeAnalyticsCatalogCredential, Remove-AzDataLakeAnalyticsCatalogCreden…
Script     1.2.7                 Az.DataLakeStore                    Core,Desk {Get-AzDataLakeStoreTrustedIdProvider, Remove-AzDataLakeStoreTrustedIdProvider, Remove-AzDataLakeStoreFirewallRule, S…
Script     1.1.0                 Az.DeploymentManager                Core,Desk {Get-AzDeploymentManagerArtifactSource, New-AzDeploymentManagerArtifactSource, Set-AzDeploymentManagerArtifactSource,…
Script     1.0.2                 Az.DevTestLabs                      Core,Desk {Get-AzDtlAllowedVMSizesPolicy, Get-AzDtlAutoShutdownPolicy, Get-AzDtlAutoStartPolicy, Get-AzDtlVMsPerLabPolicy…}
Script     1.1.2                 Az.Dns                              Core,Desk {Get-AzDnsRecordSet, New-AzDnsRecordConfig, Remove-AzDnsRecordSet, Set-AzDnsRecordSet…}
Script     1.2.3                 Az.EventGrid                        Core,Desk {New-AzEventGridTopic, Get-AzEventGridTopic, Set-AzEventGridTopic, New-AzEventGridTopicKey…}
Script     1.4.3                 Az.EventHub                         Core,Desk {New-AzEventHubNamespace, Get-AzEventHubNamespace, Set-AzEventHubNamespace, Remove-AzEventHubNamespace…}
Script     1.4.0                 Az.FrontDoor                        Core,Desk {New-AzFrontDoor, Get-AzFrontDoor, Set-AzFrontDoor, Remove-AzFrontDoor…}
Script     3.0.3                 Az.HDInsight                        Core,Desk {Get-AzHDInsightJob, New-AzHDInsightSqoopJobDefinition, Wait-AzHDInsightJob, New-AzHDInsightStreamingMapReduceJobDefi…
Script     1.0.1                 Az.HealthcareApis                   Core,Desk {New-AzHealthcareApisService, Remove-AzHealthcareApisService, Set-AzHealthcareApisService, Get-AzHealthcareApisServic…
Script     2.2.0                 Az.IotHub                           Core,Desk {Add-AzIotHubKey, Get-AzIotHubEventHubConsumerGroup, Get-AzIotHubConnectionString, Get-AzIotHubJob…}
Script     1.5.1                 Az.KeyVault                         Core,Desk {Add-AzKeyVaultCertificate, Update-AzKeyVaultCertificate, Stop-AzKeyVaultCertificateOperation, Get-AzKeyVaultCertific…
Script     1.3.2                 Az.LogicApp                         Core,Desk {Get-AzIntegrationAccountAgreement, Get-AzIntegrationAccountAssembly, Get-AzIntegrationAccountBatchConfiguration, Get…
Script     1.1.3                 Az.MachineLearning                  Core,Desk {Move-AzMlCommitmentAssociation, Get-AzMlCommitmentAssociation, Get-AzMlCommitmentPlanUsageHistory, Remove-AzMlCommit…
Script     1.0.2                 Az.ManagedServices                  Core,Desk {Get-AzManagedServicesAssignment, New-AzManagedServicesAssignment, Remove-AzManagedServicesAssignment, Get-AzManagedS…
Script     1.0.2                 Az.MarketplaceOrdering              Core,Desk {Get-AzMarketplaceTerms, Set-AzMarketplaceTerms}
Script     1.1.1                 Az.Media                            Core,Desk {Sync-AzMediaServiceStorageKey, Set-AzMediaServiceKey, Get-AzMediaServiceKey, Get-AzMediaServiceNameAvailability…}
Script     1.6.1                 Az.Monitor                          Core,Desk {Get-AzMetricDefinition, Get-AzMetric, Remove-AzLogProfile, Get-AzLogProfile…}
Script     2.3.2                 Az.Network                          Core,Desk {Add-AzApplicationGatewayAuthenticationCertificate, Get-AzApplicationGatewayAuthenticationCertificate, New-AzApplicat…
Script     1.1.1                 Az.NotificationHubs                 Core,Desk {Get-AzNotificationHub, Get-AzNotificationHubAuthorizationRule, Get-AzNotificationHubListKey, Get-AzNotificationHubPN…
Script     1.3.4                 Az.OperationalInsights              Core,Desk {New-AzOperationalInsightsAzureActivityLogDataSource, New-AzOperationalInsightsCustomLogDataSource, Disable-AzOperati…
Script     1.2.0                 Az.PolicyInsights                   Core,Desk {Get-AzPolicyEvent, Get-AzPolicyState, Get-AzPolicyStateSummary, Get-AzPolicyRemediation…}
Script     1.1.1                 Az.PowerBIEmbedded                  Core,Desk {Remove-AzPowerBIWorkspaceCollection, Get-AzPowerBIWorkspaceCollection, Get-AzPowerBIWorkspaceCollectionAccessKey, Ge…
Script     1.0.2                 Az.PrivateDns                       Core,Desk {Get-AzPrivateDnsZone, Remove-AzPrivateDnsZone, Set-AzPrivateDnsZone, New-AzPrivateDnsZone…}
Script     2.7.0                 Az.RecoveryServices                 Core,Desk {Get-AzRecoveryServicesBackupProperty, Get-AzRecoveryServicesVault, Get-AzRecoveryServicesVaultSettingsFile, New-AzRe…
Script     1.2.1                 Az.RedisCache                       Core,Desk {Remove-AzRedisCachePatchSchedule, New-AzRedisCacheScheduleEntry, Get-AzRedisCachePatchSchedule, New-AzRedisCachePatc…
Script     1.0.3                 Az.Relay                            Core,Desk {New-AzRelayNamespace, Get-AzRelayNamespace, Set-AzRelayNamespace, Remove-AzRelayNamespace…}
Script     1.12.0                Az.Resources                        Core,Desk {Get-AzProviderOperation, Remove-AzRoleAssignment, Get-AzRoleAssignment, New-AzRoleAssignment…}
Script     1.4.1                 Az.ServiceBus                       Core,Desk {New-AzServiceBusNamespace, Get-AzServiceBusNamespace, Set-AzServiceBusNamespace, Remove-AzServiceBusNamespace…}
Script     2.0.1                 Az.ServiceFabric                    Core,Desk {Add-AzServiceFabricClientCertificate, Add-AzServiceFabricClusterCertificate, Add-AzServiceFabricNode, Add-AzServiceF…
Script     1.1.1                 Az.SignalR                          Core,Desk {New-AzSignalR, Get-AzSignalR, Get-AzSignalRKey, New-AzSignalRKey…}
Script     2.4.0                 Az.Sql                              Core,Desk {Get-AzSqlDatabaseTransparentDataEncryption, Get-AzSqlDatabaseTransparentDataEncryptionActivity, Set-AzSqlDatabaseTra…
Script     1.1.0                 Az.SqlVirtualMachine                Core,Desk {New-AzSqlVM, Get-AzSqlVM, Update-AzSqlVM, Remove-AzSqlVM…}
Script     1.13.0                Az.Storage                          Core,Desk {Get-AzStorageAccount, Get-AzStorageAccountKey, New-AzStorageAccount, New-AzStorageAccountKey…}
Script     1.2.3                 Az.StorageSync                      Core,Desk {Invoke-AzStorageSyncCompatibilityCheck, New-AzStorageSyncService, Get-AzStorageSyncService, Remove-AzStorageSyncServ…
Script     1.0.1                 Az.StreamAnalytics                  Core,Desk {Get-AzStreamAnalyticsFunction, Get-AzStreamAnalyticsDefaultFunctionDefinition, New-AzStreamAnalyticsFunction, Remove…
Script     1.0.3                 Az.TrafficManager                   Core,Desk {Add-AzTrafficManagerCustomHeaderToEndpoint, Remove-AzTrafficManagerCustomHeaderFromEndpoint, Add-AzTrafficManagerCus…
Script     1.7.0                 Az.Websites                         Core,Desk {Get-AzAppServicePlan, Set-AzAppServicePlan, New-AzAppServicePlan, Remove-AzAppServicePlan…}
Binary     2.0.2.76              AzureAD                             Desk      
Manifest   8.0.0                 ComputerManagementDsc               Desk      
Script     7.0.1                 ImportExcel                         Desk      {Add-ConditionalFormatting, Add-ExcelChart, Add-ExcelDataValidationRule, Add-ExcelName…}
Script     1.4.6                 PackageManagement                   Desk      {Find-Package, Get-Package, Get-PackageProvider, Get-PackageSource…}
Script     2.2.3                 PowerShellGet                       Desk      {Find-Command, Find-DSCResource, Find-Module, Find-RoleCapability…}
Script     1.0.0.0               PSColor                             Desk      {ServiceController, Write-Color-Process, CutString, FileInfo…}
Script     9.1.0                 xPSDesiredStateConfiguration        Desk      {Publish-DscModuleAndMof, Publish-ModulesAndChecksum, Publish-MofsInSource, Publish-ModuleToPullServer…}

Debug output

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

HTTP Method:
GET

Absolute Uri:
https://management.azure.com/subscriptions/<redacted>/providers/Microsoft.Network/networkProfiles?api-version=2019-11-01

Headers:
x-ms-client-request-id        : 45d9879a-217e-4a07-97a5-f55ec5c7cb9f
Accept-Language               : en-US

Body:

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

Status Code:
OK

Headers:
Cache-Control                 : no-cache
Pragma                        : no-cache
x-ms-request-id               : 5ec4660f-e8ba-4e5a-9092-e5658cdb1c07
x-ms-correlation-request-id   : cc2065b7-b731-4f3b-8652-9e4c3ffcca13
x-ms-arm-service-request-id   : 3b38f6c9-fc9a-4078-88db-6c9d3a734e84
Strict-Transport-Security     : max-age=31536000; includeSubDomains
Server                        : Microsoft-HTTPAPI/2.0,Microsoft-HTTPAPI/2.0
x-ms-ratelimit-remaining-subscription-reads: 11997
x-ms-routing-request-id       : WESTUS:20200325T141007Z:cc2065b7-b731-4f3b-8652-9e4c3ffcca13
X-Content-Type-Options        : nosniff
Date                          : Wed, 25 Mar 2020 14:10:07 GMT

Body:
{
  "value": [
    {
      "name": "mcsazscanprofile",
      "id": "/subscriptions/<redacted>/resourceGroups/mcsaz/providers/Microsoft.Network/networkProfiles/mcsazscanprofile",
      "type": "Microsoft.Network/networkProfiles",
      "location": "westus2",
      "properties": {
        "provisioningState": "Succeeded",
        "resourceGuid": "ea1ac9b3-9551-4308-bc5f-8a37db1c9778",
        "containerNetworkInterfaceConfigurations": [
          {
            "name": "eth0",
            "id": "/subscriptions/<redacted>/resourceGroups/mcsaz/providers/Microsoft.Network/networkProfiles/mcsazscanprofile/containerNetworkInterfaceConfigurations/eth0",
            "properties": {
              "provisioningState": "Succeeded",
              "ipConfigurations": [
                {
                  "name": "private",
                  "id": "/subscriptions/<redacted>/resourceGroups/mcsaz/providers/Microsoft.Network/networkProfiles/mcsazscanprofile/containerNetworkInterfaceConfigurations/eth0/ipConfigurations/private",
                  "type": "Microsoft.Network/networkProfiles/containerNetworkInterfaceConfigurations/ipConfigurations",
                  "properties": {
                    "provisioningState": "Succeeded",
                    "subnet": {
                      "id": "/subscriptions/<redacted>/resourceGroups/mcsaz/providers/Microsoft.Network/virtualNetworks/mcsazscanvnet/subnets/aci"
                    }
                  }
                }
              ],
              "containerNetworkInterfaces": [
                {
                  "id": "/subscriptions/<redacted>/resourceGroups/mcsaz/providers/Microsoft.Network/networkProfiles/mcsazscanprofile/containerNetworkInterfaces/5e28353d-af90-49ad-bf81-b04f7af87263_eth0"
                }
              ]
            },
            "type": "Microsoft.Network/networkProfiles/containerNetworkInterfaceConfigurations"
          }
        ],
        "containerNetworkInterfaces": [
          {
            "name": "5e28353d-af90-49ad-bf81-b04f7af87263_eth0",
            "id": "/subscriptions/<redacted>/resourceGroups/mcsaz/providers/Microsoft.Network/networkProfiles/mcsazscanprofile/containerNetworkInterfaces/5e28353d-af90-49ad-bf81-b04f7af87263_eth0",
            "properties": {
              "provisioningState": "Succeeded",
              "containerNetworkInterfaceConfiguration": {
                "id": "/subscriptions/<redacted>/resourceGroups/mcsaz/providers/Microsoft.Network/networkProfiles/mcsazscanprofile/containerNetworkInterfaceConfigurations/eth0"
              },
              "container": {
                "id": "/subscriptions/<redacted>/resourceGroups/mcsaz/providers/Microsoft.ContainerInstance/containerGroups/mcsazscanaci5og2chjwbodqs"
              },
              "ipConfigurations": []
            },
            "type": "Microsoft.Network/networkProfiles/containerNetworkInterfaces"
          }
        ]
      }
    }
  ]
}

Get-AzNetworkProfile: Error mapping types.
Mapping types:
NetworkProfile -> PSNetworkProfile
Microsoft.Azure.Management.Network.Models.NetworkProfile -> Microsoft.Azure.Commands.Network.Models.PSNetworkProfile
Type Map configuration:
NetworkProfile -> PSNetworkProfile
Microsoft.Azure.Management.Network.Models.NetworkProfile -> Microsoft.Azure.Commands.Network.Models.PSNetworkProfile
Property:
ContainerNetworkInterfaceConfigurations
DEBUG: AzureQoSEvent: CommandName - Get-AzNetworkProfile; IsSuccess - False; Duration - 00:00:00.7532214;; Exception - AutoMapper.AutoMapperMappingException: Error mapping types.

Mapping types:
NetworkProfile -> PSNetworkProfile
Microsoft.Azure.Management.Network.Models.NetworkProfile -> Microsoft.Azure.Commands.Network.Models.PSNetworkProfile

Type Map configuration:
NetworkProfile -> PSNetworkProfile
Microsoft.Azure.Management.Network.Models.NetworkProfile -> Microsoft.Azure.Commands.Network.Models.PSNetworkProfile

Property:
ContainerNetworkInterfaceConfigurations
 ---> AutoMapper.AutoMapperMappingException: Error mapping types.

Mapping types:
ContainerNetworkInterfaceConfiguration -> PSContainerNetworkInterfaceConfiguration
Microsoft.Azure.Management.Network.Models.ContainerNetworkInterfaceConfiguration -> Microsoft.Azure.Commands.Network.Models.PSContainerNetworkInterfaceConfiguration

Type Map configuration:
ContainerNetworkInterfaceConfiguration -> PSContainerNetworkInterfaceConfiguration
Microsoft.Azure.Management.Network.Models.ContainerNetworkInterfaceConfiguration -> Microsoft.Azure.Commands.Network.Models.PSContainerNetworkInterfaceConfiguration

Property:
ContainerNetworkInterfaces
 ---> System.InvalidCastException: Unable to cast object of type 'Microsoft.Azure.Commands.Network.Models.PSResourceId' to type 'Microsoft.Azure.Commands.Network.Models.PSContainerNetworkInterface'.
   at lambda_method(Closure , NetworkProfile , PSNetworkProfile , ResolutionContext )
   --- End of inner exception stack trace ---
   at lambda_method(Closure , NetworkProfile , PSNetworkProfile , ResolutionContext )
   --- End of inner exception stack trace ---
   at lambda_method(Closure , NetworkProfile , PSNetworkProfile , ResolutionContext )
   at lambda_method(Closure , Object , Object , ResolutionContext )
   at Microsoft.Azure.Commands.Network.GetAzureNetworkProfile.Execute()
   at Microsoft.Azure.Commands.Network.NetworkBaseCmdlet.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: 10:10:08 AM - GetAzureNetworkProfile end processing.

Error output

HistoryId: 7

Message        : Error mapping types.

                 Mapping types:
                 NetworkProfile -> PSNetworkProfile
                 Microsoft.Azure.Management.Network.Models.NetworkProfile -> Microsoft.Azure.Commands.Network.Models.PSNetworkProfile

                 Type Map configuration:
                 NetworkProfile -> PSNetworkProfile
                 Microsoft.Azure.Management.Network.Models.NetworkProfile -> Microsoft.Azure.Commands.Network.Models.PSNetworkProfile

                 Property:
                 ContainerNetworkInterfaceConfigurations
StackTrace     :    at lambda_method(Closure , NetworkProfile , PSNetworkProfile , ResolutionContext )
                    at lambda_method(Closure , Object , Object , ResolutionContext )
                    at Microsoft.Azure.Commands.Network.GetAzureNetworkProfile.Execute()
                    at Microsoft.Azure.Commands.Network.NetworkBaseCmdlet.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      : AutoMapper.AutoMapperMappingException
InvocationInfo : {Get-AzNetworkProfile}
Line           : Get-AzNetworkProfile
Position       : At line:1 char:1
                 + Get-AzNetworkProfile
                 + ~~~~~~~~~~~~~~~~~~~~
HistoryId      : 7

Message        : Error mapping types.

                 Mapping types:
                 ContainerNetworkInterfaceConfiguration -> PSContainerNetworkInterfaceConfiguration
                 Microsoft.Azure.Management.Network.Models.ContainerNetworkInterfaceConfiguration -> Microsoft.Azure.Commands.Network.Models.PSContainerNetworkInterfaceConfiguration

                 Type Map configuration:
                 ContainerNetworkInterfaceConfiguration -> PSContainerNetworkInterfaceConfiguration
                 Microsoft.Azure.Management.Network.Models.ContainerNetworkInterfaceConfiguration -> Microsoft.Azure.Commands.Network.Models.PSContainerNetworkInterfaceConfiguration

                 Property:
                 ContainerNetworkInterfaces
StackTrace     :    at lambda_method(Closure , NetworkProfile , PSNetworkProfile , ResolutionContext )
Exception      : AutoMapper.AutoMapperMappingException
InvocationInfo : {Get-AzNetworkProfile}
Line           : Get-AzNetworkProfile
Position       : At line:1 char:1
                 + Get-AzNetworkProfile
                 + ~~~~~~~~~~~~~~~~~~~~
HistoryId      : 7

Message        : Unable to cast object of type 'Microsoft.Azure.Commands.Network.Models.PSResourceId' to type 'Microsoft.Azure.Commands.Network.Models.PSContainerNetworkInterface'.
StackTrace     :    at lambda_method(Closure , NetworkProfile , PSNetworkProfile , ResolutionContext )
Exception      : System.InvalidCastException
InvocationInfo : {Get-AzNetworkProfile}
Line           : Get-AzNetworkProfile
Position       : At line:1 char:1
                 + Get-AzNetworkProfile
                 + ~~~~~~~~~~~~~~~~~~~~
HistoryId      : 7
ghost commented 4 years ago

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

dingmeng-xue commented 4 years ago

Involve Network team to look into this issue.

ghost commented 4 years ago

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

allegradomel commented 4 years ago

Hi @PleaseStopAsking, looking into this!

bjoernhoeferacp commented 4 years ago

Same issue here - any news about a solution @PleaseStopAsking

bjoernhoeferacp commented 4 years ago

Get-AzNetworkProfile : Error mapping types. Mapping types: NetworkProfile -> PSNetworkProfile Microsoft.Azure.Management.Network.Models.NetworkProfile -> Microsoft.Azure.Commands.Network.Models.PSNetworkProfile Type Map configuration: NetworkProfile -> PSNetworkProfile Microsoft.Azure.Management.Network.Models.NetworkProfile -> Microsoft.Azure.Commands.Network.Models.PSNetworkProfile Property: ContainerNetworkInterfaceConfigurations At line:1 char:14

PleaseStopAsking commented 4 years ago

@bjoernhoeferacp I have heard nothing since opening the issue. My workaround was to complete the same steps via Azure CLI instead.

bjoernhoeferacp commented 4 years ago

@PleaseStopAsking - Worked around it with Get-AzResource -ResourceId - as Azure CLI is not an option in Azure Automation @allegradomel any progress on this issue?

ghost commented 4 years ago

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

allegradomel commented 4 years ago

adding @aanandr to take a look

bhushangholave commented 3 years ago

Any update on this ? we are facing same issue and blocking out infra provisioning

bjoernhoeferacp commented 3 years ago

Nope - no feedbackk till now... have you seen the workaround I've posted? maybe it could help you...

bhushangholave commented 3 years ago

We are getting similar issue while using New-AzNetworkProfile command as well and then Get-AzNetworkProfile. So somehow I feel this is related to PsSessions running. will update once I get the issue resolved and tested

bjoernhoeferacp commented 3 years ago

Hi, if you're able to solve it - please share it here. Would also be interesting for me, even if we were able to pass this issue with a workaround.

SaurabhSharma-MSFT commented 2 years ago

@aanandr Do you have any updates to share.

PleaseStopAsking commented 2 months ago

closing as its been 4 years without a fix