azure-powershell icon indicating copy to clipboard operation
azure-powershell copied to clipboard

GenericArguments[0], 'Microsoft.Azure.Management.Compute.Models.VirtualMachine', on 'T MaxInteger[T](System.Collections.Generic.IEnumerable`1[T])' violates the constraint of type 'T'.

Open craiglandis opened this issue 2 years ago • 8 comments

Description

Az.Compute 4.27.0/PS 7.3.0.5 - Get-AzVM, Stop-AzVM, and Start-AzVM always fail with error:

GenericArguments[0], 'Microsoft.Azure.Management.Compute.Models.VirtualMachine', on 'T MaxIntegerT' violates the constraint of type 'T'.

This issue started after installing PS preview 7.3.0.5 - these cmdlets were working fine on PS preview 7.3.0.4. Also, they work fine on PS 7.2.5.

Issue script & Debug output

PS C:\> Get-AzVM

Get-AzVM: GenericArguments[0], 'Microsoft.Azure.Management.Compute.Models.VirtualMachine', on 'T MaxInteger[T](System.Collections.Generic.IEnumerable`1[T])' violates the constraint of type 'T'.

Environment data

PS C:\> $PSVersionTable

Name                           Value
----                           -----
PSVersion                      7.3.0-preview.5
PSEdition                      Core
GitCommitId                    7.3.0-preview.5
OS                             Microsoft Windows 10.0.22000
Platform                       Win32NT
PSCompatibleVersions           {1.0, 2.0, 3.0, 4.0…}
PSRemotingProtocolVersion      2.3
SerializationVersion           1.1.0.1
WSManStackVersion              3.0

Module versions

PS C:\> Get-Module Az*

ModuleType Version    PreRelease Name                                ExportedCommands
---------- -------    ---------- ----                                ----------------
Script     2.8.0                 Az.Accounts                         {Add-AzEnvironment, Clear-AzConfig, Clear-AzContext, Clear-AzDefault…}
Script     4.27.0                Az.Compute                          {Add-AzImageDataDisk, Add-AzVhd, Add-AzVMAdditionalUnattendContent, Add-AzVMDataDisk…}

Error output

PS C:\> Resolve-AzError -Last
WARNING: Upcoming breaking changes in the cmdlet 'Resolve-AzError' :
The `Resolve-Error` alias will be removed in a future release.  Please change any scripts that use this alias to use `Resolve-AzError` instead.
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.

   HistoryId: 17

Message        : GenericArguments[0], 'Microsoft.Azure.Management.Compute.Models.VirtualMachine', on 'T MaxInteger[T](System.Collections.Generic.IEnumerable`1[T])' violates the constraint of type 'T'.
StackTrace     :    at System.RuntimeType.ValidateGenericArguments(MemberInfo definition, RuntimeType[] genericArguments, Exception e)
                    at System.Reflection.RuntimeMethodInfo.MakeGenericMethod(Type[] methodInstantiation)
                    at AutoMapper.TypeDetails.<>c.<BuildPublicNoArgExtensionMethods>b__30_7(<>f__AnonymousType18`2 <>h__TransparentIdentifier1)
                    at System.Linq.Enumerable.WhereSelectEnumerableIterator`2.MoveNext()
                    at System.Linq.Enumerable.WhereSelectEnumerableIterator`2.MoveNext()
                    at System.Collections.Generic.HashSet`1.UnionWith(IEnumerable`1 other)
                    at System.Linq.Enumerable.UnionIterator`1.FillSet()
                    at System.Linq.Enumerable.UnionIterator`1.ToArray()
                    at AutoMapper.TypeDetails.BuildPublicNoArgExtensionMethods(IEnumerable`1 sourceExtensionMethodSearch)
                    at AutoMapper.TypeDetails..ctor(Type type, ProfileMap config)
                    at AutoMapper.ProfileMap.TypeDetailsFactory(Type type)
                    at AutoMapper.LockingConcurrentDictionary`2.<>c__DisplayClass2_1.<.ctor>b__1()
                    at System.Lazy`1.ViaFactory(LazyThreadSafetyMode mode)
                    at System.Lazy`1.ExecutionAndPublication(LazyHelper executionAndPublication, Boolean useDefaultConstructor)
                    at System.Lazy`1.CreateValue()
                    at AutoMapper.LockingConcurrentDictionary`2.GetOrAdd(TKey key)
                    at AutoMapper.ProfileMap.CreateTypeDetails(Type type)
                    at AutoMapper.TypeMapFactory.CreateTypeMap(Type sourceType, Type destinationType, ProfileMap options)
                    at AutoMapper.ProfileMap.BuildTypeMap(TypeMapRegistry typeMapRegistry, ITypeMapConfiguration config)
                    at AutoMapper.ProfileMap.Register(TypeMapRegistry typeMapRegistry)
                    at AutoMapper.MapperConfiguration.Seal()
                    at AutoMapper.MapperConfiguration..ctor(MapperConfigurationExpression configurationExpression)
                    at AutoMapper.MapperConfiguration..ctor(Action`1 configure)
                    at Microsoft.Azure.Commands.Compute.ComputeAutoMapperProfile.Initialize()
                    at Microsoft.Azure.Commands.Compute.ComputeAutoMapperProfile.get_Mapper()
                    at Microsoft.Azure.Commands.Compute.GetAzureVMCommand.GetPowerstate(AzureOperationResponse`1 vmListResult, List`1 psResultListStatus)
                    at Microsoft.Azure.Commands.Compute.GetAzureVMCommand.ReturnListVMObject(AzureOperationResponse`1 vmListResult, Func`4 listNextFunction)
                    at Microsoft.Azure.Commands.Compute.GetAzureVMCommand.<ExecuteCmdlet>b__40_0()
                    at Microsoft.Azure.Commands.Compute.ComputeClientBaseCmdlet.ExecuteClientAction(Action action)
                    at Microsoft.Azure.Commands.Compute.GetAzureVMCommand.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      : System.ArgumentException
InvocationInfo : {Get-AzVM}
Line           : get-azvm
Position       : At line:1 char:1
                 + get-azvm
                 + ~~~~~~~~
HistoryId      : 17

Message        : Method System.Linq.Enumerable.MaxInteger: type argument 'Microsoft.Azure.Management.Compute.Models.VirtualMachine' violates the constraint of type parameter 'T'.
StackTrace     :    at System.RuntimeMethodHandle.GetStubIfNeeded(RuntimeMethodHandleInternal method, RuntimeType declaringType, RuntimeType[] methodInstantiation)
                    at System.Reflection.RuntimeMethodInfo.MakeGenericMethod(Type[] methodInstantiation)
Exception      : System.Security.VerificationException
InvocationInfo : {Get-AzVM}
Line           : get-azvm
Position       : At line:1 char:1
                 + get-azvm
                 + ~~~~~~~~
HistoryId      : 17

craiglandis avatar Jun 24 '22 19:06 craiglandis

Thanks for reporting. Please share debug log after setting $DebugPreference = "Continue".

dingmeng-xue avatar Jun 27 '22 06:06 dingmeng-xue

Thank you for your feedback. This has been routed to the support team for assistance.

msftbot[bot] avatar Jun 27 '22 06:06 msftbot[bot]

Thanks for reporting. Please share debug log after setting $DebugPreference = "Continue".

@dingmeng-xue I sent you the log via internal mail

craiglandis avatar Jul 19 '22 02:07 craiglandis

@craiglandis Apologies for the late reply. Thanks for reaching out to us and reporting this issue. I have got the debug traces which you had shared with @dingmeng-xue. We are looking into this issue and we will provide an update.

navba-MSFT avatar Jul 19 '22 03:07 navba-MSFT

@craiglandis This exception seems to be related to the AutoMapper package and has been reported here https://github.com/AutoMapper/AutoMapper/issues/3988 . A PR was also filed and merged as a fix for this: https://github.com/AutoMapper/AutoMapper/pull/3999 whose fix is included in this milestone with no ETA mentioned: https://github.com/AutoMapper/AutoMapper/milestone/42

Until then as a workaround, could you please try using the latest v7.3.0-preview.6 version ? I was able to run the PS cmdlet using this version and it did show the output with VM details. However it did throw the same above exception. If you want to avoid the exception try using the older version PS preview 7.3.0.4.

navba-MSFT avatar Jul 19 '22 05:07 navba-MSFT

@navba-MSFT - Will that Automapper fix come in a future release of Az.Compute or in a future PS 7 Preview release?

7.3.0.6 fails the same way for me, and unlike you, I don't get any VM details in addition to the exception - I just get the exception.

So this issue is a blocker for me using 7.3.0.5+ versions until the Automapper fix is included in some future release.

craiglandis avatar Jul 19 '22 17:07 craiglandis

@craiglandis I will check this with the product owners and get back to you with an update.

navba-MSFT avatar Jul 20 '22 03:07 navba-MSFT

@craiglandis We appreciate your patience on this. I have looped you in an email thread with the Compute PM team. Awaiting their reply now.

@jaylabell and @TravisCragg-MSFT for awareness

navba-MSFT avatar Aug 01 '22 03:08 navba-MSFT

@craiglandis I hope you had a chance to look at our internal email communications. In that the suggestion (is same as above) is again to use older version PS preview 7.3.0.4 as a workaround until the fix is provided. There is no ETA for now for the fix. Awaiting your reply.

navba-MSFT avatar Aug 16 '22 04:08 navba-MSFT

@craiglandis I hope you had a chance to look at our internal email communications. In that the suggestion (is same as above) is again to use older version PS preview 7.3.0.4 as a workaround until the fix is provided. There is no ETA for now for the fix. Awaiting your reply.

That's fine, I've just been using the release version of PS (7.2.6) in the meantime anyway when I need to run Azure PowerShell commands.

craiglandis avatar Aug 16 '22 16:08 craiglandis

After updating to official Powershell 7.3.0 (pushed by VSCode this morning). I'm seeing the same error

C:\> Get-AzVM
Get-AzVM: GenericArguments[0], 'Microsoft.Azure.Management.Compute.Models.VirtualMachine', on 'T MaxInteger[T](System.Collections.Generic.IEnumerable`1[T])' violates the constraint of type 'T'.
C:\> $PSVersionTable

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

C:\> Get-Module

ModuleType Version    PreRelease Name                                ExportedCommands
---------- -------    ---------- ----                                ----------------
Script     2.10.3                Az.Accounts                         {Add-AzEnvironment, Clear-AzConfig, Clear-AzContext, Clear-AzDefault…}
Script     5.1.0                 Az.Compute                          {Add-AzImageDataDisk, Add-AzVhd, Add-AzVMAdditionalUnattendContent, Add-AzVMDataDisk…}
Script     6.4.0                 Az.Resources                        {Export-AzResourceGroup, Export-AzTemplateSpec, Get-AzDenyAssignment, Get-AzDeployment…}
Script     5.1.0                 Az.Storage                          {Add-AzRmStorageContainerLegalHold, Add-AzStorageAccountManagementPolicyAction, Add-AzStorageAccountNetworkRule, Close-AzStorageFileHandle…
Script     1.0.3                 Az.Tools.Predictor                  {Disable-AzPredictor, Enable-AzPredictor, Open-AzPredictorSurvey, Send-AzPredictorRating}
Manifest   7.0.0.0               Microsoft.PowerShell.Management     {Add-Content, Clear-Content, Clear-Item, Clear-ItemProperty…}
Manifest   7.0.0.0               Microsoft.PowerShell.Security       {ConvertFrom-SecureString, ConvertTo-SecureString, Get-Acl, Get-AuthenticodeSignature…}
Manifest   7.0.0.0               Microsoft.PowerShell.Utility        {Add-Member, Add-Type, Clear-Variable, Compare-Object…}
Manifest   7.0.0.0               Microsoft.WSMan.Management          {Connect-WSMan, Disable-WSManCredSSP, Disconnect-WSMan, Enable-WSManCredSSP…}
Script     1.0.0                 posh-git                            {Add-PoshGitToProfile, Expand-GitCommand, Format-GitBranchName, Get-GitBranchStatusColor…}
Script     2.2.6                 PSReadLine                          {Get-PSReadLineKeyHandler, Get-PSReadLineOption, Remove-PSReadLineKeyHandler, Set-PSReadLineKeyHandler…}

C:\>

mrhvid avatar Nov 09 '22 12:11 mrhvid

After updating to official Powershell 7.3.0 (pushed by VSCode this morning). I'm seeing the same error

Same here

chesterbeckett avatar Nov 09 '22 12:11 chesterbeckett

Same issue!

mpjtaylor avatar Nov 09 '22 12:11 mpjtaylor

Reopen it because it becomes critical.

dingmeng-xue avatar Nov 09 '22 13:11 dingmeng-xue

We are looking into problem. Besides Az.Compute, Az.Network has the same problem. I believe some popular modules have the same problem. Please use PowerShell 7.2 or lower for the time being.

dingmeng-xue avatar Nov 09 '22 13:11 dingmeng-xue

After updating to official Powershell 7.3.0 (pushed by VSCode this morning). I'm seeing the same error

C:\> Get-AzVM
Get-AzVM: GenericArguments[0], 'Microsoft.Azure.Management.Compute.Models.VirtualMachine', on 'T MaxInteger[T](System.Collections.Generic.IEnumerable`1[T])' violates the constraint of type 'T'.

Same issue - guess it is time to go back to 7.2.

PS C:\Users\jmdwv> get-azvm Get-AzVM: GenericArguments[0], 'Microsoft.Azure.Management.Compute.Models.VirtualMachine', on 'T MaxIntegerT' violates the constraint of type 'T'. PS C:\Users\jmdwv> $PSVersionTable

Name Value


PSVersion 7.3.0 PSEdition Core GitCommitId 7.3.0 OS Microsoft Windows 10.0.19044 Platform Win32NT PSCompatibleVersions {1.0, 2.0, 3.0, 4.0…} PSRemotingProtocolVersion 2.3 SerializationVersion 1.1.0.1 WSManStackVersion 3.0

jmdwv avatar Nov 09 '22 16:11 jmdwv

As of yesterday Nov 8, 7.3.0 is the latest release version of PowerShell. It's no longer in preview.

But this issue still repros 100% of the time with 7.3.0 -

PS C:\> Get-AzVM
Get-AzVM: GenericArguments[0], 'Microsoft.Azure.Management.Compute.Models.VirtualMachine', on 'T MaxInteger[T](System.Collections.Generic.IEnumerable`1[T])' violates the constraint of type 'T'.

PS C:\> $PSVersionTable.PSVersion.ToString()
7.3.0

PS C:\> Get-Module Az.Compute -ListAvailable | ft Name, Version

Name       Version
----       -------
Az.Compute 5.1.0

craiglandis avatar Nov 09 '22 16:11 craiglandis

FYI, Below modules may be impacted.

  • Monitor
  • Maintenance
  • ApiManagement
  • Peering
  • Aks
  • Network
  • RecoveryService
  • Resources
  • Compute

dingmeng-xue avatar Nov 10 '22 01:11 dingmeng-xue

same err!

jpfocus avatar Nov 10 '22 02:11 jpfocus

Happening here too... yesterday it was working, now updated and cant create VM :/

szpeter80 avatar Nov 10 '22 12:11 szpeter80

Same issue with Get-AzVmss. Broke our pipelines (our fault for not version pinning) so had to switch to the lts/stable channel.

[12:50:18] <PowerShell-7.3.0-win-x64> $PSVersionTable

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

[12:50:31] <PowerShell-7.3.0-win-x64> Get-AzVMSS -debug
DEBUG: 12:50:36 - GetAzureRmVmss begin processing with ParameterSet 'DefaultParameter'.
DEBUG: 12:50:36 - using account id '**REDACTED**'...
DEBUG: 12:50:36 - [ConfigManager] Got nothing from [DisplayBreakingChangeWarning], Module = [], Cmdlet = []. Returning default value [True].
DEBUG: [Common.Authentication]: Authenticating using Account: '**REDACTED**', environment: 'AzureCloud', tenant: '**REDACTED**'
DEBUG: 12:50:36 - [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.39.0.0 MSAL.NetCore .NET 7.0.0 Microsoft Windows 10.0.19042 [11/10 12:50:36.24 - f382bacf-5acd-4f30-bf5e-987f22209e3a] IsLegacyAdalCacheEnabled: yes
DEBUG: False MSAL 4.39.0.0 MSAL.NetCore .NET 7.0.0 Microsoft Windows 10.0.19042 [11/10 12:50:36.24 - f382bacf-5acd-4f30-bf5e-987f22209e3a] [Region discovery] Not using a regional authority.
DEBUG: False MSAL 4.39.0.0 MSAL.NetCore .NET 7.0.0 Microsoft Windows 10.0.19042 [11/10 12:50:36.24 - f382bacf-5acd-4f30-bf5e-987f22209e3a] [Region discovery] Not using a regional authority.
DEBUG: False MSAL 4.39.0.0 MSAL.NetCore .NET 7.0.0 Microsoft Windows 10.0.19042 [11/10 12:50:36.24 - f382bacf-5acd-4f30-bf5e-987f22209e3a] IsLegacyAdalCacheEnabled: yes
DEBUG: False MSAL 4.39.0.0 MSAL.NetCore .NET 7.0.0 Microsoft Windows 10.0.19042 [11/10 12:50:36.24 - f382bacf-5acd-4f30-bf5e-987f22209e3a] IsLegacyAdalCacheEnabled: yes
DEBUG: False MSAL 4.39.0.0 MSAL.NetCore .NET 7.0.0 Microsoft Windows 10.0.19042 [11/10 12:50:36.24] Found 1 cache accounts and 0 broker accounts
DEBUG: False MSAL 4.39.0.0 MSAL.NetCore .NET 7.0.0 Microsoft Windows 10.0.19042 [11/10 12:50:36.24] Returning 1 accounts
DEBUG: False MSAL 4.39.0.0 MSAL.NetCore .NET 7.0.0 Microsoft Windows 10.0.19042 [11/10 12:50:36.24 - f2cc5846-2fef-4ada-903d-c89a31a66920] MSAL MSAL.NetCore with assembly version '4.39.0.0'. CorrelationId(f2cc5846-2fef-4ada-903d-c89a31a66920)
DEBUG: False MSAL 4.39.0.0 MSAL.NetCore .NET 7.0.0 Microsoft Windows 10.0.19042 [11/10 12:50:36.24 - f2cc5846-2fef-4ada-903d-c89a31a66920] === AcquireTokenSilent Parameters ===
DEBUG: False MSAL 4.39.0.0 MSAL.NetCore .NET 7.0.0 Microsoft Windows 10.0.19042 [11/10 12:50:36.24 - f2cc5846-2fef-4ada-903d-c89a31a66920] LoginHint provided: False
DEBUG: False MSAL 4.39.0.0 MSAL.NetCore .NET 7.0.0 Microsoft Windows 10.0.19042 [11/10 12:50:36.24 - f2cc5846-2fef-4ada-903d-c89a31a66920] Account provided: True
DEBUG: False MSAL 4.39.0.0 MSAL.NetCore .NET 7.0.0 Microsoft Windows 10.0.19042 [11/10 12:50:36.24 - f2cc5846-2fef-4ada-903d-c89a31a66920] ForceRefresh: False
DEBUG: False MSAL 4.39.0.0 MSAL.NetCore .NET 7.0.0 Microsoft Windows 10.0.19042 [11/10 12:50:36.24 - f2cc5846-2fef-4ada-903d-c89a31a66920]
=== 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 - f2cc5846-2fef-4ada-903d-c89a31a66920
UserAssertion set: False
LongRunningOboCacheKey set: False

DEBUG: False MSAL 4.39.0.0 MSAL.NetCore .NET 7.0.0 Microsoft Windows 10.0.19042 [11/10 12:50:36.24 - f2cc5846-2fef-4ada-903d-c89a31a66920] === Token Acquisition (SilentRequest) started:
         Scopes: https://management.core.windows.net//.default
        Authority Host: login.microsoftonline.com
DEBUG: False MSAL 4.39.0.0 MSAL.NetCore .NET 7.0.0 Microsoft Windows 10.0.19042 [11/10 12:50:36.24 - f2cc5846-2fef-4ada-903d-c89a31a66920] [Region discovery] Not using a regional authority.
DEBUG: False MSAL 4.39.0.0 MSAL.NetCore .NET 7.0.0 Microsoft Windows 10.0.19042 [11/10 12:50:36.24 - f2cc5846-2fef-4ada-903d-c89a31a66920] Access token is not expired. Returning the found cache entry. [Current time (11/10/2022 12:50:36) - Expiration Time (11/10/2022 14:14:47 +00:00) - Extended Expiration Time (11/10/2022 14:14:47 +00:00)]
DEBUG: False MSAL 4.39.0.0 MSAL.NetCore .NET 7.0.0 Microsoft Windows 10.0.19042 [11/10 12:50:36.24 - f2cc5846-2fef-4ada-903d-c89a31a66920] Returning access token found in cache. RefreshOn exists ? False
DEBUG: False MSAL 4.39.0.0 MSAL.NetCore .NET 7.0.0 Microsoft Windows 10.0.19042 [11/10 12:50:36.24 - f2cc5846-2fef-4ada-903d-c89a31a66920] [Region discovery] Not using a regional authority.
DEBUG: False MSAL 4.39.0.0 MSAL.NetCore .NET 7.0.0 Microsoft Windows 10.0.19042 [11/10 12:50:36.24 - f2cc5846-2fef-4ada-903d-c89a31a66920] Fetched access token from host login.microsoftonline.com.
DEBUG: False MSAL 4.39.0.0 MSAL.NetCore .NET 7.0.0 Microsoft Windows 10.0.19042 [11/10 12:50:36.24 - f2cc5846-2fef-4ada-903d-c89a31a66920]
        === Token Acquisition finished successfully:
DEBUG: False MSAL 4.39.0.0 MSAL.NetCore .NET 7.0.0 Microsoft Windows 10.0.19042 [11/10 12:50:36.24 - f2cc5846-2fef-4ada-903d-c89a31a66920]  AT expiration time: 10/11/2022 14:14:47 +00:00, scopes https://management.core.windows.net//user_impersonation https://management.core.windows.net//.default source Cache from login.microsoftonline.com appHashCode 17704955
DEBUG: SharedTokenCacheCredential.GetToken succeeded. Scopes: [ https://management.core.windows.net//.default ] ParentRequestId:  ExpiresOn: 2022-11-10T14:14:47.0000000+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**/providers/Microsoft.Compute/virtualMachineScaleSets?api-version=2022-03-01

Headers:
Accept-Language               : en-US
x-ms-client-request-id        : 588243b1-5b7c-4e80-a003-d94faa558985

Body:



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

Status Code:
OK

Headers:
Cache-Control                 : no-cache
Pragma                        : no-cache
x-ms-ratelimit-remaining-resource: Microsoft.Compute/HighCostGetVMScaleSet3Min;178,Microsoft.Compute/HighCostGetVMScaleSet30Min;898
Strict-Transport-Security     : max-age=31536000; includeSubDomains
x-ms-request-id               : 807fdf1e-0cef-4e7f-842e-68a14154eb07
Server                        : Microsoft-HTTPAPI/2.0,Microsoft-HTTPAPI/2.0
x-ms-ratelimit-remaining-subscription-reads: 11999
x-ms-correlation-request-id   : 2e2764d2-7a48-4ed3-a824-b24482813a77
x-ms-routing-request-id       : UKSOUTH:20221110T125000Z:2e2764d2-7a48-4ed3-a824-b24482813a77
X-Content-Type-Options        : nosniff
Date                          : Thu, 10 Nov 2022 12:49:59 GMT

Body:
{
  "value": [
    {
      "name": "uka**REDACTED**mgtvss001",
      "id": "/subscriptions/**REDACTED**/resourceGroups/UKA**REDACTED**MGTRGR003/providers/Microsoft.Compute/virtualMachineScaleSets/uka**REDACTED**mgtvss001",
      "type": "Microsoft.Compute/virtualMachineScaleSets",
      "location": "uksouth",
      "tags": {
        "department": "Improvements",
        "description": "Management Build Agent Resources",
        "developer": "**REDACTED**@**REDACTED**.com",
        "instance": "Management",
        "maintainer": "**REDACTED**@**REDACTED**.com",
        "module_version": "0.0.1",
        "owner": "**REDACTED**@**REDACTED**.com",
        "pipeline": "**REDACTED**.**REDACTED**.Management",
        "__AzureDevOpsElasticPool": "**REDACTED** Self-Hosted",
        "__AzureDevOpsElasticPoolTimeStamp": "11/10/2022 10:51:55 AM"
      },
      "identity": {
        "type": "SystemAssigned",
        "principalId": "**REDACTED**",
        "tenantId": "**REDACTED**"
      },
      "sku": {
        "name": "Standard_D2s_v3",
        "tier": "Standard",
        "capacity": 8
      },
      "properties": {
        "singlePlacementGroup": true,
        "orchestrationMode": "Uniform",
        "upgradePolicy": {
          "mode": "Manual"
        },
        "scaleInPolicy": {
          "rules": [
            "Default"
          ],
          "forceDeletion": false
        },
        "virtualMachineProfile": {
          "osProfile": {
            "computerNamePrefix": "uka**REDACTED**mgtvss001",
            "adminUsername": "nodeadmin",
            "linuxConfiguration": {
              "disablePasswordAuthentication": true,
              "ssh": {
                "publicKeys": [
                  {
                    "path": "/home/nodeadmin/.ssh/authorized_keys",
                    "keyData": "ssh-rsa **REDACTED**"
                  }
                ]
              },
              "provisionVMAgent": true,
              "enableVMAgentPlatformUpdates": false
            },
            "secrets": [],
            "allowExtensionOperations": true,
            "requireGuestProvisionSignal": true
          },
          "storageProfile": {
            "osDisk": {
              "osType": "Linux",
              "createOption": "FromImage",
              "caching": "None",
              "writeAcceleratorEnabled": false,
              "managedDisk": {
                "storageAccountType": "Standard_LRS"
              },
              "diskSizeGB": 30
            },
            "imageReference": {
              "publisher": "canonical",
              "offer": "0001-com-ubuntu-server-focal",
              "sku": "20_04-lts-gen2",
              "version": "latest"
            }
          },
          "networkProfile": {
            "networkInterfaceConfigurations": [
              {
                "name": "management",
                "properties": {
                  "primary": true,
                  "enableAcceleratedNetworking": false,
                  "disableTcpStateTracking": false,
                  "dnsSettings": {
                    "dnsServers": []
                  },
                  "enableIPForwarding": false,
                  "ipConfigurations": [
                    {
                      "name": "management",
                      "properties": {
                        "primary": true,
                        "subnet": {
                          "id": "/subscriptions/**REDACTED**/resourceGroups/uka**REDACTED**mgtrgr002/providers/Microsoft.Network/virtualNetworks/uka**REDACTED**mgtvnt001/subnets/management"
                        },
                        "privateIPAddressVersion": "IPv4"
                      }
                    }
                  ]
                }
              }
            ]
          },
          "diagnosticsProfile": {
            "bootDiagnostics": {
              "enabled": true
            }
          },
          "extensionProfile": {
            "extensions": [
              {
                "name": "Microsoft.Azure.DevOps.Pipelines.Agent",
                "properties": {
                  "autoUpgradeMinorVersion": false,
                  "publisher": "Microsoft.VisualStudio.Services",
                  "type": "TeamServicesAgentLinux",
                  "typeHandlerVersion": "1.23",
                  "settings": {
                    "isPipelinesAgent": true,
                    "agentFolder": "/agent",
                    "agentDownloadUrl": "https://vstsagentpackage.azureedge.net/agent/2.213.1/vsts-agent-linux-x64-2.213.1.tar.gz",
                    "enableScriptDownloadUrl": "https://vstsagenttools.blob.core.windows.net/tools/ElasticPools/Linux/14/enableagent.sh"
                  }
                }
              },
              {
                "name": "MicrosoftAzureMonitor",
                "properties": {
                  "autoUpgradeMinorVersion": true,
                  "provisionAfterExtensions": [],
                  "enableAutomaticUpgrade": false,
                  "publisher": "Microsoft.Azure.Monitor",
                  "type": "AzureMonitorLinuxAgent",
                  "typeHandlerVersion": "1.21",
                  "settings": {
                    "authentication": {
                      "managedIdentity": {
                        "identifier-name": "mi_res_id",
                        "identifier-value": "**REDACTED**"
                      }
                    }
                  }
                }
              }
            ],
            "extensionsTimeBudget": "PT1H30M"
          },
          "priority": "Regular"
        },
        "additionalCapabilities": {
          "ultraSSDEnabled": false
        },
        "provisioningState": "Succeeded",
        "overprovision": false,
        "doNotRunExtensionsOnOverprovisionedVMs": false,
        "uniqueId": "**REDACTED**",
        "timeCreated": "2022-09-28T15:41:53.0560932+01:00"
      }
    }
  ]
}


DEBUG: 12:50:36 - [ConfigManager] Got [True] from [EnableDataCollection], Module = [], Cmdlet = [].
Get-AzVmss: GenericArguments[0], 'Microsoft.Azure.Commands.Compute.Automation.Models.PSVirtualMachineScaleSetExtension', on 'T MaxInteger[T](System.Collections.Generic.IEnumerable`1[T])' violates the constraint of type 'T'.
DEBUG: 12:50:36 - [ConfigManager] Got nothing from [DisplayBreakingChangeWarning], Module = [], Cmdlet = []. Returning default value [True].
DEBUG: AzureQoSEvent: Module: Az.Compute:4.31.0; CommandName: Get-AzVmss; PSVersion: 7.3.0; IsSuccess: False; Duration: 00:00:00.1772875; Exception: GenericArguments[0], 'Microsoft.Azure.Commands.Compute.Automation.Models.PSVirtualMachineScaleSetExtension', on 'T MaxInteger[T](System.Collections.Generic.IEnumerable`1[T])' violates the constraint of type 'T'.;
DEBUG: Finish sending metric.
DEBUG: 12:50:36 - GetAzureRmVmss end processing.

1stewart avatar Nov 10 '22 13:11 1stewart

Hi All,

We are trying to fix this issue. Here is a release candidate. Please download it and install it via local repository. Alternatively, you can install it using Az.Tools.Installer.

Install-Module -Name Az.Tools.Installer -Repository PSGallery
Install-AzModule -Path https://azposhpreview.blob.core.windows.net/public/Az.Compute.5.2.0.nupkg

Your feedback is very helpful to us. Thanks.

dingmeng-xue avatar Nov 11 '22 02:11 dingmeng-xue

@dingmeng-xue I can confirm this fixed the issue for me.

plhandfield avatar Nov 11 '22 09:11 plhandfield

@dingmeng-xue Confirmed that the fix for Az.Compute 5.2.0 works for Get-AzVM. Is there also a release candidate fix for Az.Network that can be tested as well?

bencurrandev avatar Nov 11 '22 09:11 bencurrandev

Now i get this error: Get-AzResourceGroup: The 'Get-AzResourceGroup' command was found in the module 'Az.Resources', but the module could not be loaded due to the following error: [Assembly with same name is already loaded] For more information, run 'Import-Module Az.Resources'.

Get-AzVM is working well. Thanks

amassno avatar Nov 11 '22 09:11 amassno

@amassno , this issue is little complicated and impacts 9 modules. They are sharing the same version of AutoMapper. I believe your case is due to Az.Resources tries to load AutoMapper 6.2.2 but new Az.Compute has already imported AutoMapper 8.1.1. If Compute and Network engineering build work as expected, we will publish OOB release for all of them.

Now i get this error: Get-AzResourceGroup: The 'Get-AzResourceGroup' command was found in the module 'Az.Resources', but the module could not be loaded due to the following error: [Assembly with same name is already loaded] For more information, run 'Import-Module Az.Resources'.

Get-AzVM is working well. Thanks

dingmeng-xue avatar Nov 11 '22 10:11 dingmeng-xue

@amassno , this issue is little complicated and impacts 9 modules. They are sharing the same version of AutoMapper. I believe your case is due to Az.Resources tries to load AutoMapper 6.2.2 but new Az.Compute has already imported AutoMapper 8.1.1. If Compute and Network engineering build work as expected, we will publish OOB release for all of them.

Now i get this error: Get-AzResourceGroup: The 'Get-AzResourceGroup' command was found in the module 'Az.Resources', but the module could not be loaded due to the following error: [Assembly with same name is already loaded] For more information, run 'Import-Module Az.Resources'. Get-AzVM is working well. Thanks

Do you have any timeline for the fix or OOB release for Az.Network?

shwetayadkikar avatar Nov 11 '22 10:11 shwetayadkikar

@shwetayadkikar , It contains another problem. Hopefully, I can find solution in weekend.

dingmeng-xue avatar Nov 11 '22 12:11 dingmeng-xue

I'm receiving this error now trying to download the fix, "Exception calling "Download" with "2" argument(s): " is not a valid Az module nuget package name for installation."

NiallP98 avatar Nov 11 '22 13:11 NiallP98

Same issue with 7.3.0

gdrozario avatar Nov 11 '22 16:11 gdrozario