Skip to content

Commit 36174ec

Browse files
Migrate tasks from deprecated AzureRM powershell functions to AZ powershell functions (#19801)
* Migrate tasks from deprecated AzureRM powershell functions to AZ powershell functions - Try to use current az, otherwise fallback to installation * Migrate tasks from deprecated AzureRM powershell functions to AZ powershell functions - Bump tasks versions * Migrate tasks from deprecated AzureRM powershell functions to AZ powershell functions - Fixed Tests * Migrate tasks from deprecated AzureRM powershell functions to AZ powershell functions - Fixed package's unit-tests * Migrate tasks from deprecated AzureRM powershell functions to AZ powershell functions - Fixed package's unit-tests * Migrate tasks from deprecated AzureRM powershell functions to AZ powershell functions - code review changes
1 parent f963d4b commit 36174ec

File tree

95 files changed

+606
-265
lines changed

Some content is hidden

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

95 files changed

+606
-265
lines changed

Tasks/AzureCloudPowerShellDeploymentV1/task.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
"version": {
1818
"Major": 1,
1919
"Minor": 239,
20-
"Patch": 0
20+
"Patch": 1
2121
},
2222
"demands": [
2323
"azureps"

Tasks/AzureCloudPowerShellDeploymentV1/task.loc.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
"version": {
1818
"Major": 1,
1919
"Minor": 239,
20-
"Patch": 0
20+
"Patch": 1
2121
},
2222
"demands": [
2323
"azureps"

Tasks/AzureCloudPowerShellDeploymentV2/task.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
"version": {
1818
"Major": 2,
1919
"Minor": 239,
20-
"Patch": 0
20+
"Patch": 1
2121
},
2222
"demands": [
2323
"azureps"

Tasks/AzureCloudPowerShellDeploymentV2/task.loc.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
"version": {
1818
"Major": 2,
1919
"Minor": 239,
20-
"Patch": 0
20+
"Patch": 1
2121
},
2222
"demands": [
2323
"azureps"

Tasks/AzureFileCopyV1/task.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
"version": {
1515
"Major": 1,
1616
"Minor": 239,
17-
"Patch": 0
17+
"Patch": 1
1818
},
1919
"demands": [
2020
"azureps"

Tasks/AzureFileCopyV1/task.loc.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
"version": {
1515
"Major": 1,
1616
"Minor": 239,
17-
"Patch": 0
17+
"Patch": 1
1818
},
1919
"demands": [
2020
"azureps"

Tasks/AzureFileCopyV2/task.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
"version": {
1515
"Major": 2,
1616
"Minor": 239,
17-
"Patch": 0
17+
"Patch": 2
1818
},
1919
"demands": [
2020
"azureps"

Tasks/AzureFileCopyV2/task.loc.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
"version": {
1515
"Major": 2,
1616
"Minor": 239,
17-
"Patch": 0
17+
"Patch": 2
1818
},
1919
"demands": [
2020
"azureps"

Tasks/AzureFileCopyV3/Tests/L0GetAzureUtility.ps1

+10-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,11 @@
11
[CmdletBinding()]
22
param()
33

4+
$featureFlags = @{
5+
retireAzureRM = [System.Convert]::ToBoolean($env:RETIRE_AZURERM_POWERSHELL_MODULE)
6+
}
7+
8+
49
. $PSScriptRoot\..\..\..\Tests\lib\Initialize-Test.ps1
510

611
$azModule100 = New-Object -TypeName System.Version -ArgumentList "1.0.0"
@@ -19,4 +24,8 @@ Assert-AreEqual $azureUtilityFile "AzureUtilityAz1.0.ps1"
1924
Unregister-Mock Get-Module
2025
Register-Mock Get-Module { return }
2126
$azureUtilityFile = Get-AzureUtility -connectedServiceName $connectedServiceName
22-
Assert-AreEqual $azureUtilityFile "AzureUtilityARM.ps1"
27+
if ($featureFlags.retireAzureRM) {
28+
Assert-AreEqual $azureUtilityFile "AzureUtilityAz1.0.ps1"
29+
} else {
30+
Assert-AreEqual $azureUtilityFile "AzureUtilityARM.ps1"
31+
}

Tasks/AzureFileCopyV3/task.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
"version": {
1515
"Major": 3,
1616
"Minor": 239,
17-
"Patch": 0
17+
"Patch": 2
1818
},
1919
"demands": [
2020
"azureps"

Tasks/AzureFileCopyV3/task.loc.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
"version": {
1515
"Major": 3,
1616
"Minor": 239,
17-
"Patch": 0
17+
"Patch": 2
1818
},
1919
"demands": [
2020
"azureps"

Tasks/AzureFileCopyV4/Tests/L0GetAzureUtility.ps1

+5-1
Original file line numberDiff line numberDiff line change
@@ -19,4 +19,8 @@ Assert-AreEqual $azureUtilityFile "AzureUtilityAz1.0.ps1"
1919
Unregister-Mock Get-Module
2020
Register-Mock Get-Module { return }
2121
$azureUtilityFile = Get-AzureUtility -connectedServiceName $connectedServiceName
22-
Assert-AreEqual $azureUtilityFile "AzureUtilityARM.ps1"
22+
if ($featureFlags.retireAzureRM) {
23+
Assert-AreEqual $azureUtilityFile "AzureUtilityAz1.0.ps1"
24+
} else {
25+
Assert-AreEqual $azureUtilityFile "AzureUtilityARM.ps1"
26+
}

Tasks/AzureFileCopyV4/task.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
"version": {
1515
"Major": 4,
1616
"Minor": 239,
17-
"Patch": 0
17+
"Patch": 2
1818
},
1919
"demands": [
2020
"azureps"

Tasks/AzureFileCopyV4/task.loc.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
"version": {
1515
"Major": 4,
1616
"Minor": 239,
17-
"Patch": 0
17+
"Patch": 2
1818
},
1919
"demands": [
2020
"azureps"

Tasks/AzureFileCopyV5/Tests/L0GetAzureUtility.ps1

+5-1
Original file line numberDiff line numberDiff line change
@@ -19,4 +19,8 @@ Assert-AreEqual $azureUtilityFile "AzureUtilityAz1.0.ps1"
1919
Unregister-Mock Get-Module
2020
Register-Mock Get-Module { return }
2121
$azureUtilityFile = Get-AzureUtility -connectedServiceName $connectedServiceName
22-
Assert-AreEqual $azureUtilityFile "AzureUtilityARM.ps1"
22+
if ($featureFlags.retireAzureRM) {
23+
Assert-AreEqual $azureUtilityFile "AzureUtilityAz1.0.ps1"
24+
} else {
25+
Assert-AreEqual $azureUtilityFile "AzureUtilityARM.ps1"
26+
}

Tasks/AzureFileCopyV5/task.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
"version": {
1515
"Major": 5,
1616
"Minor": 239,
17-
"Patch": 0
17+
"Patch": 2
1818
},
1919
"demands": [
2020
"azureps"

Tasks/AzureFileCopyV5/task.loc.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
"version": {
1515
"Major": 5,
1616
"Minor": 239,
17-
"Patch": 0
17+
"Patch": 2
1818
},
1919
"demands": [
2020
"azureps"

Tasks/AzureFileCopyV6/Tests/L0GetAzureUtility.ps1

+5-1
Original file line numberDiff line numberDiff line change
@@ -19,4 +19,8 @@ Assert-AreEqual $azureUtilityFile "AzureUtilityAz1.0.ps1"
1919
Unregister-Mock Get-Module
2020
Register-Mock Get-Module { return }
2121
$azureUtilityFile = Get-AzureUtility -connectedServiceName $connectedServiceName
22-
Assert-AreEqual $azureUtilityFile "AzureUtilityARM.ps1"
22+
if ($featureFlags.retireAzureRM) {
23+
Assert-AreEqual $azureUtilityFile "AzureUtilityAz1.0.ps1"
24+
} else {
25+
Assert-AreEqual $azureUtilityFile "AzureUtilityARM.ps1"
26+
}

Tasks/AzureFileCopyV6/task.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
"version": {
1515
"Major": 6,
1616
"Minor": 239,
17-
"Patch": 0
17+
"Patch": 2
1818
},
1919
"demands": [
2020
"azureps"

Tasks/AzureFileCopyV6/task.loc.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
"version": {
1515
"Major": 6,
1616
"Minor": 239,
17-
"Patch": 0
17+
"Patch": 2
1818
},
1919
"demands": [
2020
"azureps"

Tasks/AzurePowerShellV2/task.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
"version": {
1919
"Major": 2,
2020
"Minor": 239,
21-
"Patch": 0
21+
"Patch": 1
2222
},
2323
"demands": [
2424
"azureps"

Tasks/AzurePowerShellV2/task.loc.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
"version": {
1919
"Major": 2,
2020
"Minor": 239,
21-
"Patch": 0
21+
"Patch": 1
2222
},
2323
"demands": [
2424
"azureps"

Tasks/AzurePowerShellV3/task.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
"version": {
1919
"Major": 3,
2020
"Minor": 239,
21-
"Patch": 0
21+
"Patch": 1
2222
},
2323
"releaseNotes": "Added support for Fail on standard error and ErrorActionPreference",
2424
"demands": [

Tasks/AzurePowerShellV3/task.loc.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
"version": {
1919
"Major": 3,
2020
"Minor": 239,
21-
"Patch": 0
21+
"Patch": 1
2222
},
2323
"releaseNotes": "ms-resource:loc.releaseNotes",
2424
"demands": [

Tasks/AzurePowerShellV4/task.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
"version": {
1919
"Major": 4,
2020
"Minor": 239,
21-
"Patch": 0
21+
"Patch": 2
2222
},
2323
"releaseNotes": "Added support for Az Module and cross platform agents.",
2424
"groups": [

Tasks/AzurePowerShellV4/task.loc.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
"version": {
1919
"Major": 4,
2020
"Minor": 239,
21-
"Patch": 0
21+
"Patch": 2
2222
},
2323
"releaseNotes": "ms-resource:loc.releaseNotes",
2424
"groups": [

Tasks/AzurePowerShellV5/task.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
"version": {
1919
"Major": 5,
2020
"Minor": 239,
21-
"Patch": 0
21+
"Patch": 2
2222
},
2323
"releaseNotes": "Added support for Az Module and cross platform agents.",
2424
"groups": [

Tasks/AzurePowerShellV5/task.loc.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
"version": {
1919
"Major": 5,
2020
"Minor": 239,
21-
"Patch": 0
21+
"Patch": 2
2222
},
2323
"releaseNotes": "ms-resource:loc.releaseNotes",
2424
"groups": [

0 commit comments

Comments
 (0)