Skip to content

Commit

Permalink
Migrate tasks from deprecated AzureRM powershell functions to AZ powe…
Browse files Browse the repository at this point in the history
…rshell 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
  • Loading branch information
DmitriiBobreshev authored Apr 23, 2024
1 parent f963d4b commit 36174ec
Show file tree
Hide file tree
Showing 95 changed files with 606 additions and 265 deletions.
2 changes: 1 addition & 1 deletion Tasks/AzureCloudPowerShellDeploymentV1/task.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
"version": {
"Major": 1,
"Minor": 239,
"Patch": 0
"Patch": 1
},
"demands": [
"azureps"
Expand Down
2 changes: 1 addition & 1 deletion Tasks/AzureCloudPowerShellDeploymentV1/task.loc.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
"version": {
"Major": 1,
"Minor": 239,
"Patch": 0
"Patch": 1
},
"demands": [
"azureps"
Expand Down
2 changes: 1 addition & 1 deletion Tasks/AzureCloudPowerShellDeploymentV2/task.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
"version": {
"Major": 2,
"Minor": 239,
"Patch": 0
"Patch": 1
},
"demands": [
"azureps"
Expand Down
2 changes: 1 addition & 1 deletion Tasks/AzureCloudPowerShellDeploymentV2/task.loc.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
"version": {
"Major": 2,
"Minor": 239,
"Patch": 0
"Patch": 1
},
"demands": [
"azureps"
Expand Down
2 changes: 1 addition & 1 deletion Tasks/AzureFileCopyV1/task.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
"version": {
"Major": 1,
"Minor": 239,
"Patch": 0
"Patch": 1
},
"demands": [
"azureps"
Expand Down
2 changes: 1 addition & 1 deletion Tasks/AzureFileCopyV1/task.loc.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
"version": {
"Major": 1,
"Minor": 239,
"Patch": 0
"Patch": 1
},
"demands": [
"azureps"
Expand Down
2 changes: 1 addition & 1 deletion Tasks/AzureFileCopyV2/task.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
"version": {
"Major": 2,
"Minor": 239,
"Patch": 0
"Patch": 2
},
"demands": [
"azureps"
Expand Down
2 changes: 1 addition & 1 deletion Tasks/AzureFileCopyV2/task.loc.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
"version": {
"Major": 2,
"Minor": 239,
"Patch": 0
"Patch": 2
},
"demands": [
"azureps"
Expand Down
11 changes: 10 additions & 1 deletion Tasks/AzureFileCopyV3/Tests/L0GetAzureUtility.ps1
Original file line number Diff line number Diff line change
@@ -1,6 +1,11 @@
[CmdletBinding()]
param()

$featureFlags = @{
retireAzureRM = [System.Convert]::ToBoolean($env:RETIRE_AZURERM_POWERSHELL_MODULE)
}


. $PSScriptRoot\..\..\..\Tests\lib\Initialize-Test.ps1

$azModule100 = New-Object -TypeName System.Version -ArgumentList "1.0.0"
Expand All @@ -19,4 +24,8 @@ Assert-AreEqual $azureUtilityFile "AzureUtilityAz1.0.ps1"
Unregister-Mock Get-Module
Register-Mock Get-Module { return }
$azureUtilityFile = Get-AzureUtility -connectedServiceName $connectedServiceName
Assert-AreEqual $azureUtilityFile "AzureUtilityARM.ps1"
if ($featureFlags.retireAzureRM) {
Assert-AreEqual $azureUtilityFile "AzureUtilityAz1.0.ps1"
} else {
Assert-AreEqual $azureUtilityFile "AzureUtilityARM.ps1"
}
2 changes: 1 addition & 1 deletion Tasks/AzureFileCopyV3/task.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
"version": {
"Major": 3,
"Minor": 239,
"Patch": 0
"Patch": 2
},
"demands": [
"azureps"
Expand Down
2 changes: 1 addition & 1 deletion Tasks/AzureFileCopyV3/task.loc.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
"version": {
"Major": 3,
"Minor": 239,
"Patch": 0
"Patch": 2
},
"demands": [
"azureps"
Expand Down
6 changes: 5 additions & 1 deletion Tasks/AzureFileCopyV4/Tests/L0GetAzureUtility.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -19,4 +19,8 @@ Assert-AreEqual $azureUtilityFile "AzureUtilityAz1.0.ps1"
Unregister-Mock Get-Module
Register-Mock Get-Module { return }
$azureUtilityFile = Get-AzureUtility -connectedServiceName $connectedServiceName
Assert-AreEqual $azureUtilityFile "AzureUtilityARM.ps1"
if ($featureFlags.retireAzureRM) {
Assert-AreEqual $azureUtilityFile "AzureUtilityAz1.0.ps1"
} else {
Assert-AreEqual $azureUtilityFile "AzureUtilityARM.ps1"
}
2 changes: 1 addition & 1 deletion Tasks/AzureFileCopyV4/task.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
"version": {
"Major": 4,
"Minor": 239,
"Patch": 0
"Patch": 2
},
"demands": [
"azureps"
Expand Down
2 changes: 1 addition & 1 deletion Tasks/AzureFileCopyV4/task.loc.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
"version": {
"Major": 4,
"Minor": 239,
"Patch": 0
"Patch": 2
},
"demands": [
"azureps"
Expand Down
6 changes: 5 additions & 1 deletion Tasks/AzureFileCopyV5/Tests/L0GetAzureUtility.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -19,4 +19,8 @@ Assert-AreEqual $azureUtilityFile "AzureUtilityAz1.0.ps1"
Unregister-Mock Get-Module
Register-Mock Get-Module { return }
$azureUtilityFile = Get-AzureUtility -connectedServiceName $connectedServiceName
Assert-AreEqual $azureUtilityFile "AzureUtilityARM.ps1"
if ($featureFlags.retireAzureRM) {
Assert-AreEqual $azureUtilityFile "AzureUtilityAz1.0.ps1"
} else {
Assert-AreEqual $azureUtilityFile "AzureUtilityARM.ps1"
}
2 changes: 1 addition & 1 deletion Tasks/AzureFileCopyV5/task.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
"version": {
"Major": 5,
"Minor": 239,
"Patch": 0
"Patch": 2
},
"demands": [
"azureps"
Expand Down
2 changes: 1 addition & 1 deletion Tasks/AzureFileCopyV5/task.loc.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
"version": {
"Major": 5,
"Minor": 239,
"Patch": 0
"Patch": 2
},
"demands": [
"azureps"
Expand Down
6 changes: 5 additions & 1 deletion Tasks/AzureFileCopyV6/Tests/L0GetAzureUtility.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -19,4 +19,8 @@ Assert-AreEqual $azureUtilityFile "AzureUtilityAz1.0.ps1"
Unregister-Mock Get-Module
Register-Mock Get-Module { return }
$azureUtilityFile = Get-AzureUtility -connectedServiceName $connectedServiceName
Assert-AreEqual $azureUtilityFile "AzureUtilityARM.ps1"
if ($featureFlags.retireAzureRM) {
Assert-AreEqual $azureUtilityFile "AzureUtilityAz1.0.ps1"
} else {
Assert-AreEqual $azureUtilityFile "AzureUtilityARM.ps1"
}
2 changes: 1 addition & 1 deletion Tasks/AzureFileCopyV6/task.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
"version": {
"Major": 6,
"Minor": 239,
"Patch": 0
"Patch": 2
},
"demands": [
"azureps"
Expand Down
2 changes: 1 addition & 1 deletion Tasks/AzureFileCopyV6/task.loc.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
"version": {
"Major": 6,
"Minor": 239,
"Patch": 0
"Patch": 2
},
"demands": [
"azureps"
Expand Down
2 changes: 1 addition & 1 deletion Tasks/AzurePowerShellV2/task.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
"version": {
"Major": 2,
"Minor": 239,
"Patch": 0
"Patch": 1
},
"demands": [
"azureps"
Expand Down
2 changes: 1 addition & 1 deletion Tasks/AzurePowerShellV2/task.loc.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
"version": {
"Major": 2,
"Minor": 239,
"Patch": 0
"Patch": 1
},
"demands": [
"azureps"
Expand Down
2 changes: 1 addition & 1 deletion Tasks/AzurePowerShellV3/task.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
"version": {
"Major": 3,
"Minor": 239,
"Patch": 0
"Patch": 1
},
"releaseNotes": "Added support for Fail on standard error and ErrorActionPreference",
"demands": [
Expand Down
2 changes: 1 addition & 1 deletion Tasks/AzurePowerShellV3/task.loc.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
"version": {
"Major": 3,
"Minor": 239,
"Patch": 0
"Patch": 1
},
"releaseNotes": "ms-resource:loc.releaseNotes",
"demands": [
Expand Down
2 changes: 1 addition & 1 deletion Tasks/AzurePowerShellV4/task.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
"version": {
"Major": 4,
"Minor": 239,
"Patch": 0
"Patch": 2
},
"releaseNotes": "Added support for Az Module and cross platform agents.",
"groups": [
Expand Down
2 changes: 1 addition & 1 deletion Tasks/AzurePowerShellV4/task.loc.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
"version": {
"Major": 4,
"Minor": 239,
"Patch": 0
"Patch": 2
},
"releaseNotes": "ms-resource:loc.releaseNotes",
"groups": [
Expand Down
2 changes: 1 addition & 1 deletion Tasks/AzurePowerShellV5/task.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
"version": {
"Major": 5,
"Minor": 239,
"Patch": 0
"Patch": 2
},
"releaseNotes": "Added support for Az Module and cross platform agents.",
"groups": [
Expand Down
2 changes: 1 addition & 1 deletion Tasks/AzurePowerShellV5/task.loc.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
"version": {
"Major": 5,
"Minor": 239,
"Patch": 0
"Patch": 2
},
"releaseNotes": "ms-resource:loc.releaseNotes",
"groups": [
Expand Down
Loading

0 comments on commit 36174ec

Please sign in to comment.