Using the variable agent.TempDirectory instead of build.artifactstagingdirectory
Server - Azure Pipelines or TFS on-premises
Agent - Private:
The variable build.artifactstagingdirectory undefined for the release pipelines and works for the build
Error "Path must be a string. Received undefined"
Release does not have a staging directory. If you are looking for artifacts you can use the System.ArtifactsDirectory.
You can refer the below link for supported variables.
https://docs.microsoft.com/en-us/azure/devops/pipelines/release/variables?view=azure-devops&tabs=batch#default-variables
Closing this issue as it's not a bug. Please let know us if you have any further queries.
Most helpful comment
Release does not have a staging directory. If you are looking for artifacts you can use the System.ArtifactsDirectory.
You can refer the below link for supported variables.
https://docs.microsoft.com/en-us/azure/devops/pipelines/release/variables?view=azure-devops&tabs=batch#default-variables