Azure Pipelines "##[warning]This task is deprecated"
A task printed a deprecation warning, usually because its execution handler (such as a retired Node version) or its major version is being phased out. The job still succeeds now, but the warning is a signal to migrate before removal forces a failure.
What this error means
The log shows ##[warning]This task is deprecated or a Node runtime deprecation, often with a link to the replacement task or version.
##[warning]Task 'PublishBuildArtifacts@1' is deprecated. Use 'PublishPipelineArtifact@1' instead.
##[warning]Node.js 16 is deprecated and will be removed; upgrade the task version.Common causes
The task major version is end-of-life
The pinned major version (for example an @1 task superseded by @2) is deprecated in favor of a newer one.
The task runs on a retired Node handler
Older task versions execute on a Node runtime (Node 16 and earlier) that Azure DevOps is removing.
How to fix it
Move to the recommended replacement
Switch to the task or major version the warning names so the pipeline keeps working after the old one is removed.
- task: PublishPipelineArtifact@1
inputs:
targetPath: '$(Build.ArtifactStagingDirectory)'
artifact: 'drop'Bump the task major version
- Read the warning to see the suggested version or replacement.
- Update the
@versionsuffix to the supported major. - Re-run and confirm the deprecation warning is gone.
How to prevent it
- Track deprecation warnings, not just errors, in your logs.
- Pin tasks to currently supported major versions.
- Plan migrations before Microsoft removes a deprecated version.