Remove Az module installs and AzureRM uninstalls in pipeline (#25118)

Co-authored-by: Justin Chung <chungjustin@microsoft.com>
This commit is contained in:
Justin Chung
2025-03-11 12:53:04 -07:00
committed by GitHub
co-authored by Justin Chung
parent b3297ff409
commit 4bc918ba5f
11 changed files with 3 additions and 118 deletions
+1 -1
View File
@@ -64,7 +64,7 @@ variables:
resources:
pipelines:
- pipeline: CoOrdinatedBuildPipeline
source: 'PowerShell-Coordinated Packages-Official'
source: 'PowerShell-Coordinated Binaries-Official'
trigger:
branches:
include:
@@ -56,7 +56,7 @@ resources:
pipelines:
- pipeline: CoOrdinatedBuildPipeline
source: 'PowerShell-Coordinated Packages-Official'
source: 'PowerShell-Coordinated Binaries-Official'
- pipeline: PSPackagesOfficial
source: 'PowerShell-Packages-Official'
+1 -1
View File
@@ -72,7 +72,7 @@ resources:
pipelines:
- pipeline: CoOrdinatedBuildPipeline
source: 'PowerShell-Coordinated Packages-Official'
source: 'PowerShell-Coordinated Binaries-Official'
- pipeline: PSPackagesOfficial
source: 'PowerShell-Packages-Official'
@@ -51,16 +51,6 @@ jobs:
}
displayName: 'Check suppress.json'
# Needed as per FAQ here: https://eng.ms/docs/products/onebranch/build/troubleshootingfaqs
- task: PowerShell@2
displayName: 'Update Az.Storage Module'
inputs:
targetType: 'inline'
script: |
Get-PackageProvider -Name NuGet -ForceBootstrap
Install-Module -Name Az.Storage -Verbose -Force -AllowClobber
Uninstall-AzureRm -Verbose
- task: AzurePowerShell@5
displayName: Check if blob exists and delete if specified
inputs:
@@ -78,19 +78,6 @@ jobs:
workingDirectory: '$(repoRoot)'
retryCountOnTaskFailure: 2
- pwsh: |
$modules = 'Az.Accounts', 'Az.Storage'
foreach($module in $modules) {
if(!(get-module $module -listavailable)) {
Write-Verbose "installing $module..." -verbose
Install-Module $module -force -AllowClobber
} else {
Write-Verbose "$module already installed." -verbose
}
}
displayName: Install PowerShell modules
workingDirectory: '$(repoRoot)'
- task: AzurePowerShell@5
displayName: Download winverify-private Artifacts
inputs:
@@ -95,29 +95,6 @@ jobs:
Get-PackageProvider -Name NuGet -ForceBootstrap
displayName: Initalize PowerShellGet
- powershell: |
$modules = 'Az.Accounts', 'Az.Storage'
foreach($module in $modules) {
if(!(get-module $module -listavailable)) {
Write-Verbose "installing $module..." -verbose
Install-Module $module -force -AllowClobber
} else {
Write-Verbose "$module already installed." -verbose
#Update-Module $module -verbose
}
}
displayName: Install PowerShell modules
- powershell: |
if(Get-Command -Name Uninstall-AzureRm -ErrorAction Ignore){
Write-Verbose "running Uninstall-AzureRm" -verbose
Uninstall-AzureRm
} else {
Write-Verbose "Uninstall-AzureRm not present" -verbose
}
displayName: Uninstall Uninstall-AzureRm
continueOnError: true
- task: AzurePowerShell@5
displayName: Upload Notice
inputs:
@@ -52,17 +52,6 @@ jobs:
Get-ChildItem Env:
displayName: 'Capture Environment Variables'
- pwsh: |
$azureRmModule = Get-InstalledModule AzureRM -ErrorAction SilentlyContinue -Verbose
if ($azureRmModule) {
Write-Host 'AzureRM module exists. Removing it'
Uninstall-AzureRm
Write-Host 'AzureRM module removed'
}
Install-Module -Name Az.Storage -Force -AllowClobber -Scope CurrentUser -Verbose
displayName: Remove AzRM modules
- task: AzurePowerShell@5
displayName: Copy blobs to PSInfra storage
inputs:
@@ -150,17 +139,6 @@ jobs:
Get-ChildItem Env: | Out-String -width 9999 -Stream | write-Verbose -Verbose
displayName: 'Capture Environment Variables'
- pwsh: |
$azureRmModule = Get-InstalledModule AzureRM -ErrorAction SilentlyContinue -Verbose
if ($azureRmModule) {
Write-Host 'AzureRM module exists. Removing it'
Uninstall-AzureRm
Write-Host 'AzureRM module removed'
}
Install-Module -Name Az.Storage -Force -AllowClobber -Scope CurrentUser -Verbose
displayName: Remove AzRM modules
- task: AzurePowerShell@5
displayName: Copy blobs to PSInfra storage
inputs:
@@ -27,18 +27,6 @@ jobs:
artifact: drop_windows_package_package_win_x86
displayName: Download x86 msix
patterns: '**/*.msix'
- pwsh: |
$azureRmModule = Get-InstalledModule AzureRM -ErrorAction SilentlyContinue -Verbose
if ($azureRmModule) {
Write-Host 'AzureRM module exists. Removing it'
Uninstall-AzureRm
Write-Host 'AzureRM module removed'
}
Install-Module -Name Az.Storage -Force -AllowClobber -Scope CurrentUser -Verbose
displayName: Remove AzRM modules and install Az.Storage
# Finds the makeappx tool on the machine with image: 'onebranch.azurecr.io/windows/ltsc2022/vse2022:latest'
- pwsh: |
@@ -104,17 +104,6 @@ jobs:
}
displayName: Create json files
- pwsh: |
$azureRmModule = Get-InstalledModule AzureRM -ErrorAction SilentlyContinue -Verbose
if ($azureRmModule) {
Write-Host 'AzureRM module exists. Removing it'
Uninstall-AzureRm
Write-Host 'AzureRM module removed'
}
Install-Module -Name Az.Storage -Force -AllowClobber -Scope CurrentUser -Verbose
displayName: Remove AzRM modules
- task: AzurePowerShell@5
displayName: Upload buildjson to blob
inputs:
@@ -28,18 +28,6 @@ jobs:
Write-Host "##vso[build.updatebuildnumber]$name"
displayName: Set Release Name
- pwsh: |
$azureRmModule = Get-InstalledModule AzureRM -ErrorAction SilentlyContinue -Verbose
if ($azureRmModule) {
Write-Host 'AzureRM module exists. Removing it'
Uninstall-AzureRm
Write-Host 'AzureRM module removed'
}
Install-Module -Name Az.Storage -Force -AllowClobber -Scope CurrentUser -Verbose
displayName: Remove AzRM modules and install Az.Storage
- task: AzurePowerShell@5
displayName: Upload packages to blob
inputs:
-12
View File
@@ -256,18 +256,6 @@ jobs:
New-Item -Path $(Build.ArtifactStagingDirectory)/uploaded -ItemType Directory -Force
displayName: Create output directory for packages
- pwsh: |
$azureRmModule = Get-InstalledModule AzureRM -ErrorAction SilentlyContinue -Verbose
if ($azureRmModule) {
Write-Host 'AzureRM module exists. Removing it'
Uninstall-AzureRm
Write-Host 'AzureRM module removed'
}
Install-Module -Name Az.Storage -Force -AllowClobber -Scope CurrentUser -Verbose
displayName: Remove AzRM modules
- task: AzurePowerShell@5
displayName: Upload packages to blob
inputs: