Skip to content

Commit efc2ae3

Browse files
doomkitDmitrii Bobreshev (Akvelon INC)
and
Dmitrii Bobreshev (Akvelon INC)
authored
AzureRM Common Module migration (#19536)
* Refactor `retireAzureRM` FF switches in Common module * Update Common module usage * Bump tasks versions * Add generated builds * Update buildConfigs * Uninstall AzureRM modules * Refactor uninstalling AzureRM modules * Add try/catch around module uninstall * Refactor AzureRM modules uninstall * Refactor Azure Initialize logic in tasks * Install Az.Account if not found * Fix invalid condition for 'Failed to import Az.Account module' error * Refactor Initialize-AzModule AzureCopyFileV4 * Refactor `Import-AzAccountsModule` in VstsAzureHelpres * Add check for AzureRM modules after uninstall * Refactor `Initialize-Az` in tasks * Add builds * Fix 'failed to install Az.Accounts' check * Update 'Get-AzureUtility' methods * Add builds * Add `[version]` type casting to Install-Module command * Add AzureFileVopyV3 build * Add `[Version]` type cast to `azAccountsModuleVersion` parameter * - Remove AzureRM before installing Az - Fix [version] type casting * Add try/catch around AzureRM module uninstallation * Add Az.Accounts module version logging * Remove [version] type casting * Refactor `Import-AzAccountsModule` * Trying to take first element of Import-Module return value to fix `Cannot convert the "System.Object[]" to type "System.Version"` error * Create version object explicitly * Fix missing import * Refactoring AzureRM uninstall * Refactor AzureRM uninstall * Fix missing `Set-CurrentAzureRMSubscription` to `Set-CurrentAzSubscription` switch * Refactor 'InitializeFunctions' * Refactor negation FF condition * Add `Import-SpecificAzModule` function az an alternative to `Import-AzAccountsModule` * Revert `Import-AzAccountsModule` changes * Revert generated builds * Revert tasks version bumps * Rename `DiscoverAvailableAzureModules` to `Get-AvailableAzureModules` * Bump tasks version * Add generated builds * Refactor Az module install * Fix: remove module return * Fix: 'Cannot process argument transformation on parameter' error * Fix: 'Cannot process argument transformation on parameter' error * Fix: 'Cannot process argument transformation on parameter' error * Fix: 'Cannot process argument transformation on parameter' error * Add `Az.Storage` import (required by AzureFileCopyV2-3) * Bump AzurePowerShell tasks versions * Add AzurePowerShell tasks builds * Refactor Uninstall-AzureRMModules * Fix invalid param name * Add validation before uninstalling AzureRM module * Fix unknown `-gt` parameter * Add try/catch around AzureRM modules uninstall * Prevent 'AzureRm' modules from loading * Use 'Az.Accounts' to uninstall AzureRM * Add try/catch for invalid version installation * Simplify Import-SpecificAzModule function * Bump tasks versions * Fix module installation * Use installed PS modules * Bump tasks versions * Add suppression file for PSScriptAnalyzer * Bump AzurePowerShellV5 task * Move ".gdnsuppress" file to ".gdn" folder * WIP: AzureRM Common Module migration #19536 - add sigranute to baseline file * Remove `.gdnsuppress` file - should use `.gdnbaselines` instead * Add PSScriptAnalyzer exceptions * Bump tasks * Bump AzureFileCopyV2 taks version * Bump AzureFileCopyV3-5 tasks version --------- Co-authored-by: Dmitrii Bobreshev (Akvelon INC) <[email protected]>
1 parent f8d35bd commit efc2ae3

File tree

89 files changed

+6790
-4724
lines changed

Some content is hidden

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

89 files changed

+6790
-4724
lines changed

.gdn/.gdnbaselines

+65
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,71 @@
1313
}
1414
},
1515
"results": {
16+
"a2a4017726eb18c7612da6ab3828cfdfd1218160fbd5d373c715476df1847499": {
17+
"signature": "a2a4017726eb18c7612da6ab3828cfdfd1218160fbd5d373c715476df1847499",
18+
"alternativeSignatures": [
19+
"0742c8968835510ce413346da03c51d96319152e424445409e8338aeb9fc1840"
20+
],
21+
"memberOf": [
22+
"default"
23+
],
24+
"createdDate": "2024-03-11 11:59:39Z",
25+
"justification": "Unable to remove -AsPlainText param from ConvertTo-SecureString method"
26+
},
27+
"090e1c6e9eea6f7f9683f554e11fca742dc2c836a9ec0b4bba6585507b844948": {
28+
"signature": "090e1c6e9eea6f7f9683f554e11fca742dc2c836a9ec0b4bba6585507b844948",
29+
"alternativeSignatures": [
30+
"b3077fce06e27ed54f49f4f5433d412f3f785fd6f26bc2d2a3fb009fc31fdb4a"
31+
],
32+
"memberOf": [
33+
"default"
34+
],
35+
"createdDate": "2024-03-11 11:59:39Z",
36+
"justification": "Unable to remove -AsPlainText param from ConvertTo-SecureString method"
37+
},
38+
"55e38dd157a1c41723a4c18ced54445089efe986f2103d3210c65357952b5462": {
39+
"signature": "55e38dd157a1c41723a4c18ced54445089efe986f2103d3210c65357952b5462",
40+
"alternativeSignatures": [
41+
"bdee2be7b96a489a528869a2f96eecada6d0bc6ade922be945dd8f0af9925734"
42+
],
43+
"memberOf": [
44+
"default"
45+
],
46+
"createdDate": "2024-03-11 11:59:39Z",
47+
"justification": "Unable to remove -AsPlainText param from ConvertTo-SecureString method"
48+
},
49+
"45a7c482a16da19bf9fa3c9de785faa5978746e382784f54275d9e53b45d5e33": {
50+
"signature": "45a7c482a16da19bf9fa3c9de785faa5978746e382784f54275d9e53b45d5e33",
51+
"alternativeSignatures": [
52+
"e3c6edbc658ecaf0249a79c22b27b52735696a56ed92e715a04eb0430ed03c13"
53+
],
54+
"memberOf": [
55+
"default"
56+
],
57+
"createdDate": "2024-03-11 11:59:39Z"
58+
},
59+
"a87bffe963d7c34726ad023b1690d55b6e844187346311c79d939e3aab932db4": {
60+
"signature": "a87bffe963d7c34726ad023b1690d55b6e844187346311c79d939e3aab932db4",
61+
"alternativeSignatures": [
62+
"1e170d51b900eaed0f341b5a2c5e4275e8f7a3bc21bf863b19b503bde34f5ecf"
63+
],
64+
"memberOf": [
65+
"default"
66+
],
67+
"createdDate": "2024-03-11 11:59:39Z",
68+
"justification": "Unable to remove -AsPlainText param from ConvertTo-SecureString method"
69+
},
70+
"5f8282717d3b2024249daf372400ed61161113c8605ea705dfb9bf7bfe72bc01": {
71+
"signature": "5f8282717d3b2024249daf372400ed61161113c8605ea705dfb9bf7bfe72bc01",
72+
"alternativeSignatures": [
73+
"912555a66fcf7f5d24035344f7b73e3fab4bce0d27095c40cecb19ce4bed9ed7"
74+
],
75+
"memberOf": [
76+
"default"
77+
],
78+
"createdDate": "2024-03-11 11:59:39Z",
79+
"justification": "Unable to remove -AsPlainText param from ConvertTo-SecureString method"
80+
},
1681
"7ae9f949e712a4855e8cdc176a7cb651b813e99d3613be7db583a910f5e3461e": {
1782
"signature": "7ae9f949e712a4855e8cdc176a7cb651b813e99d3613be7db583a910f5e3461e",
1883
"alternativeSignatures": [

Tasks/AzureCloudPowerShellDeploymentV1/Publish-AzureCloudDeployment.ps1

+9-1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
$featureFlags = @{
2+
retireAzureRM = [System.Convert]::ToBoolean($env:RETIRE_AZURERM_POWERSHELL_MODULE)
3+
}
4+
15
Trace-VstsEnteringInvocation $MyInvocation
26
Import-VstsLocStrings "$PSScriptRoot\Task.json"
37

@@ -32,7 +36,11 @@ try{
3236
if ($EnableAdvancedStorageOptions)
3337
{
3438
$endpoint = Get-VstsEndpoint -Name $ARMConnectedServiceName -Require
35-
Initialize-AzureRMModule -Endpoint $endpoint
39+
if ($featureFlags.retireAzureRM) {
40+
Initialize-AzModule -Endpoint $endpoint
41+
} else {
42+
Initialize-AzureRMModule -Endpoint $endpoint
43+
}
3644
}
3745

3846
# Load all dependent files for execution

Tasks/AzureCloudPowerShellDeploymentV1/task.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
"author": "Microsoft Corporation",
1717
"version": {
1818
"Major": 1,
19-
"Minor": 234,
19+
"Minor": 237,
2020
"Patch": 0
2121
},
2222
"demands": [

Tasks/AzureCloudPowerShellDeploymentV1/task.loc.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
"author": "Microsoft Corporation",
1717
"version": {
1818
"Major": 1,
19-
"Minor": 234,
19+
"Minor": 237,
2020
"Patch": 0
2121
},
2222
"demands": [

Tasks/AzureCloudPowerShellDeploymentV2/task.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
"author": "Microsoft Corporation",
1717
"version": {
1818
"Major": 2,
19-
"Minor": 234,
19+
"Minor": 237,
2020
"Patch": 0
2121
},
2222
"demands": [

Tasks/AzureCloudPowerShellDeploymentV2/task.loc.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
"author": "Microsoft Corporation",
1717
"version": {
1818
"Major": 2,
19-
"Minor": 234,
19+
"Minor": 237,
2020
"Patch": 0
2121
},
2222
"demands": [

Tasks/AzureFileCopyV1/task.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
"author": "Microsoft Corporation",
1414
"version": {
1515
"Major": 1,
16-
"Minor": 236,
16+
"Minor": 237,
1717
"Patch": 0
1818
},
1919
"demands": [

Tasks/AzureFileCopyV1/task.loc.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
"author": "Microsoft Corporation",
1414
"version": {
1515
"Major": 1,
16-
"Minor": 236,
16+
"Minor": 237,
1717
"Patch": 0
1818
},
1919
"demands": [

0 commit comments

Comments
 (0)