Azure / azure-powershell

Microsoft Azure PowerShell
Other
4.26k stars 3.87k forks source link

Version 12.5.0 New-AzApiManagementApiRevision Error converting value to type 'Microsoft.Azure.ApiManagement.Management.Contracts.ApiTypeContract #26672

Closed GarethLeePS closed 4 days ago

GarethLeePS commented 1 week ago

Description

New-AzApiManagementApiRevision

Bad Request One or more fields contain incorrect values Parsing error(s): An error occured while parsing the input. Message: Error converting value \"api-name\" to
type 'Microsoft.Azure.ApiManagement.Management.Contracts.ApiTypeContract

It was working Friday November 8th on an azure pipeline but I don't know what version of Az module we run there. I was able to reproduce locally, then I rolled back my installed version of AZ module to version 12.4.0 and it worked, when I re-installed version 12.5.0 the error returned

Issue script & Debug output

DEBUG: Initializing ConditionalAssemblyContext. PSEdition is [Core]. PSVersion is [7.4.6].
DEBUG: Initializing ConditionalAssemblyProvider. AssemblyRootPath is [C:\Users\REDACTED\PowerShell\Modules\Az.Accounts\3.0.5\StartupScripts\..\lib].
DEBUG: Registering Az shared AssemblyLoadContext.
DEBUG: AssemblyLoadContext registered.
DEBUG: Initializing PSStyle.
DEBUG: Got version 0 of Az
DEBUG: Got version 0 of Az.Accounts
DEBUG: 17:15:41 - [ConfigManager] Got nothing from [DisplaySecretsWarning], Module = [], Cmdlet = []. Returning default value [True].
DEBUG: 17:15:41 - NewAzureApiManagementContext begin processing with ParameterSet 'ContextParameterSet'.
DEBUG: 17:15:41 - using account id 'REDACTED'...
DEBUG: 17:15:41 - [ConfigManager] Got nothing from [DisplayBreakingChangeWarning], Module = [], Cmdlet = []. Returning default value [True].
DEBUG: 17:15:41 - [ConfigManager] Got nothing from [DisplaySecretsWarning], Module = [], Cmdlet = []. Returning default value [True].
DEBUG: 17:15:41 - [ConfigManager] Got nothing from [DisplayRegionIdentified], Module = [], Cmdlet = []. Returning default value [True].
DEBUG: 17:15:41 - [ConfigManager] Got nothing from [CheckForUpgrade], Module = [], Cmdlet = []. Returning default value [True].
DEBUG: AzureQoSEvent:  Module: Az.ApiManagement:4.0.5; CommandName: New-AzApiManagementContext; PSVersion: 7.4.6; IsSuccess: True; Duration: 00:00:00.1821390; SanitizeDuration: 00:00:00.0008227
DEBUG: 17:15:41 - [ConfigManager] Got nothing from [EnableDataCollection], Module = [], Cmdlet = []. Returning default value [True].
DEBUG: 17:15:41 - NewAzureApiManagementContext end processing.
DEBUG: 17:15:41 - [ConfigManager] Got nothing from [DisplaySecretsWarning], Module = [], Cmdlet = []. Returning default value [True].
DEBUG: 17:15:41 - NewAzureApiManagementApiRevision begin processing with ParameterSet '__AllParameterSets'.
DEBUG: 17:15:41 - using account id 'REDACTED'...
DEBUG: 17:15:41 - [ConfigManager] Got nothing from [DisplayBreakingChangeWarning], Module = [], Cmdlet = []. Returning default value [True].
DEBUG: [Common.Authentication]: Authenticating using Account: 'REDACTED', environment: 'AzureCloud', tenant: 'REDACTED'
DEBUG: 17:15:41 - [ConfigManager] Got nothing from [DisableInstanceDiscovery], Module = [], Cmdlet = []. Returning default value [False].
DEBUG: 17:15:41 - [ConfigManager] Got nothing from [EnableLoginByWam], Module = [], Cmdlet = []. Returning default value [True].
DEBUG: 17:15:41 - [SilentAuthenticator] Calling SharedTokenCacheCredential.GetTokenAsync - TenantId:'REDACTED', Scopes:'https://management.core.windows.net//.default', AuthorityHost:'https://login.microsoftonline.com/', UserId:'REDACTED'
DEBUG: SharedTokenCacheCredential.GetToken invoked. Scopes: [ https://management.core.windows.net//.default ] ParentRequestId: 
DEBUG: False MSAL 4.65.0.0 MSAL.CoreCLR .NET 8.0.10 Microsoft Windows 10.0.22631 [2024-11-12 17:15:41Z - 5cba21a6-41a2-49ea-a318-346301e86499] IsLegacyAdalCacheEnabled: yes
DEBUG: False MSAL 4.65.0.0 MSAL.CoreCLR .NET 8.0.10 Microsoft Windows 10.0.22631 [2024-11-12 17:15:41Z - 5cba21a6-41a2-49ea-a318-346301e86499] [Region discovery] Not using a regional authority. 
DEBUG: False MSAL 4.65.0.0 MSAL.CoreCLR .NET 8.0.10 Microsoft Windows 10.0.22631 [2024-11-12 17:15:41Z - 5cba21a6-41a2-49ea-a318-346301e86499] IsLegacyAdalCacheEnabled: yes
DEBUG: False MSAL 4.65.0.0 MSAL.CoreCLR .NET 8.0.10 Microsoft Windows 10.0.22631 [2024-11-12 17:15:41Z - 5cba21a6-41a2-49ea-a318-346301e86499] [Region discovery] Not using a regional authority. 
DEBUG: False MSAL 4.65.0.0 MSAL.CoreCLR .NET 8.0.10 Microsoft Windows 10.0.22631 [2024-11-12 17:15:41Z - 5cba21a6-41a2-49ea-a318-346301e86499] IsLegacyAdalCacheEnabled: yes
DEBUG: False MSAL 4.65.0.0 MSAL.CoreCLR .NET 8.0.10 Microsoft Windows 10.0.22631 [2024-11-12 17:15:41Z] [Runtime] WAM supported OS.
DEBUG: False MSAL 4.65.0.0 MSAL.CoreCLR .NET 8.0.10 Microsoft Windows 10.0.22631 [2024-11-12 17:15:41Z] [RuntimeBroker] ListWindowsWorkAndSchoolAccounts option was not enabled.
DEBUG: False MSAL 4.65.0.0 MSAL.CoreCLR .NET 8.0.10 Microsoft Windows 10.0.22631 [2024-11-12 17:15:41Z - 66f1fd87-9ea6-4b9a-896a-10dffebb551a] [Region discovery] Not using a regional authority. 
DEBUG: False MSAL 4.65.0.0 MSAL.CoreCLR .NET 8.0.10 Microsoft Windows 10.0.22631 [2024-11-12 17:15:41Z] Found 1 cache accounts and 0 broker accounts 
DEBUG: False MSAL 4.65.0.0 MSAL.CoreCLR .NET 8.0.10 Microsoft Windows 10.0.22631 [2024-11-12 17:15:41Z] Returning 1 accounts
DEBUG: False MSAL 4.65.0.0 MSAL.CoreCLR .NET 8.0.10 Microsoft Windows 10.0.22631 [2024-11-12 17:15:41Z - f39b8be5-6816-44ab-8321-4d60cf4c3eb1] MSAL MSAL.CoreCLR with assembly version '4.65.0.0'. CorrelationId(f39b8be5-6816-44ab-8321-4d60cf4c3eb1)
DEBUG: False MSAL 4.65.0.0 MSAL.CoreCLR .NET 8.0.10 Microsoft Windows 10.0.22631 [2024-11-12 17:15:41Z - f39b8be5-6816-44ab-8321-4d60cf4c3eb1] === AcquireTokenSilent Parameters ===
DEBUG: False MSAL 4.65.0.0 MSAL.CoreCLR .NET 8.0.10 Microsoft Windows 10.0.22631 [2024-11-12 17:15:41Z - f39b8be5-6816-44ab-8321-4d60cf4c3eb1] LoginHint provided: False
DEBUG: False MSAL 4.65.0.0 MSAL.CoreCLR .NET 8.0.10 Microsoft Windows 10.0.22631 [2024-11-12 17:15:41Z - f39b8be5-6816-44ab-8321-4d60cf4c3eb1] Account provided: True
DEBUG: False MSAL 4.65.0.0 MSAL.CoreCLR .NET 8.0.10 Microsoft Windows 10.0.22631 [2024-11-12 17:15:41Z - f39b8be5-6816-44ab-8321-4d60cf4c3eb1] ForceRefresh: False
DEBUG: False MSAL 4.65.0.0 MSAL.CoreCLR .NET 8.0.10 Microsoft Windows 10.0.22631 [2024-11-12 17:15:41Z - f39b8be5-6816-44ab-8321-4d60cf4c3eb1]       
=== 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 - True
HomeAccountId - False
CorrelationId - f39b8be5-6816-44ab-8321-4d60cf4c3eb1
UserAssertion set: False
LongRunningOboCacheKey set: False
Region configured: 

DEBUG: False MSAL 4.65.0.0 MSAL.CoreCLR .NET 8.0.10 Microsoft Windows 10.0.22631 [2024-11-12 17:15:41Z - f39b8be5-6816-44ab-8321-4d60cf4c3eb1] === 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 8.0.10 Microsoft Windows 10.0.22631 [2024-11-12 17:15:41Z - f39b8be5-6816-44ab-8321-4d60cf4c3eb1] Broker is configured and enabled, attempting to use broker instead.
DEBUG: False MSAL 4.65.0.0 MSAL.CoreCLR .NET 8.0.10 Microsoft Windows 10.0.22631 [2024-11-12 17:15:41Z] [Runtime] WAM supported OS.
DEBUG: False MSAL 4.65.0.0 MSAL.CoreCLR .NET 8.0.10 Microsoft Windows 10.0.22631 [2024-11-12 17:15:41Z - f39b8be5-6816-44ab-8321-4d60cf4c3eb1] Can invoke broker. Will attempt to acquire token with broker. 
DEBUG: False MSAL 4.65.0.0 MSAL.CoreCLR .NET 8.0.10 Microsoft Windows 10.0.22631 [2024-11-12 17:15:41Z] [MSAL:0001]     WARNING SetAuthorityUri:78  Initializing authority from URI 'https://login.microsoftonline.com/REDACTED/' without authority type, defaulting to MsSts 
DEBUG: False MSAL 4.65.0.0 MSAL.CoreCLR .NET 8.0.10 Microsoft Windows 10.0.22631 [2024-11-12 17:15:41Z] [MSAL:0002]     INFO    LogTelemetryData:422Printing Telemetry for Correlation ID: f39b8be5-6816-44ab-8321-4d60cf4c3eb1
DEBUG: False MSAL 4.65.0.0 MSAL.CoreCLR .NET 8.0.10 Microsoft Windows 10.0.22631 [2024-11-12 17:15:41Z] [MSAL:0002]     INFO    LogTelemetryData:430Key: start_time, Value: 2024-11-12T17:15:41.000Z
DEBUG: False MSAL 4.65.0.0 MSAL.CoreCLR .NET 8.0.10 Microsoft Windows 10.0.22631 [2024-11-12 17:15:41Z] [MSAL:0002]     INFO    LogTelemetryData:430Key: api_name, Value: ReadAccountById
DEBUG: False MSAL 4.65.0.0 MSAL.CoreCLR .NET 8.0.10 Microsoft Windows 10.0.22631 [2024-11-12 17:15:41Z] [MSAL:0002]     INFO    LogTelemetryData:430Key: was_request_throttled, Value: false
DEBUG: False MSAL 4.65.0.0 MSAL.CoreCLR .NET 8.0.10 Microsoft Windows 10.0.22631 [2024-11-12 17:15:41Z] [MSAL:0002]     INFO    LogTelemetryData:430Key: authority_type, Value: Unknown
DEBUG: False MSAL 4.65.0.0 MSAL.CoreCLR .NET 8.0.10 Microsoft Windows 10.0.22631 [2024-11-12 17:15:41Z] [MSAL:0002]     INFO    LogTelemetryData:430Key: msal_version, Value: 1.1.0+local
DEBUG: False MSAL 4.65.0.0 MSAL.CoreCLR .NET 8.0.10 Microsoft Windows 10.0.22631 [2024-11-12 17:15:41Z] [MSAL:0002]     INFO    LogTelemetryData:430Key: correlation_id, Value: f39b8be5-6816-44ab-8321-4d60cf4c3eb1
DEBUG: False MSAL 4.65.0.0 MSAL.CoreCLR .NET 8.0.10 Microsoft Windows 10.0.22631 [2024-11-12 17:15:41Z] [MSAL:0002]     INFO    LogTelemetryData:430Key: broker_app_used, Value: false
DEBUG: False MSAL 4.65.0.0 MSAL.CoreCLR .NET 8.0.10 Microsoft Windows 10.0.22631 [2024-11-12 17:15:41Z] [MSAL:0002]     INFO    LogTelemetryData:430Key: stop_time, Value: 2024-11-12T17:15:41.000Z
DEBUG: False MSAL 4.65.0.0 MSAL.CoreCLR .NET 8.0.10 Microsoft Windows 10.0.22631 [2024-11-12 17:15:41Z] [MSAL:0002]     INFO    LogTelemetryData:430Key: msalruntime_version, Value: 0.16.2
DEBUG: False MSAL 4.65.0.0 MSAL.CoreCLR .NET 8.0.10 Microsoft Windows 10.0.22631 [2024-11-12 17:15:41Z] [MSAL:0002]     INFO    LogTelemetryData:430Key: is_successful, Value: true
DEBUG: False MSAL 4.65.0.0 MSAL.CoreCLR .NET 8.0.10 Microsoft Windows 10.0.22631 [2024-11-12 17:15:41Z] [MSAL:0002]     INFO    LogTelemetryData:430Key: request_duration, Value: 0
DEBUG: False MSAL 4.65.0.0 MSAL.CoreCLR .NET 8.0.10 Microsoft Windows 10.0.22631 [2024-11-12 17:15:41Z] [MSAL:0002]     INFO    SetCorrelationId:258Set correlation ID: f39b8be5-6816-44ab-8321-4d60cf4c3eb1
DEBUG: False MSAL 4.65.0.0 MSAL.CoreCLR .NET 8.0.10 Microsoft Windows 10.0.22631 [2024-11-12 17:15:41Z] [MSAL:0002]     INFO    EnqueueBackgroundRequest:1000        The original authority is 'https://login.microsoftonline.com/REDACTED'
DEBUG: False MSAL 4.65.0.0 MSAL.CoreCLR .NET 8.0.10 Microsoft Windows 10.0.22631 [2024-11-12 17:15:41Z] [MSAL:0002]     INFO    ModifyAndValidateAuthParameters:219  Additional query parameter added successfully. Key: '(pii)' Value: '(pii)'
DEBUG: False MSAL 4.65.0.0 MSAL.CoreCLR .NET 8.0.10 Microsoft Windows 10.0.22631 [2024-11-12 17:15:41Z] [MSAL:0002]     INFO    ModifyAndValidateAuthParameters:243  Authority Realm: REDACTED
DEBUG: False MSAL 4.65.0.0 MSAL.CoreCLR .NET 8.0.10 Microsoft Windows 10.0.22631 [2024-11-12 17:15:41Z] [MSAL:0002]     WARNING TryEnqueueMsaDeviceCredentialAcquisitionAndContinue:1052     MsaDeviceOperationProvider is not available. Not attempting to register the device.
DEBUG: False MSAL 4.65.0.0 MSAL.CoreCLR .NET 8.0.10 Microsoft Windows 10.0.22631 [2024-11-12 17:15:41Z] [MSAL:0003]     INFO    StorageTokenResponse:84      StorageTokenResponse account constructor invoked. This is only expected in Runtime flows
DEBUG: False MSAL 4.65.0.0 MSAL.CoreCLR .NET 8.0.10 Microsoft Windows 10.0.22631 [2024-11-12 17:15:41Z] [MSAL:0003]     INFO    IsAccessTokenValid:2658      The access token is expired
DEBUG: False MSAL 4.65.0.0 MSAL.CoreCLR .NET 8.0.10 Microsoft Windows 10.0.22631 [2024-11-12 17:15:41Z] [MSAL:0003]     WARNING StorageTokenResponse:15      No credentials found in the cache
DEBUG: False MSAL 4.65.0.0 MSAL.CoreCLR .NET 8.0.10 Microsoft Windows 10.0.22631 [2024-11-12 17:15:41Z] [MSAL:0003]     WARNING GetPlatformPropertiesFromStorage:2013        No account found in cache.
DEBUG: False MSAL 4.65.0.0 MSAL.CoreCLR .NET 8.0.10 Microsoft Windows 10.0.22631 [2024-11-12 17:15:43Z] [MSAL:0003]     INFO    LogTelemetryData:422Printing Telemetry for Correlation ID: f39b8be5-6816-44ab-8321-4d60cf4c3eb1
DEBUG: False MSAL 4.65.0.0 MSAL.CoreCLR .NET 8.0.10 Microsoft Windows 10.0.22631 [2024-11-12 17:15:43Z] [MSAL:0003]     INFO    LogTelemetryData:430Key: start_time, Value: 2024-11-12T17:15:41.000Z
DEBUG: False MSAL 4.65.0.0 MSAL.CoreCLR .NET 8.0.10 Microsoft Windows 10.0.22631 [2024-11-12 17:15:43Z] [MSAL:0003]     INFO    LogTelemetryData:430Key: api_name, Value: AcquireTokenSilently
DEBUG: False MSAL 4.65.0.0 MSAL.CoreCLR .NET 8.0.10 Microsoft Windows 10.0.22631 [2024-11-12 17:15:43Z] [MSAL:0003]     INFO    LogTelemetryData:430Key: was_request_throttled, Value: false
DEBUG: False MSAL 4.65.0.0 MSAL.CoreCLR .NET 8.0.10 Microsoft Windows 10.0.22631 [2024-11-12 17:15:43Z] [MSAL:0003]     INFO    LogTelemetryData:430Key: authority_type, Value: AAD
DEBUG: False MSAL 4.65.0.0 MSAL.CoreCLR .NET 8.0.10 Microsoft Windows 10.0.22631 [2024-11-12 17:15:43Z] [MSAL:0003]     INFO    LogTelemetryData:430Key: access_token_expiry_time, Value: 2024-11-12T18:17:20.000Z
DEBUG: False MSAL 4.65.0.0 MSAL.CoreCLR .NET 8.0.10 Microsoft Windows 10.0.22631 [2024-11-12 17:15:43Z] [MSAL:0003]     INFO    LogTelemetryData:430Key: read_token, Value: ID|EAT
DEBUG: False MSAL 4.65.0.0 MSAL.CoreCLR .NET 8.0.10 Microsoft Windows 10.0.22631 [2024-11-12 17:15:43Z] [MSAL:0003]     INFO    LogTelemetryData:430Key: msal_version, Value: 1.1.0+local
DEBUG: False MSAL 4.65.0.0 MSAL.CoreCLR .NET 8.0.10 Microsoft Windows 10.0.22631 [2024-11-12 17:15:43Z] [MSAL:0003]     INFO    LogTelemetryData:430Key: client_id, Value: REDACTED
DEBUG: False MSAL 4.65.0.0 MSAL.CoreCLR .NET 8.0.10 Microsoft Windows 10.0.22631 [2024-11-12 17:15:43Z] [MSAL:0003]     INFO    LogTelemetryData:430Key: correlation_id, Value: f39b8be5-6816-44ab-8321-4d60cf4c3eb1
DEBUG: False MSAL 4.65.0.0 MSAL.CoreCLR .NET 8.0.10 Microsoft Windows 10.0.22631 [2024-11-12 17:15:43Z] [MSAL:0003]     INFO    LogTelemetryData:430Key: storage_delete, Value: DAT
DEBUG: False MSAL 4.65.0.0 MSAL.CoreCLR .NET 8.0.10 Microsoft Windows 10.0.22631 [2024-11-12 17:15:43Z] [MSAL:0003]     INFO    LogTelemetryData:430Key: broker_app_used, Value: true
DEBUG: False MSAL 4.65.0.0 MSAL.CoreCLR .NET 8.0.10 Microsoft Windows 10.0.22631 [2024-11-12 17:15:43Z] [MSAL:0003]     INFO    LogTelemetryData:430Key: stop_time, Value: 2024-11-12T17:15:43.000Z
DEBUG: False MSAL 4.65.0.0 MSAL.CoreCLR .NET 8.0.10 Microsoft Windows 10.0.22631 [2024-11-12 17:15:43Z] [MSAL:0003]     INFO    LogTelemetryData:430Key: msalruntime_version, Value: 0.16.2
DEBUG: False MSAL 4.65.0.0 MSAL.CoreCLR .NET 8.0.10 Microsoft Windows 10.0.22631 [2024-11-12 17:15:43Z] [MSAL:0003]     INFO    LogTelemetryData:430Key: original_authority, Value: https://login.microsoftonline.com/REDACTED
DEBUG: False MSAL 4.65.0.0 MSAL.CoreCLR .NET 8.0.10 Microsoft Windows 10.0.22631 [2024-11-12 17:15:43Z] [MSAL:0003]     INFO    LogTelemetryData:430Key: request_eligible_for_broker, Value: true
DEBUG: False MSAL 4.65.0.0 MSAL.CoreCLR .NET 8.0.10 Microsoft Windows 10.0.22631 [2024-11-12 17:15:43Z] [MSAL:0003]     INFO    LogTelemetryData:430Key: additional_query_parameters_count, Value: 1
DEBUG: False MSAL 4.65.0.0 MSAL.CoreCLR .NET 8.0.10 Microsoft Windows 10.0.22631 [2024-11-12 17:15:43Z] [MSAL:0003]     INFO    LogTelemetryData:430Key: storage_read, Value: DAC|DAT|DID|DAMD|DAC
DEBUG: False MSAL 4.65.0.0 MSAL.CoreCLR .NET 8.0.10 Microsoft Windows 10.0.22631 [2024-11-12 17:15:43Z] [MSAL:0003]     INFO    LogTelemetryData:430Key: delete_token, Value: AT
DEBUG: False MSAL 4.65.0.0 MSAL.CoreCLR .NET 8.0.10 Microsoft Windows 10.0.22631 [2024-11-12 17:15:43Z] [MSAL:0003]     INFO    LogTelemetryData:430Key: is_successful, Value: true
DEBUG: False MSAL 4.65.0.0 MSAL.CoreCLR .NET 8.0.10 Microsoft Windows 10.0.22631 [2024-11-12 17:15:43Z] [MSAL:0003]     INFO    LogTelemetryData:430Key: wam_telemetry, Value: {"x_ms_clitelem":"1,0,0,11220346.1383,","ui_visible":false,"tenant_id":"REDACTED","scope":"https://management.core.windows.net//.default offline_access openid profile","redirect_uri":"ms-appx-web://Microsoft.AAD.BrokerPlugin/REDACTED","provider_id":"https://login.windows.net","http_status":200,"http_event_count":1,"http_content_type":"application/jose; charset=utf-8","http_content_size":11982,"device_join":"aadj","correlation_id":"{f39b8be5-6816-44ab-8321-4d60cf4c3eb1}","client_id":"REDACTED","cache_event_count":0,"broker_version":"10.0.22621.4249","authority":"https://login.microsoftonline.com/REDACTED","api_error_code":0,"account_join_on_start":"primary","account_join_on_end":"primary","account_id":"7edb94eb-dc4e-4496-b998-fe2f951790ad","silent_code":0,"silent_bi_sub_code":0,"silent_message":"","silent_status":0,"is_cached":0}
DEBUG: False MSAL 4.65.0.0 MSAL.CoreCLR .NET 8.0.10 Microsoft Windows 10.0.22631 [2024-11-12 17:15:43Z] [MSAL:0003]     INFO    LogTelemetryData:430Key: auth_flow, Value: Broker
DEBUG: False MSAL 4.65.0.0 MSAL.CoreCLR .NET 8.0.10 Microsoft Windows 10.0.22631 [2024-11-12 17:15:43Z] [MSAL:0003]     INFO    LogTelemetryData:430Key: tenant_id, Value: REDACTED
DEBUG: False MSAL 4.65.0.0 MSAL.CoreCLR .NET 8.0.10 Microsoft Windows 10.0.22631 [2024-11-12 17:15:43Z] [MSAL:0003]     INFO    LogTelemetryData:430Key: write_token, Value: AT|ID
DEBUG: False MSAL 4.65.0.0 MSAL.CoreCLR .NET 8.0.10 Microsoft Windows 10.0.22631 [2024-11-12 17:15:43Z] [MSAL:0003]     INFO    LogTelemetryData:430Key: storage_write, Value: DAT|DID|DAC
DEBUG: False MSAL 4.65.0.0 MSAL.CoreCLR .NET 8.0.10 Microsoft Windows 10.0.22631 [2024-11-12 17:15:43Z] [MSAL:0003]     INFO    LogTelemetryData:430Key: authorization_type, Value: WindowsIntegratedAuth
DEBUG: False MSAL 4.65.0.0 MSAL.CoreCLR .NET 8.0.10 Microsoft Windows 10.0.22631 [2024-11-12 17:15:43Z] [MSAL:0003]     INFO    LogTelemetryData:430Key: request_duration, Value: 1822
DEBUG: False MSAL 4.65.0.0 MSAL.CoreCLR .NET 8.0.10 Microsoft Windows 10.0.22631 [2024-11-12 17:15:43Z] [MSAL:0003]     INFO    LogTelemetryData:435Printing Execution Flow:
DEBUG: False MSAL 4.65.0.0 MSAL.CoreCLR .NET 8.0.10 Microsoft Windows 10.0.22631 [2024-11-12 17:15:43Z] [MSAL:0003]     INFO    LogTelemetryData:443{"t":"4s7uc","tid":2,"ts":0,"l":2},{"t":"4sufd","tid":2,"ts":0,"s":2,"l":2},{"t":"4swgg","tid":2,"ts":0,"s":1,"l":2},{"t":"4swgf","tid":2,"ts":0,"s":1,"l":2},{"t":"4swgi","tid":3,"ts":1,"s":1,"l":2},{"t":"8b2yn","tid":3,"ts":1,"l":2},{"t":"8dqkx","tid":3,"ts":1,"l":2},{"t":"8dqik","tid":3,"ts":1,"l":2},{"t":"4q2di","tid":3,"ts":1,"l":2},{"t":"4qnng","tid":3,"ts":1,"l":2,"a":2,"ie":0},{"t":"4qnnf","tid":3,"ts":2,"l":2,"a":2,"ie":1},{"t":"8dqit","tid":3,"ts":3,"l":2},{"t":"8b2ht","tid":3,"ts":3,"l":2},{"t":"4qnno","tid":3,"ts":3,"l":2,"a":2,"ie":0},{"t":"4qnnn","tid":3,"ts":37,"l":2,"a":2,"ie":1},{"t":"4qnnk","tid":3,"ts":37,"l":2,"a":3,"ie":0},{"t":"4qnnj","tid":3,"ts":48,"l":2,"a":4,"ie":1},{"t":"4qwi1","tid":3,"ts":48,"l":2},{"t":"4qnna","tid":3,"ts":48,"l":2,"a":2,"ie":0},{"t":"4qnm9","tid":3,"ts":49,"l":2,"a":2,"ie":1},{"t":"8dqin","tid":3,"ts":49,"l":2},{"t":"4qnno","tid":3,"ts":49,"l":2,"a":2,"ie":0},{"t":"4qnnn","tid":3,"ts":49,"l":2,"a":2,"ie":1},{"t":"8b2hu","tid":3,"ts":49,"l":2},{"t":"5b8fg","tid":3,"ts":50,"l":2},{"t":"8dqk0","tid":3,"ts":50,"l":2},{"t":"4qnng","tid":3,"ts":50,"l":2,"a":2,"ie":0},{"t":"4qnnf","tid":3,"ts":50,"l":2,"a":2,"ie":1},{"t":"8dqjd","tid":3,"ts":50,"l":2},{"t":"694nj","tid":3,"ts":50,"l":2,"a":10,"ie":0},{"t":"4vw1f","tid":3,"ts":50,"l":2},{"t":"4wqnh","tid":3,"ts":51,"l":2},{"t":"4vw1c","tid":3,"ts":61,"l":2},{"t":"4vw1b","tid":3,"ts":61,"l":2},{"t":"4wqnk","tid":3,"ts":61,"l":2},{"t":"6omfm","tid":3,"ts":67,"l":2},{"t":"4vw1a","tid":3,"ts":67,"l":2},{"t":"4wqnf","tid":3,"ts":67,"l":2},{"t":"4wqm5","tid":3,"ts":80,"l":2},{"t":"4wqm6","tid":3,"ts":80,"l":2},{"t":"4u9jc","tid":3,"ts":1794,"l":2},{"t":"8dql1","tid":3,"ts":1794,"l":2},{"t":"4qopb","tid":3,"ts":1794,"l":2},{"t":"58yep","tid":3,"ts":1794,"l":2},{"t":"694nk","tid":3,"ts":1794,"l":2,"a":10,"ie":1},{"t":"8dqk1","tid":3,"ts":1794,"l":2},{"t":"8dqlh","tid":3,"ts":1794,"l":2},{"t":"8dqli","tid":3,"ts":1794,"l":2},{"t":"8dqln","tid":3,"ts":1794,"l":2},{"t":"4qnnm","tid":3,"ts":1794,"l":2,"a":3,"ie":0},{"t":"4qnnl","tid":3,"ts":1801,"l":2,"a":3,"ie":1},{"t":"4zbmt","tid":3,"ts":1802,"l":2},{"t":"4zbmu","tid":3,"ts":1802,"l":2},{"t":"4qnng","tid":3,"ts":1802,"l":2,"a":2,"ie":0},{"t":"4qnnf","tid":3,"ts":1803,"l":2,"a":2,"ie":1},{"t":"4qnne","tid":3,"ts":1803,"l":2,"a":3,"ie":0},{"t":"4qnnd","tid":3,"ts":1805,"l":2,"a":3,"ie":1},{"t":"6xuag","tid":3,"ts":1823,"l":2}
DEBUG: False MSAL 4.65.0.0 MSAL.CoreCLR .NET 8.0.10 Microsoft Windows 10.0.22631 [2024-11-12 17:15:43Z] [RuntimeBroker] WAM response status success  
DEBUG: False MSAL 4.65.0.0 MSAL.CoreCLR .NET 8.0.10 Microsoft Windows 10.0.22631 [2024-11-12 17:15:43Z - f39b8be5-6816-44ab-8321-4d60cf4c3eb1] Checking MsalTokenResponse returned from broker. 
DEBUG: False MSAL 4.65.0.0 MSAL.CoreCLR .NET 8.0.10 Microsoft Windows 10.0.22631 [2024-11-12 17:15:43Z - f39b8be5-6816-44ab-8321-4d60cf4c3eb1] Success. Response contains an access token. 
DEBUG: False MSAL 4.65.0.0 MSAL.CoreCLR .NET 8.0.10 Microsoft Windows 10.0.22631 [2024-11-12 17:15:43Z - f39b8be5-6816-44ab-8321-4d60cf4c3eb1] Checking client info returned from the server..
DEBUG: False MSAL 4.65.0.0 MSAL.CoreCLR .NET 8.0.10 Microsoft Windows 10.0.22631 [2024-11-12 17:15:43Z - f39b8be5-6816-44ab-8321-4d60cf4c3eb1] Saving token response to cache..
DEBUG: False MSAL 4.65.0.0 MSAL.CoreCLR .NET 8.0.10 Microsoft Windows 10.0.22631 [2024-11-12 17:15:43Z - f39b8be5-6816-44ab-8321-4d60cf4c3eb1] [Instance Discovery] Instance discovery is enabled and will be performed
DEBUG: False MSAL 4.65.0.0 MSAL.CoreCLR .NET 8.0.10 Microsoft Windows 10.0.22631 [2024-11-12 17:15:43Z - f39b8be5-6816-44ab-8321-4d60cf4c3eb1] [Region discovery] Not using a regional authority. 
DEBUG: False MSAL 4.65.0.0 MSAL.CoreCLR .NET 8.0.10 Microsoft Windows 10.0.22631 [2024-11-12 17:15:43Z - f39b8be5-6816-44ab-8321-4d60cf4c3eb1] Fetching instance discovery from the network from host login.microsoftonline.com. 
DEBUG: Request [2611dee3-769b-4595-adba-e7b6d351395b] GET https://login.microsoftonline.com/common/discovery/instance?api-version=1.1&authorization_endpoint=REDACTED
x-client-SKU:REDACTED
x-client-Ver:REDACTED
x-client-OS:REDACTED
client-request-id:REDACTED
return-client-request-id:REDACTED
x-ms-client-request-id:2611dee3-769b-4595-adba-e7b6d351395b
x-ms-return-client-request-id:true
User-Agent:azsdk-net-Identity.Broker/1.1.0 (.NET 8.0.10; Microsoft Windows 10.0.22631)
client assembly: Azure.Identity.Broker
DEBUG: Response [2611dee3-769b-4595-adba-e7b6d351395b] 200 OK (00.1s)
Cache-Control:max-age=86400, private
Strict-Transport-Security:REDACTED
X-Content-Type-Options:REDACTED
Access-Control-Allow-Origin:REDACTED
Access-Control-Allow-Methods:REDACTED
P3P:REDACTED
client-request-id:REDACTED
x-ms-request-id:c784a7cb-ee2a-436a-a474-122facfb6f00
x-ms-ests-server:REDACTED
x-ms-srs:REDACTED
X-XSS-Protection:REDACTED
Set-Cookie:REDACTED
Date:Tue, 12 Nov 2024 17:15:41 GMT
Content-Type:application/json; charset=utf-8
Content-Length:980

DEBUG: False MSAL 4.65.0.0 MSAL.CoreCLR .NET 8.0.10 Microsoft Windows 10.0.22631 [2024-11-12 17:15:43Z - f39b8be5-6816-44ab-8321-4d60cf4c3eb1] Authority validation enabled? True. 
DEBUG: False MSAL 4.65.0.0 MSAL.CoreCLR .NET 8.0.10 Microsoft Windows 10.0.22631 [2024-11-12 17:15:43Z - f39b8be5-6816-44ab-8321-4d60cf4c3eb1] Authority validation - is known env? True. 
DEBUG: False MSAL 4.65.0.0 MSAL.CoreCLR .NET 8.0.10 Microsoft Windows 10.0.22631 [2024-11-12 17:15:43Z - f39b8be5-6816-44ab-8321-4d60cf4c3eb1] [Region discovery] Not using a regional authority. 
DEBUG: False MSAL 4.65.0.0 MSAL.CoreCLR .NET 8.0.10 Microsoft Windows 10.0.22631 [2024-11-12 17:15:43Z - f39b8be5-6816-44ab-8321-4d60cf4c3eb1] [SaveTokenResponseAsync] Saving Id Token and Account in cache ...
DEBUG: False MSAL 4.65.0.0 MSAL.CoreCLR .NET 8.0.10 Microsoft Windows 10.0.22631 [2024-11-12 17:15:43Z - f39b8be5-6816-44ab-8321-4d60cf4c3eb1] [CalculateSuggestedCacheExpiry] No access tokens or refresh tokens found in the accessor. Not returning any expiration.
DEBUG: False MSAL 4.65.0.0 MSAL.CoreCLR .NET 8.0.10 Microsoft Windows 10.0.22631 [2024-11-12 17:15:43Z - f39b8be5-6816-44ab-8321-4d60cf4c3eb1]       
        === Token Acquisition finished successfully:
DEBUG: False MSAL 4.65.0.0 MSAL.CoreCLR .NET 8.0.10 Microsoft Windows 10.0.22631 [2024-11-12 17:15:43Z - f39b8be5-6816-44ab-8321-4d60cf4c3eb1]  AT expiration time: 12/11/2024 18:17:19 +00:00, scopes: https://management.core.windows.net//.default https://management.core.windows.net//user_impersonation. source: Broker
DEBUG: False MSAL 4.65.0.0 MSAL.CoreCLR .NET 8.0.10 Microsoft Windows 10.0.22631 [2024-11-12 17:15:43Z - f39b8be5-6816-44ab-8321-4d60cf4c3eb1] Fetched access token from host login.microsoftonline.com. 
DEBUG: SharedTokenCacheCredential.GetToken succeeded. Scopes: [ https://management.core.windows.net//.default ] ParentRequestId:  ExpiresOn: 2024-11-12T18:17:19.8122836+00:00
DEBUG: [Common.Authentication]: Received token with LoginType 'User', Tenant: 'REDACTED', UserId: 'REDACTED'
DEBUG: ============================ HTTP REQUEST ============================

HTTP Method:
GET

Absolute Uri:
https://management.azure.com/subscriptions/REDACTED/resourceGroups/rg-REDACTED/providers/Microsoft.ApiManagement/service/apim-REDACTED/apis/api-name?api-version=2021-08-01

Headers:
Accept-Language               : en-US
x-ms-client-request-id        : 9b14eefe-ae4f-4193-b42f-ebea9e472caf

Body:

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

Status Code:
OK

Headers:
Cache-Control                 : no-cache
Pragma                        : no-cache
ETag                          : "AAAAAAANOMw="
Strict-Transport-Security     : max-age=31536000; includeSubDomains
X-Content-Type-Options        : nosniff
x-ms-request-id               : 27cad1a5-1641-4828-bce8-430e42b8268a
x-ms-ratelimit-remaining-subscription-reads: 249
x-ms-ratelimit-remaining-subscription-global-reads: 3749
x-ms-correlation-request-id   : 27cad1a5-1641-4828-bce8-430e42b8268a
x-ms-routing-request-id       : UKWEST:20241112T171542Z:27cad1a5-1641-4828-bce8-430e42b8268a
X-Cache                       : CONFIG_NOCACHE
X-MSEdge-Ref                  : Ref A: 60035CCBF6144742BC9A87AB4DD07EA9 Ref B: AMS231032609045 Ref C: 2024-11-12T17:15:42Z
Date                          : Tue, 12 Nov 2024 17:15:41 GMT

Body:
{
  "id": "/subscriptions/REDACTED/resourceGroups/rg-REDACTED/providers/Microsoft.ApiManagement/service/apim-REDACTED/apis/api-name",
  "type": "Microsoft.ApiManagement/service/apis",
  "name": "api-name",
  "properties": {
    "displayName": "api-name",
    "apiRevision": "1",
    "description": "",
    "subscriptionRequired": false,
    "serviceUrl": null,
    "backendId": null,
    "path": "api-name",
    "protocols": [
      "https"
    ],
    "authenticationSettings": {
      "oAuth2": null,
      "openid": null
    },
    "subscriptionKeyParameterNames": {
      "header": "Ocp-Apim-Subscription-Key",
      "query": "subscription-key"
    },
    "isCurrent": true
  }
}

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

HTTP Method:
PUT

Absolute Uri:
https://management.azure.com/subscriptions/REDACTED/resourceGroups/rg-REDACTED/providers/Microsoft.ApiManagement/service/apim-REDACTED/apis/api-name%3Brev%3D4?api-version=2021-08-01

Headers:
Accept-Language               : en-US
x-ms-client-request-id        : 9b14eefe-ae4f-4193-b42f-ebea9e472caf

Body:
{
  "properties": {
    "type": "api-name",
    "sourceApiId": "/apis/api-name;rev=1"
  }
}

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

Status Code:
BadRequest

Headers:
Cache-Control                 : no-cache
Pragma                        : no-cache
Strict-Transport-Security     : max-age=31536000; includeSubDomains
X-Content-Type-Options        : nosniff
x-ms-request-id               : 2ab2c531-c7a5-4249-9b53-bcb2a1bde0dd
x-ms-ratelimit-remaining-subscription-writes: 199
x-ms-ratelimit-remaining-subscription-global-writes: 2999
x-ms-correlation-request-id   : 2ab2c531-c7a5-4249-9b53-bcb2a1bde0dd
x-ms-routing-request-id       : UKSOUTH:20241112T171542Z:2ab2c531-c7a5-4249-9b53-bcb2a1bde0dd
X-Cache                       : CONFIG_NOCACHE
X-MSEdge-Ref                  : Ref A: 9E6A33B3AEED40298C5645B6EFFFA3EA Ref B: AMS231032609045 Ref C: 2024-11-12T17:15:42Z
Date                          : Tue, 12 Nov 2024 17:15:41 GMT

Body:
{
  "error": {
    "code": "ValidationError",
    "message": "One or more fields contain incorrect values:",
    "details": [
      {
        "code": "ValidationError",
        "target": "representation",
        "message": "Parsing error(s): An error occured while parsing the input. Message: Error converting value \"api-name\" to type 'Microsoft.Azure.ApiManagement.Management.Contracts.ApiTypeContract'. Path 'type', line 2, position 14."
      }
    ]
  }
}

DEBUG: 17:15:44 - [ConfigManager] Got nothing from [EnableErrorRecordsPersistence], Module = [], Cmdlet = []. Returning default value [False].
New-AzApiManagementApiRevision: C:\Src\UpdateApim.ps1:4:23
Line |
   4 |  … iRevision = New-AzApiManagementApiRevision -Context $apiManagementCon …
     |                ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
     |  Error Code: ValidationError Error Message: One or more fields contain incorrect values: Request Id: 2ab2c531-c7a5-4249-9b53-bcb2a1bde0dd     
     | Error Details:  [Code= ValidationError, Message= Parsing error(s): An error occured while parsing the input. Message: Error converting value  
     | "api-name" to type 'Microsoft.Azure.ApiManagement.Management.Contracts.ApiTypeContract'. Path 'type', line 2, position 14., Target= representation] 
DEBUG: 17:15:44 - [ConfigManager] Got nothing from [DisplayBreakingChangeWarning], Module = [], Cmdlet = []. Returning default value [True].
DEBUG: 17:15:44 - [ConfigManager] Got nothing from [DisplayRegionIdentified], Module = [], Cmdlet = []. Returning default value [True].
DEBUG: 17:15:44 - [ConfigManager] Got nothing from [CheckForUpgrade], Module = [], Cmdlet = []. Returning default value [True].
DEBUG: AzureQoSEvent:  Module: Az.ApiManagement:4.0.5; CommandName: New-AzApiManagementApiRevision; PSVersion: 7.4.6; IsSuccess: False; Duration: 00:00:03.2881120; SanitizeDuration: 00:00:00; Exception: 
Error Code: ValidationError
Error Message: One or more fields contain incorrect values:
Request Id: 2ab2c531-c7a5-4249-9b53-bcb2a1bde0dd
Error Details:
        [Code= ValidationError, Message= Parsing error(s): An error occured while parsing the input. Message: Error converting value "api-name" to type 'Microsoft.Azure.ApiManagement.Management.Contracts.ApiTypeContract'. Path 'type', line 2, position 14., Target= representation]
;
DEBUG: 17:15:44 - [ConfigManager] Got nothing from [EnableDataCollection], Module = [], Cmdlet = []. Returning default value [True].
DEBUG: 17:15:44 - NewAzureApiManagementApiRevision end processing.

Environment data

PSVersion                      7.4.6
PSEdition                      Core
GitCommitId                    7.4.6
OS                             Microsoft Windows 10.0.22631
Platform                       Win32NT
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                                ExportedCommands
---------- -------    ---------- ----                                ----------------
Script     3.0.5                 Az.Accounts                         {Add-AzEnvironment, Clear-AzConfig, Clear-AzContext, Clear-AzDefault…}
Script     4.0.5                 Az.ApiManagement                    {Add-AzApiManagementApiToGateway, Add-AzApiManagementApiToProduct, Add-AzApiMa…

Error output

DEBUG: 17:35:39 - [ConfigManager] Got nothing from [DisplaySecretsWarning], Module = [], Cmdlet = []. Returning default value [True].
DEBUG: 17:35:39 - ResolveError begin processing with ParameterSet 'AnyErrorParameterSet'.
DEBUG: 17:35:39 - using account id 'REDACTED'...
DEBUG: 17:35:39 - [ConfigManager] Got nothing from [DisplayBreakingChangeWarning], Module = [], Cmdlet = []. Returning default value [True].
WARNING: Upcoming breaking changes in the cmdlet 'Resolve-AzError' :
The alias 'Resolve-Error' will be removed. Please use 'Resolve-AzError' instead.
- The change is expected to take effect in Az version : '13.0.0'
- The change is expected to take effect in Az.Accounts version : '4.0.0'
Note : Go to https://aka.ms/azps-changewarnings for steps to suppress this breaking change warning, and other information on breaking changes in Azure PowerShell.
DEBUG: 17:35:39 - [ConfigManager] Got nothing from [DisplaySecretsWarning], Module = [], Cmdlet = []. Returning default value [True].

   HistoryId: 2

Message        : 
                 Error Code: ValidationError
                 Error Message: One or more fields contain incorrect values:
                 Request Id: 59f8e250-2c11-4b1f-b0e8-950065cb6f7a
                 Error Details:
                        [Code= ValidationError, Message= Parsing error(s): An error occured while parsing the input. Message: Error converting value "api-name"
                 to type 'Microsoft.Azure.ApiManagement.Management.Contracts.ApiTypeContract'. Path 'type', line 2, position 14., Target=
                 representation]

StackTrace     : 
Exception      : System.Exception
InvocationInfo : {New-AzApiManagementApiRevision}
Line           :     $newApiRevision = New-AzApiManagementApiRevision -Context $apiManagementContext -ApiId "api-name" -ApiRevision 4 -SourceApiRevision   
                 1

Position       : At C:\Src\UpdateApim.ps1:4 char:23
                 + … iRevision = New-AzApiManagementApiRevision -Context $apiManagementCon …
                 +               ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
HistoryId      : 2

DEBUG: 17:35:39 - [ConfigManager] Got nothing from [DisplayRegionIdentified], Module = [], Cmdlet = []. Returning default value [True].
DEBUG: 17:35:39 - [ConfigManager] Got nothing from [CheckForUpgrade], Module = [], Cmdlet = []. Returning default value [True].
DEBUG: AzureQoSEvent:  Module: Az.Accounts:3.0.5; CommandName: Resolve-AzError; PSVersion: 7.4.6; IsSuccess: True; Duration: 00:00:00.1128562; SanitizeDuration: 00:00:00.0007710
DEBUG: 17:35:39 - [ConfigManager] Got nothing from [EnableDataCollection], Module = [], Cmdlet = []. Returning default value [True].
DEBUG: 17:35:39 - ResolveError end processing.
GarethLeePS commented 1 week ago

Rolled back Az module from v12.5.0 to v 12.4.0 on the vms running our azure self hosted agents and they are working again.

JoyerJin commented 1 week ago

Hi @GarethLeePS

I have located and fixed this issue, please use 12.4.0 again before it releases. Thank you.