Comments (18)
Thank you for raising this issue, right now our team is working on switching from AzureRM (which no longer supported from 29/02/2024) to Az.
Since we can't check user's PowerShell scripts, we are displaying such warning to notify users to double check if their scripts are also using deprecated AzureRM, it will disappear after rollout of this migration is completed.
Also, if you'd like to help our team and switch to the new Az you can add environment variable RETIRE_AZURERM_POWERSHELL_MODULE
and set it to true
. (This will also dismiss this warning)
from azure-pipelines-tasks.
This actually started breaking our builds and PRs, because we use the Build Quality Checks extension to ensure no warnings are introduced by code changes. We do not use AzureRM (our scripts explicitly load recent versions of Az modules).
from azure-pipelines-tasks.
It's one of the flags you can set on the inputs of the activity.
See last line of first example here:
from azure-pipelines-tasks.
We have exactly the same issue!
In our DevOps pipeline (classic), we use an "Azure PowerShell 5.*" task that uses a service principal.
Every time this task runs, we get a warning that we are using "AzureRM".
The whole script isn't using any Azure RM commands.
Last week, this warning started to appear.
from azure-pipelines-tasks.
Same problem. We are getting this warning but have absolutely no AzureRM that we can tell. Is it the task itself that is using AzureRM?
from azure-pipelines-tasks.
Sounds like a bug in PowerShell task itself. Couldn't find any release notes related to task: AzurePowerShell@5
According to this https://techcommunity.microsoft.com/t5/azure-tools-blog/azurerm-will-retire-by-29-february-2024/ba-p/2156169 , warning makes sense but there is no recent comment on that task link : https://learn.microsoft.com/en-us/azure/devops/pipelines/tasks/reference/azure-powershell-v5?view=azure-pipelines
from azure-pipelines-tasks.
I found that the tasks themselves were last updated two weeks ago to migrate from AzureRM to Az powerShell, e.g.
to list two of the Pull Requests. I assume this is the reason somehow - but haven't looked into it more than this.
from azure-pipelines-tasks.
Microsoft has an option to use compatability mode with Enable-AzureRMAlias. I tried this as the first line of the inline Powershell within the AzurePowershell@5 tasks, but we still get the warning that we use the AzureRM module.
We do not use the AzureRM cmdlets in our Powershell scripts.
from azure-pipelines-tasks.
Also had this one suddenly appear.
Switching it to use Powershell Core using:
pwsh: true
gets it working with no warnings.
from azure-pipelines-tasks.
Also had this one suddenly appear. Switching it to use Powershell Core using:
pwsh: true
gets it working with no warnings.
Can you please provide me with more info on this, like an example of yours. I am also facing the same issue with ps5.*
from azure-pipelines-tasks.
It's one of the flags you can set on the inputs of the activity. See last line of first example here:
Thank you, it helps. But my pipeline is classic one, so I think we will have to find how to set that value?
from azure-pipelines-tasks.
It's one of the flags you can set on the inputs of the activity. See last line of first example here:
got it now, I can see in advanced, Use Powershell Core check box, I will try to check that one and see if the warning goes.
I will update after I do it.
Thank you
from azure-pipelines-tasks.
Hi , I have configured my task as below
- task: AzurePowerShell@5
displayName: 'Display installed modules'
inputs:
azureSubscription:.azureServiceConnection
scriptType: inlineScript
inline: |
$VerbosePreference = "Continue"
# Enable AzureRM alias support
Enable-AzureRmAlias
Write-Host "All modules:"
Get-InstalledModule
azurePowerShellVersion: LatestVersion
pwsh: true
errorActionPreference: 'stop'
continueOnError: true
enabled: true
I have used advanced options as pwsh: true, However I could still see warning from my pipeline below
Added TLS 1.2 in session.
Import-Module -Name C:\Modules\az_11.3.1\Az.Accounts\2.17.0\Az.Accounts.psd1 -Global
##[warning]You're using AzureRM which will be retired soon, please schedule an update.
from azure-pipelines-tasks.
@kirill-ivlev do you mean something like this, the last line?
- task: AzurePowerShell@5
displayName: 'Transform Configs and Deployment files'
inputs:
azureSubscription: $(PO_AzureCustSubscription)
ScriptType: 'FilePath'
ScriptPath: '$(System.DefaultWorkingDirectory)/Scripts/PS/cust-transform.ps1'
errorActionPreference: 'continue'
azurePowerShellVersion: 'LatestVersion'
env:
APPLICATION_INSIGHTS_CONNECTION_STRING: $(APPLICATION_INSIGHTS_CONNECTION_STRING)
RETIRE_AZURERM_POWERSHELL_MODULE: true
from azure-pipelines-tasks.
Thank you for raising this issue, right now our team is working on switching from AzureRM (which no longer supported from 29/02/2024) to Az.
Since we can't check user's PowerShell scripts, we are displaying such warning to notify users to double check if their scripts are also using deprecated AzureRM, it will disappear after rollout of this migration is completed.
Also, if you'd like to help our team and switch to the new Az you can add environment variable
RETIRE_AZURERM_POWERSHELL_MODULE
and set it totrue
. (This will also dismiss this warning)
You mentioned about this variable helping your team... does that mean by using this env var, it will provide your team access to our powershell scripts? Just want to confirm due to legal requirements.
from azure-pipelines-tasks.
@shurick81 yes, right
from azure-pipelines-tasks.
Looking at the code of VstsAzureHelpers, it seems that when RETIRE_AZURERM_POWERSHELL_MODULE
is set the agent will actively try to install some Az modules and uninstall AzureRM modules from the machine. This is unacceptable in my environment, because the build server configuration (including the installed PowerShell modules) is controlled via other means and the agent should not change it (especially not as part of running a pipeline).
from azure-pipelines-tasks.
Is there an option to only suppress the warning?
We've completed migration from AzureRM to Az; no AzureRM-modules are installed.
When we set RETIRE_AZURERM_POWERSHELL_MODULE=true
, and run an AzurePowerShell@5-task (v5.239.9), the "You're using AzureRM which will be retired soon, please schedule an update."-messages is gone.
However, Uninstall-AzureRM
is called on every execution.
==============================================================================
Task : Azure PowerShell
Description : Run a PowerShell script within an Azure environment
Version : 5.239.9
Author : Microsoft Corporation
Help : https://aka.ms/azurepowershelltroubleshooting
==============================================================================
Generating script.
========================== Starting Command Output ===========================
"C:\Program Files\PowerShell\7\pwsh.exe" -NoLogo -NoProfile -NonInteractive -ExecutionPolicy Unrestricted -Command ". 'C:\agents\Agent1\_work\_temp\8dd805fe-5887-4937-8423-4e36fc4152ce.ps1'"
Added TLS 1.2 in session.
Import-Module -Name C:\Users\<...>\Documents\PowerShell\Modules\Az.Accounts\2.12.1\Az.Accounts.psd1 -Global -PassThru -Force
Imported module 'Az.Accounts', version: 2.12.1
Update-AzConfig -DisplayBreakingChangeWarning False -AppliesTo Az
Enable-AzureRmAlias -Scope Process
Import-Module -Name C:\Users\<...>\Documents\PowerShell\Modules\Az.Resources\6.6.0\Az.Resources.psd1 -Global -PassThru -Force
Imported module 'Az.Resources', version: 6.6.0
Import-Module -Name C:\Program Files\PowerShell\Modules\Az.Storage\4.5.0\Az.Storage.psd1 -Global -PassThru -Force
Imported module 'Az.Storage', version: 4.5.0
Uninstall-AzureRm
WARNING: Running this cmdlet in PowerShell Core will only remove the modules from PowerShell Core. Please rerun this cmdlet in a PowerShell 5.1 session to remove the modules from PowerShell 5.1.
Clear-AzContext -Scope CurrentUser -Force -ErrorAction SilentlyContinue
Clear-AzContext -Scope Process
Clear-AzConfig -DefaultSubscriptionForLogin
Connect-AzAccount
from azure-pipelines-tasks.
Related Issues (20)
- [BUG]: Starting background process via AzureCLI task hangs whereas Bash task does not
- [enhancement]: Change DotNetCoreCLI verbosityRestore defaultValue to Normal HOT 1
- [Question]: when task: AzureCLI@2 has version 2.60.0 by default? HOT 3
- [BUG]: IIS web app deploy - V0.235.1 - Error: Unrecognized argument '-'.
- [BUG]: DockerInstaller@0 keeps getting intermittent certificate error
- [BUG]: Total test run duration/count is incorrectly calculated from junit xml report HOT 2
- [Question]: How to use the Publish Pipeline Metadata task
- [REGRESSION]: HOT 3
- [enhancement]: AzureFunctionApp Task does not update the LinuxFxVersion to match the Runtime Stack
- [BUG]: AzurePowerShellV5 task is logging partial federatedToken
- [Question]: Is my error a result of needing to run CocoaPods task? HOT 1
- [BUG]: SqlAzureDacpacDeployment: does not server name when it contains a dot (Azure SQL Managed Instance)
- [BUG]: AzurePowerShell@5 is failing to find parameter FederatedToken HOT 1
- [Question]: Unable to download from Storage Account since using WIF and @AzureFileCopy6 HOT 4
- [REGRESSION]: Failed to perform Auto-login: PSContextCredentialexec: "pwsh": executable file not found in %PATH%. HOT 4
- [Question]: Issue with the Federate Credential login on Azure Cli task HOT 6
- [BUG]: DockerV2 L0 test broken
- [BUG]: AzureResourceManagerTemplateDeployment failure after ubuntu-latest was updated to 22.04.4 (20240516.1.0) HOT 1
- [BUG]: AzureFunctionAppContainer@1 sets linuxFxVersion instead of windowsFxVersion for windows image HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from azure-pipelines-tasks.