Skip to content

Get-AzGalleryImageDefinition fails with Community Galleries #28399

@adsk-spm

Description

@adsk-spm

Description

When running Get-AzGalleryImageDefinition -Name rocky-9-x86_64 -GalleryPublicName rocky-dc1c6aa6-905b-4d9c-9577-63ccc28c482a -Location 'westus2' I would not expect the following message:

Get-AzGalleryImageDefinition:
Unmapped members were found. Review the types and members below.
Add a custom mapping expression, ignore, add a custom resolver, or modify the source/destination type
For no matching constructor, add a no-arg ctor, add optional arguments, or map all of the constructor parameters
==============================================================================================================================================
CommunityGalleryImage -> PSCommunityGalleryImage (Destination member list)
Microsoft.Azure.Management.Compute.Models.CommunityGalleryImage -> Microsoft.Azure.Commands.Compute.Automation.Models.PSCommunityGalleryImage (Destination member list)

Unmapped properties:
Identifier

When running with -Debug, the received body is

{
  "properties": {
    "disclaimer": "https://aka.ms/community-gallery-disclaimer",
    "osType": "Linux",
    "osState": "Generalized",
    "recommended": {
      "vCPUs": {
        "min": 1,
        "max": 16
      },
      "memory": {
        "min": 1,
        "max": 32
      }
    },
    "hyperVGeneration": "V2",
    "architecture": "x64",
    "features": [
      {
        "name": "SecurityType",
        "value": "ConfidentialVmSupported"
      }
    ],
    "identifier": {
      "publisher": "",
      "offer": "",
      "sku": ""
    }
  },
  "location": "westus2",
  "name": "Rocky-9-x86_64",
  "identifier": {
    "uniqueId": "/CommunityGalleries/rocky-dc1c6aa6-905b-4d9c-9577-63ccc28c482a/Images/Rocky-9-x86_64"
  }
}

Issue script & Debug output

PS > $DebugPreference='Continue'
PS > Get-AzGalleryImageDefinition -Name rocky-9-x86_64 -GalleryPublicName rocky-dc1c6aa6-905b-4d9c-9577-63ccc28c482a -Location 'westus2'
DEBUG: 2:41:41 PM - [ConfigManager] Got nothing from [DisplaySecretsWarning], Module = [], Cmdlet = []. Returning default value [True].
DEBUG: 2:41:41 PM - GetAzureRmGalleryImage begin processing with ParameterSet 'CommunityGalleryParameterSet'.
DEBUG: 2:41:41 PM - using account id '****'...
DEBUG: 2:41:41 PM - [ConfigManager] Got nothing from [DisplayBreakingChangeWarning], Module = [Az.Compute], Cmdlet = [Get-AzGalleryImageDefinition]. Returning default value [True].
DEBUG: [Common.Authentication]: Authenticating using Account: '****', environment: 'AzureCloud', tenant: '****'
DEBUG: 2:41:41 PM - [ConfigManager] Got nothing from [DisableInstanceDiscovery], Module = [], Cmdlet = []. Returning default value [False].
DEBUG: 2:41:41 PM - [ConfigManager] Got nothing from [EnableLoginByWam], Module = [], Cmdlet = []. Returning default value [True].
DEBUG: 2:41:41 PM - [SilentAuthenticator] Calling SharedTokenCacheCredential.GetTokenAsync - TenantId:'****', Scopes:'https://management.core.windows.net//.default', AuthorityHost:'https://login.microsoftonline.com/', UserId:'****'
DEBUG: SharedTokenCacheCredential.GetToken invoked. Scopes: [ https://management.core.windows.net//.default ] ParentRequestId:
DEBUG: False MSAL 4.65.0.0 MSAL.CoreCLR .NET 9.0.6 MacOS [2025-08-15 18:41:41Z] [Internal cache] Clearing user token cache accessor.
DEBUG: False MSAL 4.65.0.0 MSAL.CoreCLR .NET 9.0.6 MacOS [2025-08-15 18:41:41Z] [Internal cache] Total number of cache partitions found while getting refresh tokens: 1
DEBUG: False MSAL 4.65.0.0 MSAL.CoreCLR .NET 9.0.6 MacOS [2025-08-15 18:41:41Z - ****] IsLegacyAdalCacheEnabled: yes
DEBUG: False MSAL 4.65.0.0 MSAL.CoreCLR .NET 9.0.6 MacOS [2025-08-15 18:41:41Z - ****] [Region discovery] Not using a regional authority.
DEBUG: False MSAL 4.65.0.0 MSAL.CoreCLR .NET 9.0.6 MacOS [2025-08-15 18:41:41Z - ****] [Region discovery] Not using a regional authority.
DEBUG: False MSAL 4.65.0.0 MSAL.CoreCLR .NET 9.0.6 MacOS [2025-08-15 18:41:41Z - ****] IsLegacyAdalCacheEnabled: yes
DEBUG: False MSAL 4.65.0.0 MSAL.CoreCLR .NET 9.0.6 MacOS [2025-08-15 18:41:41Z - ****] IsLegacyAdalCacheEnabled: yes
DEBUG: False MSAL 4.65.0.0 MSAL.CoreCLR .NET 9.0.6 MacOS [2025-08-15 18:41:41Z] Found 1 cache accounts and 0 broker accounts
DEBUG: False MSAL 4.65.0.0 MSAL.CoreCLR .NET 9.0.6 MacOS [2025-08-15 18:41:41Z] Returning 1 accounts
DEBUG: False MSAL 4.65.0.0 MSAL.CoreCLR .NET 9.0.6 MacOS [2025-08-15 18:41:41Z - ****] MSAL MSAL.CoreCLR with assembly version '4.65.0.0'. CorrelationId(****)
DEBUG: False MSAL 4.65.0.0 MSAL.CoreCLR .NET 9.0.6 MacOS [2025-08-15 18:41:41Z - ****] === AcquireTokenSilent Parameters ===
DEBUG: False MSAL 4.65.0.0 MSAL.CoreCLR .NET 9.0.6 MacOS [2025-08-15 18:41:41Z - ****] LoginHint provided: False
DEBUG: False MSAL 4.65.0.0 MSAL.CoreCLR .NET 9.0.6 MacOS [2025-08-15 18:41:41Z - ****] Account provided: True
DEBUG: False MSAL 4.65.0.0 MSAL.CoreCLR .NET 9.0.6 MacOS [2025-08-15 18:41:41Z - ****] ForceRefresh: False
DEBUG: False MSAL 4.65.0.0 MSAL.CoreCLR .NET 9.0.6 MacOS [2025-08-15 18:41:41Z - ****]
=== Request Data ===
Authority Provided? - True
Scopes - https://management.core.windows.net//.default
Extra Query Params Keys (space separated) -
ApiId - AcquireTokenSilent
IsConfidentialClient - False
SendX5C - False
LoginHint ? False
IsBrokerConfigured - False
HomeAccountId - False
CorrelationId - ****
UserAssertion set: False
LongRunningOboCacheKey set: False
Region configured:

DEBUG: False MSAL 4.65.0.0 MSAL.CoreCLR .NET 9.0.6 MacOS [2025-08-15 18:41:41Z - ****] === Token Acquisition (SilentRequest) started:
	 Scopes: https://management.core.windows.net//.default
	Authority Host: login.microsoftonline.com
DEBUG: False MSAL 4.65.0.0 MSAL.CoreCLR .NET 9.0.6 MacOS [2025-08-15 18:41:41Z] [Internal cache] Clearing user token cache accessor.
DEBUG: False MSAL 4.65.0.0 MSAL.CoreCLR .NET 9.0.6 MacOS [2025-08-15 18:41:41Z - ****] [Internal cache] Total number of cache partitions found while getting access tokens: 1
DEBUG: False MSAL 4.65.0.0 MSAL.CoreCLR .NET 9.0.6 MacOS [2025-08-15 18:41:41Z - ****] [FindAccessTokenAsync] Discovered 1 access tokens in cache using partition key: ****.****
DEBUG: False MSAL 4.65.0.0 MSAL.CoreCLR .NET 9.0.6 MacOS [2025-08-15 18:41:41Z - ****] [Region discovery] Not using a regional authority.
DEBUG: False MSAL 4.65.0.0 MSAL.CoreCLR .NET 9.0.6 MacOS [2025-08-15 18:41:41Z - ****] Access token is not expired. Returning the found cache entry. [Current time (08/15/2025 18:41:41) - Expiration Time (08/15/2025 19:57:41 +00:00) - Extended Expiration Time (08/15/2025 19:57:41 +00:00)]
DEBUG: False MSAL 4.65.0.0 MSAL.CoreCLR .NET 9.0.6 MacOS [2025-08-15 18:41:41Z - ****] Returning access token found in cache. RefreshOn exists ? False
DEBUG: False MSAL 4.65.0.0 MSAL.CoreCLR .NET 9.0.6 MacOS [2025-08-15 18:41:41Z - ****] [Region discovery] Not using a regional authority.
DEBUG: False MSAL 4.65.0.0 MSAL.CoreCLR .NET 9.0.6 MacOS [2025-08-15 18:41:41Z - ****]
	=== Token Acquisition finished successfully:
DEBUG: False MSAL 4.65.0.0 MSAL.CoreCLR .NET 9.0.6 MacOS [2025-08-15 18:41:41Z - ****]  AT expiration time: 2025-08-15 7:57:41 PM +00:00, scopes: https://management.core.windows.net//.default https://management.core.windows.net//user_impersonation. source: Cache
DEBUG: False MSAL 4.65.0.0 MSAL.CoreCLR .NET 9.0.6 MacOS [2025-08-15 18:41:41Z - ****]
[LogMetricsFromAuthResult] Cache Refresh Reason: NotApplicable
[LogMetricsFromAuthResult] DurationInCacheInMs: 0
[LogMetricsFromAuthResult] DurationTotalInMs: 6
[LogMetricsFromAuthResult] DurationInHttpInMs: 0
DEBUG: False MSAL 4.65.0.0 MSAL.CoreCLR .NET 9.0.6 MacOS [2025-08-15 18:41:41Z - ****] TokenEndpoint: ****
DEBUG: SharedTokenCacheCredential.GetToken succeeded. Scopes: [ https://management.core.windows.net//.default ] ParentRequestId:  ExpiresOn: 2025-08-15T19:57:41.0000000+00:00
DEBUG: [Common.Authentication]: Received token with LoginType 'User', Tenant: '****', UserId: '****'
DEBUG: ============================ HTTP REQUEST ============================

HTTP Method:
GET

Absolute Uri:
https://management.azure.com/subscriptions****/providers/Microsoft.Compute/locations/westus2/communityGalleries/rocky-dc1c6aa6-905b-4d9c-9577-63ccc28c482a/images/rocky-9-x86_64?api-version=2024-03-03

Headers:
Accept-Language               : en-US
x-ms-client-request-id        : ****

Body:



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

Status Code:
OK

Headers:
Cache-Control                 : no-cache
Pragma                        : no-cache
x-ms-ratelimit-remaining-resource: Microsoft.Compute/GetGalleryArtifact3Min;598,Microsoft.Compute/GetGalleryArtifact30Min;2993
Strict-Transport-Security     : max-age=31536000; includeSubDomains
x-ms-served-by                : ****_133989581517162572
x-ms-request-id               : ****
x-ms-operation-identifier     : tenantId=****,objectId=****/canadacentral/****
x-ms-ratelimit-remaining-subscription-reads: 249
x-ms-ratelimit-remaining-subscription-global-reads: 3749
x-ms-correlation-request-id   : ****
x-ms-routing-request-id       : CANADACENTRAL:20250815T184142Z:****
X-Content-Type-Options        : nosniff
X-Cache                       : CONFIG_NOCACHE
X-MSEdge-Ref                  : Ref A: 664E13DD4C854E8F9B682FE0F3831BD6 Ref B: YQ1AA2090601031 Ref C: 2025-08-15T18:41:42Z
Date                          : Fri, 15 Aug 2025 18:41:42 GMT

Body:
{
  "properties": {
    "disclaimer": "https://aka.ms/community-gallery-disclaimer",
    "osType": "Linux",
    "osState": "Generalized",
    "recommended": {
      "vCPUs": {
        "min": 1,
        "max": 16
      },
      "memory": {
        "min": 1,
        "max": 32
      }
    },
    "hyperVGeneration": "V2",
    "architecture": "x64",
    "features": [
      {
        "name": "SecurityType",
        "value": "ConfidentialVmSupported"
      }
    ],
    "identifier": {
      "publisher": "",
      "offer": "",
      "sku": ""
    }
  },
  "location": "westus2",
  "name": "Rocky-9-x86_64",
  "identifier": {
    "uniqueId": "/CommunityGalleries/rocky-dc1c6aa6-905b-4d9c-9577-63ccc28c482a/Images/Rocky-9-x86_64"
  }
}


DEBUG: 2:41:42 PM - [ConfigManager] Got nothing from [EnableErrorRecordsPersistence], Module = [Az.Compute], Cmdlet = [Get-AzGalleryImageDefinition]. Returning default value [False].
Get-AzGalleryImageDefinition:
Unmapped members were found. Review the types and members below.
Add a custom mapping expression, ignore, add a custom resolver, or modify the source/destination type
For no matching constructor, add a no-arg ctor, add optional arguments, or map all of the constructor parameters
==============================================================================================================================================
CommunityGalleryImage -> PSCommunityGalleryImage (Destination member list)
Microsoft.Azure.Management.Compute.Models.CommunityGalleryImage -> Microsoft.Azure.Commands.Compute.Automation.Models.PSCommunityGalleryImage (Destination member list)

Unmapped properties:
Identifier
DEBUG: 2:41:42 PM - [ConfigManager] Got nothing from [DisplayBreakingChangeWarning], Module = [Az.Compute], Cmdlet = [Get-AzGalleryImageDefinition]. Returning default value [True].
DEBUG: 2:41:42 PM - [ConfigManager] Got nothing from [DisplayRegionIdentified], Module = [], Cmdlet = []. Returning default value [True].
DEBUG: 2:41:42 PM - [ConfigManager] Got nothing from [CheckForUpgrade], Module = [], Cmdlet = []. Returning default value [True].
DEBUG: 2:41:42 PM - No authentication telemetry is found for the current cmdlet with Id ****.
DEBUG: AzureQoSEvent:  Module: Az.Compute:10.2.0; CommandName: Get-AzGalleryImageDefinition; PSVersion: 7.5.2; IsSuccess: False; Duration: 00:00:00.7686702; SanitizeDuration: 00:00:00; Exception:
Unmapped members were found. Review the types and members below.
Add a custom mapping expression, ignore, add a custom resolver, or modify the source/destination type
For no matching constructor, add a no-arg ctor, add optional arguments, or map all of the constructor parameters
==============================================================================================================================================
CommunityGalleryImage -> PSCommunityGalleryImage (Destination member list)
Microsoft.Azure.Management.Compute.Models.CommunityGalleryImage -> Microsoft.Azure.Commands.Compute.Automation.Models.PSCommunityGalleryImage (Destination member list)

Unmapped properties:
Identifier
;
DEBUG: 2:41:42 PM - [ConfigManager] Got [True] from [EnableDataCollection], Module = [], Cmdlet = [].
DEBUG: 2:41:42 PM - GetAzureRmGalleryImage end processing.

Environment data

PS> > $PSVersionTable             

Name                           Value
----                           -----
PSVersion                      7.5.2
PSEdition                      Core
GitCommitId                    7.5.2
OS                             Darwin 24.6.0 Darwin Kernel Version 24.6.0: Mon Jul 14 11:30:30 PDT 2025; root:xnu-11417.140.69~1/RELEASE_ARM64_T6020
Platform                       Unix
PSCompatibleVersions           {1.0, 2.0, 3.0, 4.0…}
PSRemotingProtocolVersion      2.3
SerializationVersion           1.1.0.1
WSManStackVersion              3.0

Module versions

PS> Get-Module Az*
                                   
ModuleType Version    PreRelease Name                                ExportedCommands
---------- -------    ---------- ----                                ----------------
Script     5.2.0                 Az.Accounts                         {Add-AzEnvironment, Clear-AzConfig, Clear-AzContext, Clear-AzDefault…}
Script     10.2.0                Az.Compute                          {Add-AzGalleryInVMAccessControlProfileVersionRulesIdentity, Add-AzGalle

Error output

PS> Resolve-AzError

   HistoryId: 46

Message        : 
                 Unmapped members were found. Review the types and members below.
                 Add a custom mapping expression, ignore, add a custom resolver, or modify the source/destination type
                 For no matching constructor, add a no-arg ctor, add optional arguments, or map all of the constructor parameters
                 ============================================================================================================================
                 ==================
                 CommunityGalleryImage -> PSCommunityGalleryImage (Destination member list)
                 Microsoft.Azure.Management.Compute.Models.CommunityGalleryImage -> 
                 Microsoft.Azure.Commands.Compute.Automation.Models.PSCommunityGalleryImage (Destination member list)
                 
                 Unmapped properties:
                 Identifier
                 
StackTrace     :    at lambda_method583(Closure, CommunityGalleryImage, PSCommunityGalleryImage, ResolutionContext)
                    at Microsoft.Azure.Commands.Compute.Automation.GetAzureRmGalleryImage.CommunityGalleryGet()
                    at Microsoft.Azure.Commands.Compute.Automation.GetAzureRmGalleryImage.<ExecuteCmdlet>b__0_0()
                    at Microsoft.Azure.Commands.Compute.ComputeClientBaseCmdlet.ExecuteClientAction(Action action)
                    at Microsoft.Azure.Commands.Compute.Automation.GetAzureRmGalleryImage.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.AutoMapperConfigurationException
InvocationInfo : {Get-AzGalleryImageDefinition}
Line           : Get-AzGalleryImageDefinition -Name rocky-9-x86_64 -GalleryPublicName rocky-dc1c6aa6-905b-4d9c-9577-63ccc28c482a -Location 
                 'westus2'
Position       : At line:1 char:1
                 + Get-AzGalleryImageDefinition -Name rocky-9-x86_64 -GalleryPublicName  …
                 + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
HistoryId      : 46

Metadata

Metadata

Labels

ComputeService AttentionThis issue is responsible by Azure service team.bugThis issue requires a change to an existing behavior in the product in order to be resolved.customer-reported

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions