Skip to content

Commit 584d283

Browse files
committed
Merge branch 'regressiontests' of https://github.com/wastoresh/azure-powershell into yifan/regretests-fix
2 parents 8874643 + 196b99e commit 584d283

File tree

486 files changed

+168319
-71053
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

486 files changed

+168319
-71053
lines changed

.azure-pipelines/security-tools.yml

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ jobs:
3131
condition: eq(variables.IsGenerateBased, true)
3232
inputs:
3333
versionSpec: 14.17.1
34-
34+
3535
- task: PowerShell@2
3636
displayName: Install autorest
3737
condition: eq(variables.IsGenerateBased, true)
@@ -54,6 +54,13 @@ jobs:
5454
scanFolder: SecurityTmp
5555
suppressionsFile: tools/SecurityTools/CredScanSuppressions.json
5656

57+
- task: PowerShell@2
58+
displayName: Copy PDB for BinSkim
59+
inputs:
60+
targetType: inline
61+
script: ./src/lib/pdb/CopyPdbToArtifacts.ps1
62+
pwsh: true
63+
5764
- task: securedevelopmentteam.vss-secure-development-tools.build-task-binskim.BinSkim@3
5865
displayName: Run BinSkim
5966
inputs:

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,7 @@ dlldata.c
7171
*.obj
7272
*.pch
7373
*.pdb
74+
!/src/lib/pdb/*.pdb
7475
*.pgc
7576
*.pgd
7677
*.rsp

ChangeLog.md

Lines changed: 98 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,101 @@
1+
## 9.3.0 - January 2023
2+
#### Az.Accounts
3+
* Supported Web Account Manager (WAM) as an opt-in interactive login experience. Enable it by 'Update-AzConfig -EnableLoginByWam True'.
4+
* Optimized the mechanism for assembly loading.
5+
* Enabled AzKeyStore with keyring in Linux.
6+
* Fixed a typo in GetAzureRmContextAutosaveSetting.cs changing the cmdlet class name to GetAzureRmContextAutosaveSetting
7+
* Removed survey on error message in 'Resolve-AzError'. [#20398]
8+
9+
#### Az.Aks
10+
* Added parameter '-EnableEncryptionAtHost' for 'New-AzAksCluster' and 'New-AzAksNodePool'
11+
* Added parameter '-EnableUltraSSD' for 'New-AzAksCluster' and 'New-AzAksNodePool'
12+
* Added parameter '-NodeKubeletConfig' for 'New-AzAksCluster', '-KubeletConfig' for 'New-AzAksNodePool'
13+
* Added parameter '-NodeLinuxOSConfig' for 'New-AzAksCluster', '-LinuxOSConfig' and 'New-AzAksNodePool'
14+
* Added parameter '-NodeMaxSurge' for 'New-AzAksCluster', '-MaxSurge' for 'New-AzAksNodePool' and 'Update-AzAksNodePool'
15+
* Added parameter '-PPG' for 'New-AzAksCluster' and 'New-AzAksNodePool'
16+
* Added parameter '-SpotMaxPrice' for 'New-AzAksNodePool'
17+
* Added parameter '-EnableFIPS' for 'New-AzAksCluster' and 'New-AzAksNodePool'
18+
* Added parameter '-AutoScalerProfile' for 'New-AzAksCluster' and 'Set-AzAksCluster'
19+
* Added parameter '-GpuInstanceProfile' for 'New-AzAksCluster' and 'New-AzAksNodePool'
20+
* Added parameter '-EnableUptimeSLA' for 'New-AzAksCluster' and 'Set-AzAksCluster'
21+
* Added parameter '-EdgeZone' for 'New-AzAksCluster'
22+
23+
#### Az.ApiManagement
24+
* Updated description of ResourceId param 'New-AzApiManagementBackend' and 'Set-AzApiManagementBackend' cmdlet [#16868]
25+
26+
#### Az.ApplicationInsights
27+
* Enabled output object enumerating for 'Get-AzApplicationInsights' [#20225]
28+
29+
#### Az.Automation
30+
* Updated Example: Start-AzAutomationRunbook should pass ordered dictionary for parameters [#20408]
31+
32+
#### Az.Batch
33+
* Added new properties 'CurrentNodeCommunicationMode' (read only) and 'TargetCommunicationMode' of type 'NodeCommunicationMode' to 'PSCloudPool'.
34+
- Valid values for 'NodeCommunicationMode': Default, Classic, Simplified
35+
- When the 'PSCloudPool' is updated with a new 'TargetCommunicationMode' value, the Batch service will attempt to update the pool to the new value the next time the pool is resized down to zero compute nodes and back up.
36+
* 'PSPrivateLinkServiceConnectionState''s 'ActionRequired' property required has been renamed to 'ActionsRequired'. The old property has been marked as obsolete, and now just returns the new property. This should not impact existing consumers.
37+
38+
#### Az.Compute
39+
* Removed the image 'Win2008R2SP1' from the list of available images and documentation. This image is no longer available on the backend so the client tools need to sync to that change.
40+
* Fixed a bug for creating Linux VM's from SIG/Community Gallery Images
41+
* Added 'ImageReferenceId' string parameter to the 'New-AzVmssConfig' cmdlet. This allows gallery image references to be added for the Confidential VM feature.
42+
* Added 'SecurityEncryptionType' and 'SecureVMDiskEncryptionSet' string parameters to the 'Set-AzVmssStorageProfile' cmdlet for the Confidential VM feature.
43+
44+
#### Az.ContainerRegistry
45+
* Fixed bug in 'Get-AzContainerRegistryTag' to show correct tags [#20528]
46+
47+
#### Az.Monitor
48+
* Fixed bug for 'Remove-AzDataCollectionRuleAssociation' [#20207]
49+
* Added support for test notifications cmdlets
50+
* 'Test-AzActionGroup'
51+
* Fixed start time parameter description of 'Get-AzActivityLog' [#20409]
52+
53+
#### Az.Network
54+
* Added samples for retrieving Private Link IP Configuration using 'New-AzApplicationGatewayPrivateLinkIpConfiguration' with fix [#20440]
55+
* Added 'DdosProtectionPlan' property in 'AzPublicIpAddress'
56+
* Updated mapping in 'AzPublicIpAddress' to always show/create DdosSettings
57+
* Fixed a bug that added Ddos related properties when viewing PublicIpAddress and DdosProtectionPlan objects
58+
* Fixed a Bug for Set-AzIpGroup cmdlet to support the '-WhatIf' parameter
59+
* Fixed a Bug for 'Add-AzLoadBalancerFrontendIpConfig', 'Add-AzLoadBalancerProbeConfig', 'Add-AzLoadBalancerBackendAddressPoolConfig', 'Set-AzLoadBalancer', 'New-AzLoadBalancerRuleConfig', 'Remove-AzLoadBalancerInboundNatRuleConfig' cmdlets to support the '-WhatIf' parameter. [#20416]
60+
* Fixed a bug for DestinationPortBehavior in 'Get-AzNetworkWatcherConnectionMonitor', 'New-AzNetworkWatcherConnectionMonitor' powershell command by adding this properties to get and set the DestinationPortBehavior information. [#15996]
61+
62+
#### Az.RedisCache
63+
* Added optional parameter 'PreferredDataArchiveAuthMethod' in 'Export-AzRedisCache'
64+
* Added optional parameter 'PreferredDataArchiveAuthMethod' in 'Import-AzRedisCache'
65+
* Added 4 additional properties for a geo replication link: 'PrimaryHostName', 'GeoReplicatedPrimaryHostName', 'ServerRole', and 'LinkedRedisCacheLocation'in 'Get-AzRedisCacheLink' and 'New-AzRedisCacheLink'
66+
67+
#### Az.Resources
68+
* Fixed issue introduced in previous fix for 'Set-AzPolicySetDefinition' InternalServerError when the initiative is too large [#20238], which will remove space in value.
69+
* Fixed 'Get-AzRoleAssignment' BadRequest when scope is '/' [#20323]
70+
71+
#### Az.SecurityInsights
72+
* Fixed for 'Update-AzSentinelAlertRule' fails when using '-TriggerThreshold 0' [#20417]
73+
74+
#### Az.Sql
75+
* Added a parameter named 'UseIdentity' for 'Set-AzSqlServerAudit', 'Set-AzSqlDatabaseAudit', 'Set-AzSqlServerMSSupportAudit'
76+
* Added 'IsManagedIdentityInUse' property to the output of 'Get-AzSqlServerMSSupportAudit'
77+
* Added 'PreferredEnclaveType' parameter to 'New-AzSqlDatabase', 'Get-AzSqlDatabase' and 'Set-AzSqlDatabase' cmdlet
78+
79+
#### Az.StackHCI
80+
* Added support for arc extensions which depend on HCI cluster's IMDS endpoints.
81+
82+
#### Az.Storage
83+
* Return ListBlobProperties in blob list result
84+
- 'Get-AzStorageBlob'
85+
* Output AllowedCopyScope in get account result
86+
- 'Get-AzStorageAccount'
87+
88+
#### Az.Websites
89+
* Fixed 'Import-AzWebAppKeyVaultCertificate' to use certificate naming convention same as portal [#19592]
90+
91+
### Thanks to our community contributors
92+
* Pavel Lyalyakin (@bahrep), New-AzDiskConfig.md: fixed a copy-pasto (#20514)
93+
* Eugene Ogongo (@eugeneogongo), Update Images.json (#18654)
94+
* Hiroshi Yoshioka (@hyoshioka0128), Typo "resouce"→"resource" (#20441)
95+
* Paul Gledhill (@pmgledhill102), Spelling mistake 'Accpeted' (#20380)
96+
* Cameron Sowder (@sowderca), Fixed typo in Get-AzContextAutosaveSetting class name: GetzureRmContextAutosaveSetting -> GetAzureRmContextAutosaveSetting (#20420)
97+
98+
199
## 9.2.0 - December 2022
2100
#### Az.Accounts
3101
* Enabled caching tokens when logging in with a client assertion. This fixed the incorrectly short lifespan of tokens.

documentation/breaking-changes/upcoming-breaking-changes.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -421,7 +421,7 @@
421421
### `Get-AzNetAppFilesVault`
422422

423423
- Cmdlet breaking-change will happen to all parameter set
424-
- The output type is changing from the existing type :'Microsoft.Azure.Commands.NetAppFiles.Models.PSNetAppFilesBackupPolicy' to the new type :'PSNetAppFilesVault'
424+
- The cmdlet is being deprecated. There will be no replacement for it.
425425

426426
### `New-AzNetAppFilesBackupPolicy`
427427

documentation/development-docs/common-assemblies.md

Lines changed: 22 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,30 +1,36 @@
11
# Common Assemblies
22
It is common scenario that 2 different modules take dependency on different versions of one assembly. It won't be big issue for Windows PowerShell as .NET Framework allows to load different versions of one assembly into one process. However, .NET Core and .NET 5+ do not allow to load 2 different versions of one assembly into the same [AssemblyLoadContext](https://docs.microsoft.com/en-us/dotnet/api/system.runtime.loader.assemblyloadcontext).
33

4-
As a platform, PowerShell allows user to import modules on demand. Modules may probably share the same dependency but with different versions. Assembly conflict is common problem in PowerShell. Although Azure PowerShell cannot resolve it completely, we introduce techniques across modules of Azure PowerShell to mitigate this problem. The idea come from [Resolving PowerShell Module Assembly Dependency Conflicts](https://devblogs.microsoft.com/powershell/resolving-powershell-module-assembly-dependency-conflicts/)
4+
As a platform, PowerShell allows user to import modules on demand. Modules may probably share the same dependency but with different versions. Assembly conflict is a common problem in PowerShell. Although Azure PowerShell cannot resolve it completely, we introduce techniques across modules of Azure PowerShell to mitigate this problem. The idea come from [Resolving PowerShell Module Assembly Dependency Conflicts](https://devblogs.microsoft.com/powershell/resolving-powershell-module-assembly-dependency-conflicts/)
55

6-
To minimize conflicts among modules, shared assemblies are loaded by Az.Accounts during being imported. All assemblies should be referenced by `Common.Netcore.Dependencies.targets` and stored under `src/lib/NetFxPreloadAssemblies` or `src/lib/NetCorePreloadAssemblies` according to target framework.
6+
To minimize conflicts among modules, shared assemblies are loaded by Az.Accounts during being imported. All assemblies should be referenced by `Common.Netcore.Dependencies.targets` and stored under `src/lib/{framework}/` according to target framework.
77

8-
## PowerShell 7+ with .Net 5/.Net 6
9-
Since .NET Core and above cannot load 2 different versions of one assembly into the same load context. `Az.Accounts` creates separate assembly load context during initialization and loads all shared assemblies into it. We selected shared assemblies according to their popularity, such as Microsoft Authentication Library(MSAL), `Azure.Core`, and `Azure.Identity`.
8+
## PowerShell 7+ with .NET 5+
9+
Since .NET Core and .NET 5+ cannot load 2 different versions of one assembly into the same assembly load context. `Az.Accounts` creates a dedicated context during initialization to load all the **shared** assemblies. We select shared assemblies according to their popularity, such as [Microsoft Authentication Library (MSAL.NET)](https://www.nuget.org/packages/Microsoft.Identity.Client/), [`Azure.Core`](https://www.nuget.org/packages/Azure.Core), and [`Azure.Identity`](https://www.nuget.org/packages/Azure.Identity).
1010

11-
Service module of Azure PowerShell also can create its assembly load context when it must depend on a assembly with different version from other modules. The page [How to define AssemblyLoadContext for module](/src/Accounts/AuthenticationAssemblyLoadContext) provides a comprehensive sample used by `Az.Compute`.
11+
Service modules of Azure PowerShell also can create their own assembly load context when they must depend on an assembly of different version from other modules. The page [How to define AssemblyLoadContext for module](/src/Accounts/AuthenticationAssemblyLoadContext) provides a comprehensive sample used by `Az.Compute`.
1212

1313
## Windows PowerShell with .NET Framework
14-
The major problem on Windows PowerShell is required assembly may not be offered by Windows PowerShell or .NET Framework. `Az.Accounts` registers a handler in `CustomAssemblyResolver` to handle event that required assembly could not be resolved. It means target assembly cannot be found from the probing path of .NET Framework or Windows PowerShell. Then, resolver compares expected version and loads target from directory `/PreloadAssemblies` (`src/lib/NetCorePreloadAssemblies`) in `Az.Accounts` if major version is the same. Here, we assume there is no breaking change across minor or patch versions, but it cannot be guaranteed.
14+
The major problem on Windows PowerShell is required assembly may not be offered by Windows PowerShell or .NET Framework. `Az.Accounts` registers a handler in `CustomAssemblyResolver` to handle event that required assembly could not be resolved. It means target assembly cannot be found from the probing path of .NET Framework or Windows PowerShell. Then, resolver compares expected version and loads target from directory `/lib` in `Az.Accounts` (`src/lib/` in source code) if major version is the same. Here, we assume there is no breaking change across minor or patch versions, but it cannot be guaranteed.
1515

1616
For further reading, please visit https://docs.microsoft.com/en-us/dotnet/standard/assembly/resolve-loads#how-the-assemblyresolve-event-works
1717

18-
1918
## Example: How to upgrade `Azure.Core`
20-
`Azure.Core` is common library used by management plane and data plane SDKs. Below are steps to upgrade its version.
19+
`Azure.Core` is a common library used by management plane and data plane track 2 SDKs. Below are the steps to upgrade its version.
2120
1. Navigate to [Common.Netcore.Dependencies.targets](/tools/Common.Netcore.Dependencies.targets) to check current version of `Azure.Core` used by latest code and bump version to expected.
22-
2. Compare dependencies of `Azure.Core` on [nuget.org](https://www.nuget.org/packages/Azure.Core/) between current version and expected version.
23-
3. Extract DLL file in nuget package folder `lib/netcoreapp2.1` of `Azure.Core` and changed dependencies and copy them to `src/lib/NetCorePreloadAssemblies`. You need to ensure the version CANNOT be higher than existing assembly if PowerShell already includes it.
24-
4. Update assembly version of `Azure.Core` and changed dependencies to .NET Stardard 2.0 in `/src/Accounts/AuthenticationAssemblyLoadContext/AzAssemblyLoadContextInitializer.cs`.
25-
5. Extract DLL file in nuget package folder `lib/net461` (alternatively, `netstandard2.0`) of `Azure.Core` and changed dependencies and copy them to `src/lib/NetFxPreloadAssemblies`. As one of dependencies, `Microsoft.Identity.Client` needs its net461 version because of known issue with certificates.
26-
6. Update assembly version of `Azure.Core` and changed dependencies to .NET Framework in `/src/Accounts/Authentication/Utilities/CustomAssemblyResolver.cs`.
27-
7. Verify built `Az.Accounts` can work with existing Azure PowerShell modules on PowerShell 7 and Windows PowerShell.
21+
2. Compare dependencies of `Azure.Core` on [nuget.org](https://www.nuget.org/packages/Azure.Core/) between current version and expected version, including the dependencies of the dependencies. Identify which of the dependencies are updated or newly introduced.
22+
1. You need to ensure the version CANNOT be higher than existing assembly if PowerShell already includes it.
23+
3. For each updated assembly (including `Azure.Core`)
24+
1. Look for it in `src/Accounts/AssemblyLoading/ConditionalAssemblyProvider.cs`. Note down its target framework. It should be one of "netcoreapp*", "netstandard*" and "netfx" (stand for ".NET framework").
25+
2. Download the nuget package from nuget.org, decompress it, find the DLL with the correct framework in `lib/{framework}` and replace the one in `src/lib/{framework}` with it.
26+
3. Update `src/Accounts/AssemblyLoading/ConditionalAssemblyProvider.cs` with the new assembly version. To get the version, open the DLL file with [ILSpy](https://github.com/icsharpcode/ILSpy).
27+
4. For each newly introduced assembly
28+
1. Download the nuget package. Decompress it.
29+
2. Find the assembly with desired target framework. In most cases we should choose "netstandard*" (* <= 2.0).
30+
- As an exception, `Microsoft.Identity.Client` needs its net461 version because of known issue with certificates.
31+
3. Copy the assembly to `src/lib/{framework}`.
32+
4. Update `src/Accounts/AssemblyLoading/ConditionalAssemblyProvider.cs` with the new assembly. To get the assembly version, open the DLL file with [ILSpy](https://github.com/icsharpcode/ILSpy).
33+
5. Verify built `Az.Accounts` can work with existing Azure PowerShell modules on PowerShell 7 and Windows PowerShell.
2834
- Import module into PowerShell 7 or Windows PowerShell, and ensure there is no error in verbose output
2935
```powershell
3036
$VerbosePreference = "Continue"
@@ -40,7 +46,7 @@ For further reading, please visit https://docs.microsoft.com/en-us/dotnet/standa
4046
(Invoke-WebRequest -Uri "https://raw.githubusercontent.com/Azure/azure-powershell/main/tools/Test/SmokeTest/RmCoreSmokeTests.ps1").Content | Invoke-Expression
4147
```
4248
43-
Please note `Azure.Core` **CANNOT** be upgraded till the next Az major release if above test is failed.
49+
Please note `Azure.Core` **CANNOT** be upgraded till the next Az major release if above test is failed.
4450
4551
## FAQ
4652
### How to list all loaded assemblies in PowerShell session?
@@ -50,7 +56,7 @@ Below script can be used to list all loaded assemblies when modules are imported
5056
```
5157

5258
### How to check version and target framework of assembly?
53-
We recommend [ILSpy](https://github.com/icsharpcode/ILSpy).
59+
We recommend [ILSpy](https://github.com/icsharpcode/ILSpy).
5460

5561
### How to get detailed information for assembly binds?
5662
PowerShell normally shows brief information when required assembly cannot be found or loaded. Assembly Binding Log Viewer can help to display details. This tool is installed with Visual Studio together. You need to run `Visual Studio Developer PowerShell` with administrator privileges and execute `fuslogvw` to invoke this tool.

setup/generate.ps1

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ if( (-not (get-command -ea 0 light)) -or (-not (get-command -ea 0 heat)) -or (-n
3737
$outputName ="Az-Cmdlets"
3838

3939
# generate the product name from the current month/year.
40-
$productName = "Microsoft Azure PowerShell - December 2022"
40+
$productName = "Microsoft Azure PowerShell - January 2023"
4141

4242
# where to put temp files
4343
$tmp = Join-Path $env:temp azure-cmdlets-tmp

src/Accounts/Accounts/Az.Accounts.psd1

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
#
44
# Generated by: Microsoft Corporation
55
#
6-
# Generated on: 01/12/2022
6+
# Generated on: 1/6/2023
77
#
88

99
@{
@@ -12,7 +12,7 @@
1212
# RootModule = ''
1313

1414
# Version number of this module.
15-
ModuleVersion = '2.10.4'
15+
ModuleVersion = '2.11.0'
1616

1717
# Supported PSEditions
1818
CompatiblePSEditions = 'Core', 'Desktop'
@@ -56,7 +56,7 @@ DotNetFrameworkVersion = '4.7.2'
5656
# RequiredModules = @()
5757

5858
# Assemblies that must be loaded prior to importing this module
59-
RequiredAssemblies = 'Microsoft.Azure.PowerShell.AssemblyLoading.dll',
59+
RequiredAssemblies = 'Microsoft.Azure.PowerShell.AssemblyLoading.dll',
6060
'Microsoft.Azure.PowerShell.Authentication.Abstractions.dll',
6161
'Microsoft.Azure.PowerShell.Authentication.dll',
6262
'Microsoft.Azure.PowerShell.Authenticators.dll',
@@ -147,10 +147,11 @@ PrivateData = @{
147147
# IconUri = ''
148148

149149
# ReleaseNotes of this module
150-
ReleaseNotes = '* Enabled caching tokens when logging in with a client assertion. This fixed the incorrectly short lifespan of tokens.
151-
* Upgraded target framework of Microsoft.Identity.Client to net461 [#20189]
152-
* Stored ''ServicePrincipalSecret'' and ''CertificatePassword'' into ''AzKeyStore''.
153-
* Updated the reference of Azure PowerShell Common to 1.3.67-preview.'
150+
ReleaseNotes = '* Supported Web Account Manager (WAM) as an opt-in interactive login experience. Enable it by ''Update-AzConfig -EnableLoginByWam True''.
151+
* Optimized the mechanism for assembly loading.
152+
* Enabled AzKeyStore with keyring in Linux.
153+
* Fixed a typo in GetAzureRmContextAutosaveSetting.cs changing the cmdlet class name to GetAzureRmContextAutosaveSetting
154+
* Removed survey on error message in ''Resolve-AzError''. [#20398]'
154155

155156
# Prerelease string of this module
156157
# Prerelease = ''

src/Accounts/Accounts/ChangeLog.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,9 @@
1919
-->
2020

2121
## Upcoming Release
22+
23+
## Version 2.11.0
24+
* Supported Web Account Manager (WAM) as an opt-in interactive login experience. Enable it by `Update-AzConfig -EnableLoginByWam $true`.
2225
* Optimized the mechanism for assembly loading.
2326
* Enabled AzKeyStore with keyring in Linux.
2427
* Fixed a typo in GetAzureRmContextAutosaveSetting.cs changing the cmdlet class name to GetAzureRmContextAutosaveSetting

0 commit comments

Comments
 (0)