Azure / azure-powershell

Microsoft Azure PowerShell
Other
4.25k stars 3.84k forks source link

GenericArguments[0] ... violates the constraint of type 'T' error since PowerShell 7.3.0.5 preview #18721

Closed craiglandis closed 1 year ago

craiglandis commented 2 years ago

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
dingmeng-xue commented 2 years ago

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

ghost commented 2 years ago

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

craiglandis commented 2 years ago

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

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

navba-MSFT commented 2 years ago

@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 commented 2 years ago

@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.

craiglandis commented 2 years ago

@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.

navba-MSFT commented 2 years ago

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

navba-MSFT commented 2 years ago

@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 commented 2 years ago

@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.

craiglandis commented 2 years ago

@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.

mrhvid commented 1 year ago

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:\>
chesterbeckett commented 1 year ago

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

Same here

mpjtaylor commented 1 year ago

Same issue!

dingmeng-xue commented 1 year ago

Reopen it because it becomes critical.

dingmeng-xue commented 1 year ago

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.

jmdwv commented 1 year ago

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

craiglandis commented 1 year ago

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
dingmeng-xue commented 1 year ago

FYI, Below modules may be impacted.

jpfocus commented 1 year ago

same err!

szpeter80 commented 1 year ago

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

1stewart commented 1 year ago

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.
dingmeng-xue commented 1 year ago

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.

plhandfield commented 1 year ago

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

bencurrandev commented 1 year ago

@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?

amassno commented 1 year ago

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 commented 1 year ago

@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

shwetayadkikar commented 1 year ago

@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?

dingmeng-xue commented 1 year ago

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

NiallP98 commented 1 year ago

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."

gdrozario commented 1 year ago

Same issue with 7.3.0

craiglandis commented 1 year ago

The release candidate fixed it for me.

ymadghe commented 1 year ago

Still getting same error.

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

$PSVersionTable PSVersion 7.3.0 PSEdition Core GitCommitId 7.3.0 OS Darwin 21.6.0 Darwin Kernel Version Platform Unix

Just fyi, I am using Powershell on mac with VSC extension

chillyjim commented 1 year ago

Same as @ymadghe on Darwin 21.6.9/Mac OS 13.0.1 if it matters

dingmeng-xue commented 1 year ago

@ymadghe , could you share the output of Get-Module in the same console after you hit that error?

Still getting same error.

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

$PSVersionTable PSVersion 7.3.0 PSEdition Core GitCommitId 7.3.0 OS Darwin 21.6.0 Darwin Kernel Version Platform Unix

Just fyi, I am using Powershell on mac with VSC extension

hillsrobin commented 1 year ago

This fixes the issue for me on Linux as well:

Name                           Value
----                           -----
PSVersion                      7.3.0
PSEdition                      Core
GitCommitId                    7.3.0
OS                             Linux 5.15.0-52-generic #58-Ubuntu SMP Thu Oct …
Platform                       Unix
PSCompatibleVersions           {1.0, 2.0, 3.0, 4.0…}
PSRemotingProtocolVersion      2.3
SerializationVersion           1.1.0.1
WSManStackVersion              3.0

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 commented 1 year ago

Hi All, here is new version of fix and covers all impacted modules. Originally, I just upgraded the version of AutoMapper and disabled method mapping. However models in Network module heavily use method mapping. I have to select another approach. I forked AutoMapper 8.1.1 and backport fix in AutoMapper 12 to 8.1.1. It requires extra couple days to include requires files into our pipeline and repo. Please use below versions to remove blocker.

If you already installed previous engineering build of Az.Compute, it can work with below modules. I recommend that you uninstall it and install below one again. I believe below modules are almost the versions we will publish.

Install-Module -Name Az.Tools.Installer -Repository PSGallery

# skip below one line if you have installed Az.Accounts from PSGallery
Install-AzModule Az.Accounts -Repository PSGallery 

# Install all engineering builds
Install-AzModule -Path https://azposhpreview.blob.core.windows.net/public/Az.Aks.5.1.0.nupkg
Install-AzModule -Path https://azposhpreview.blob.core.windows.net/public/Az.ApiManagement.4.0.1.nupkg
Install-AzModule -Path https://azposhpreview.blob.core.windows.net/public/Az.Compute.5.2.0.nupkg
Install-AzModule -Path https://azposhpreview.blob.core.windows.net/public/Az.Maintenance.1.2.1.nupkg
Install-AzModule -Path https://azposhpreview.blob.core.windows.net/public/Az.Monitor.4.3.0.nupkg
Install-AzModule -Path https://azposhpreview.blob.core.windows.net/public/Az.Network.5.1.2.nupkg
Install-AzModule -Path https://azposhpreview.blob.core.windows.net/public/Az.Peering.0.3.1.nupkg
Install-AzModule -Path https://azposhpreview.blob.core.windows.net/public/Az.RecoveryServices.6.1.1.nupkg
Install-AzModule -Path https://azposhpreview.blob.core.windows.net/public/Az.Resources.6.4.1.nupkg

If your environment still has issue, please share information of environment and loaded module via Get-Module.

backerman commented 1 year ago

Hi All, here is new version of fix and covers all impacted modules.

Works on my machine (PS 7.3.0, Win11 22621.819, ARM64).

amassno commented 1 year ago

Hello @dingmeng-xue, thank's for your work over the weekend. Unfortunately I still have problems with the modules.

Line | 55 | $net = Get-AzNetworkInterface | ~~~~~~~~~~~~~~~~~~~~~~ | Error mapping types. Mapping types: NetworkInterface -> PSNetworkInterface Microsoft.Azure.Management.Network.Models.NetworkInterface -> | Microsoft.Azure.Commands.Network.Models.PSNetworkInterface Type Map configuration: NetworkInterface -> PSNetworkInterface Microsoft.Azure.Management.Network.Models.NetworkInterface -> | Microsoft.Azure.Commands.Network.Models.PSNetworkInterface Destination Member: PrivateEndpoint

And when you switch the subscriptions, the login is lost.

Here the loaded modules:

` Get-Module

ModuleType Version PreRelease Name ExportedCommands


Script 2.10.3 Az.Accounts {Add-AzEnvironment, Clear-AzConfig, Clear-AzContext, Clear-AzDefault…} Script 5.2.0 Az.Compute {Add-AzImageDataDisk, Add-AzVhd, Add-AzVMAdditionalUnattendContent, Add-AzVMDataDisk…} Script 5.1.2 Az.Network {Add-AzApplicationGatewayAuthenticationCertificate, Add-AzApplicationGatewayBackendAddressPool, Add-AzApplicationGatewayBack… Script 6.4.1 Az.Resources {Export-AzResourceGroup, Export-AzTemplateSpec, Get-AzDenyAssignment, Get-AzDeployment…} 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 0.0 myAzureFunctions {CheckAzCopy, ConnectToAzureSubscription, Dummy, getAllAzVM…} Script 0.2.0 PowerShellEditorServices.Commands {Clear-Host, ConvertFrom-ScriptExtent, ConvertTo-ScriptExtent, Find-Ast…} Binary 0.2.0 PowerShellEditorServices.VSCode {Close-VSCodeHtmlContentView, New-VSCodeHtmlContentView, Set-VSCodeHtmlContentView, Show-VSCodeHtmlContentView…} Script 2.2.6 PSReadLine {Get-PSReadLineKeyHandler, Get-PSReadLineOption, Remove-PSReadLineKeyHandler, Set-PSReadLineKeyHandler…}

$PSVersionTable

Name Value


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

dingmeng-xue commented 1 year ago

Hello @dingmeng-xue Dingmeng Xue FTE, thank's for your work over the weekend. Unfortunately I still have problems with the modules.

Thanks @amassno . I can reproduce it. It seems breaking change between AutoMapper 6.2.2 and 8.1.1. Let us look into it.

joselcaguilar commented 1 year ago

Hi All, here is new version of fix and covers all impacted modules. Originally, I just upgraded the version of AutoMapper and disabled method mapping. However models in Network module heavily use method mapping. I have to select another approach. I forked AutoMapper 8.1.1 and backport fix in AutoMapper 12 to 8.1.1. It requires extra couple days to include requires files into our pipeline and repo. Please use below versions to remove blocker.

If you already installed previous engineering build of Az.Compute, it can work with below modules. I recommend that you uninstall it and install below one again. I believe below modules are almost the versions we will publish.

Install-Module -Name Az.Tools.Installer -Repository PSGallery

# skip below one line if you have installed Az.Accounts from PSGallery
Install-AzModule Az.Accounts -Repository PSGallery 

# Install all engineering builds
Install-AzModule -Path https://azposhpreview.blob.core.windows.net/public/Az.Aks.5.1.0.nupkg
Install-AzModule -Path https://azposhpreview.blob.core.windows.net/public/Az.ApiManagement.4.0.1.nupkg
Install-AzModule -Path https://azposhpreview.blob.core.windows.net/public/Az.Compute.5.2.0.nupkg
Install-AzModule -Path https://azposhpreview.blob.core.windows.net/public/Az.Maintenance.1.2.1.nupkg
Install-AzModule -Path https://azposhpreview.blob.core.windows.net/public/Az.Monitor.4.3.0.nupkg
Install-AzModule -Path https://azposhpreview.blob.core.windows.net/public/Az.Network.5.1.2.nupkg
Install-AzModule -Path https://azposhpreview.blob.core.windows.net/public/Az.Peering.0.3.1.nupkg
Install-AzModule -Path https://azposhpreview.blob.core.windows.net/public/Az.RecoveryServices.6.1.1.nupkg
Install-AzModule -Path https://azposhpreview.blob.core.windows.net/public/Az.Resources.6.4.1.nupkg

If your environment still has issue, please share information of environment and loaded module via Get-Module.

Thanks for the quick fix @dingmeng-xue, unfortunately I still see the issue with Get-AzBastion + Pwsh 7.3.0:

Get-AzBastion: Error mapping types.

Mapping types:
BastionHost -> PSBastion
Microsoft.Azure.Management.Network.Models.BastionHost -> Microsoft.Azure.Commands.Network.Models.PSBastion

Type Map configuration:
BastionHost -> PSBastion
Microsoft.Azure.Management.Network.Models.BastionHost -> Microsoft.Azure.Commands.Network.Models.PSBastion

Destination Member:
Sku
Roni44 commented 1 year ago

The same for my any idea?

Get-AzImage : GenericArguments[0], 'Microsoft.Azure.Commands.Compute.Automation.Models.PSVirtualMachineScaleSetExtension', on 'T MaxIntegerT' violates the constraint of type 'T'.

gdrozario commented 1 year ago

The same for my any idea?

Get-AzImage : GenericArguments[0], 'Microsoft.Azure.Commands.Compute.Automation.Models.PSVirtualMachineScaleSetExtension', on 'T MaxIntegerT' violates the constraint of type 'T'.

There is a fix which will take a couple of days to be officially released according to @dingmeng-xue 2 days ago.

In the meantime, rolling powershell back from 7.3.0 to 7.2.7 should allow any existing scripts you have to function correctly.

dingmeng-xue commented 1 year ago

Hi All,

For saving time, I published the engineering build before I triggered test. Thanks for your information again. We had found the same issue in our test environment as well. It seems AutoMapper 8.1.1 cannot work with current modules. I have to back port fix to AutoMapper current used version 6.2.2. Pull request is https://github.com/Azure/azure-powershell/pull/20110. If all tests are executed successfully, we will share engineering build again before official release.

Sorry for inconvenience.

AdamTheManTyler commented 1 year ago

Hi All,

For saving time, I published the engineering build before I triggered test. Thanks for your information again. We had found the same issue in our test environment as well. It seems AutoMapper 8.1.1 cannot work with current modules. I have to back port fix to AutoMapper current used version 6.2.2. Pull request is #20110. If all tests are executed successfully, we will share engineering build again before official release.

Sorry for inconvenience.

How does stuff like this get posted for public download? Is there any QA process in place? Az module completely broken after PowerShell 7.3 upgrade. Uninstalled and back to 7.2.7.

Regards, Adam Tyler

bencurrandev commented 1 year ago

Installed the above and most things are working again, just a few odd ones out, similar to the Error mapping types others are also seeing, linked to AutoMapper.

Get-AzVirtualHub -ResourceGroupName pdw-usw2-sbx-arg-vwan-1
Get-AzVirtualHub: Error mapping types.

Mapping types:
HubVirtualNetworkConnection -> PSHubVirtualNetworkConnection
Microsoft.Azure.Management.Network.Models.HubVirtualNetworkConnection -> Microsoft.Azure.Commands.Network.Models.PSHubVirtualNetworkConnection

Type Map configuration:
HubVirtualNetworkConnection -> PSHubVirtualNetworkConnection
Microsoft.Azure.Management.Network.Models.HubVirtualNetworkConnection -> Microsoft.Azure.Commands.Network.Models.PSHubVirtualNetworkConnection

Destination Member:
RoutingConfiguration
dingmeng-xue commented 1 year ago

Hi All,

Due to behavior change between AutoMapper 6.2.2 and 8.1.1, we have to back port fix to AutoMapper 6.2.2. Please uninstall your modules and install below modules for verification.

Install-Module -Name Az.Tools.Installer -Repository PSGallery

# skip below one line if you have installed Az.Accounts from PSGallery
Install-AzModule Az.Accounts -Repository PSGallery 

# Install all engineering builds
Install-AzModule -Path https://azposhpreview.blob.core.windows.net/public/Az.Aks.5.1.0.nupkg
Install-AzModule -Path https://azposhpreview.blob.core.windows.net/public/Az.ApiManagement.4.0.1.nupkg
Install-AzModule -Path https://azposhpreview.blob.core.windows.net/public/Az.Compute.5.2.0.nupkg
Install-AzModule -Path https://azposhpreview.blob.core.windows.net/public/Az.Maintenance.1.2.1.nupkg
Install-AzModule -Path https://azposhpreview.blob.core.windows.net/public/Az.Monitor.4.3.0.nupkg
Install-AzModule -Path https://azposhpreview.blob.core.windows.net/public/Az.Network.5.1.2.nupkg
Install-AzModule -Path https://azposhpreview.blob.core.windows.net/public/Az.Peering.0.3.1.nupkg
Install-AzModule -Path https://azposhpreview.blob.core.windows.net/public/Az.RecoveryServices.6.1.1.nupkg
Install-AzModule -Path https://azposhpreview.blob.core.windows.net/public/Az.Resources.6.4.1.nupkg

In previous version, I shared binaries after I tested VM and VirtualNetwork. But I didn't check the result of scenario test and other resources. Current version has passed our scenario test. It should cover the most of cases. I have also manually tested VM, Image, VirtualNetwork, and NetworkInterface. They work well in PowerShell 7.2 and 7.3. FYI, our scenario test coverage rate is about 70% and cannot cover all 2000+ Azure resources. If you hit the issue, please share to us.

joselcaguilar commented 1 year ago

Hi All,

Due to behavior change between AutoMapper 6.2.2 and 8.1.1, we have to back port fix to AutoMapper 6.2.2. Please uninstall your modules and install below modules for verification.

Install-Module -Name Az.Tools.Installer -Repository PSGallery

# skip below one line if you have installed Az.Accounts from PSGallery
Install-AzModule Az.Accounts -Repository PSGallery 

# Install all engineering builds
Install-AzModule -Path https://azposhpreview.blob.core.windows.net/public/Az.Aks.5.1.0.nupkg
Install-AzModule -Path https://azposhpreview.blob.core.windows.net/public/Az.ApiManagement.4.0.1.nupkg
Install-AzModule -Path https://azposhpreview.blob.core.windows.net/public/Az.Compute.5.2.0.nupkg
Install-AzModule -Path https://azposhpreview.blob.core.windows.net/public/Az.Maintenance.1.2.1.nupkg
Install-AzModule -Path https://azposhpreview.blob.core.windows.net/public/Az.Monitor.4.3.0.nupkg
Install-AzModule -Path https://azposhpreview.blob.core.windows.net/public/Az.Network.5.1.2.nupkg
Install-AzModule -Path https://azposhpreview.blob.core.windows.net/public/Az.Peering.0.3.1.nupkg
Install-AzModule -Path https://azposhpreview.blob.core.windows.net/public/Az.RecoveryServices.6.1.1.nupkg
Install-AzModule -Path https://azposhpreview.blob.core.windows.net/public/Az.Resources.6.4.1.nupkg

In previous version, I shared binaries after I tested VM and VirtualNetwork. But I didn't check the result of scenario test and other resources. Current version has passed our scenario test. It should cover the most of cases. I have also manually tested VM, Image, VirtualNetwork, and VirtualInterface. They work well in PowerShell 7.2 and 7.3. FYI, our scenario test coverage rate is about 70% and cannot cover all 2000+ Azure resources. If you hit the issue, please share to us.

At least, Get-AzBastion is now working like a charm @dingmeng-xue, thanks for the update! 🚀

nicolashemery commented 1 year ago

Hi All,

Due to behavior change between AutoMapper 6.2.2 and 8.1.1, we have to back port fix to AutoMapper 6.2.2. Please uninstall your modules and install below modules for verification.

Install-Module -Name Az.Tools.Installer -Repository PSGallery

# skip below one line if you have installed Az.Accounts from PSGallery
Install-AzModule Az.Accounts -Repository PSGallery 

# Install all engineering builds
Install-AzModule -Path https://azposhpreview.blob.core.windows.net/public/Az.Aks.5.1.0.nupkg
Install-AzModule -Path https://azposhpreview.blob.core.windows.net/public/Az.ApiManagement.4.0.1.nupkg
Install-AzModule -Path https://azposhpreview.blob.core.windows.net/public/Az.Compute.5.2.0.nupkg
Install-AzModule -Path https://azposhpreview.blob.core.windows.net/public/Az.Maintenance.1.2.1.nupkg
Install-AzModule -Path https://azposhpreview.blob.core.windows.net/public/Az.Monitor.4.3.0.nupkg
Install-AzModule -Path https://azposhpreview.blob.core.windows.net/public/Az.Network.5.1.2.nupkg
Install-AzModule -Path https://azposhpreview.blob.core.windows.net/public/Az.Peering.0.3.1.nupkg
Install-AzModule -Path https://azposhpreview.blob.core.windows.net/public/Az.RecoveryServices.6.1.1.nupkg
Install-AzModule -Path https://azposhpreview.blob.core.windows.net/public/Az.Resources.6.4.1.nupkg

In previous version, I shared binaries after I tested VM and VirtualNetwork. But I didn't check the result of scenario test and other resources. Current version has passed our scenario test. It should cover the most of cases. I have also manually tested VM, Image, VirtualNetwork, and VirtualInterface. They work well in PowerShell 7.2 and 7.3. FYI, our scenario test coverage rate is about 70% and cannot cover all 2000+ Azure resources. If you hit the issue, please share to us.

Hi, I add also the issue mentionned by @amassno on New-AzPrivateLinkServiceConnection ( and other function of Az.Network) , i uninstalled, reinstalled and now is working. Thanks. Let us know when the release will be official.

Have a nice day

wimmatthyssen commented 1 year ago

Hi,

Also having the above issues at the moment, as a temporary fix I reverted my PowerShell version back to v7.2.7

https://github.com/PowerShell/PowerShell/releases/tag/v7.2.7

Hope the issues will be fixed soon, so we can update to the latest PowerShell version.

AdamTheManTyler commented 1 year ago

Hi,

Also having the above issues at the moment, as a temporary fix I reverted my PowerShell version back to v7.2.7

https://github.com/PowerShell/PowerShell/releases/tag/v7.2.7

Hope the issues will be fixed soon, so we can update to the latest PowerShell version.

And that a QA process is implemented to prevent public software postings that are totally broken.

Regards, Adam Tyler