In an Azure DevOps release pipeline, I have an Agent job. Within that Agent job, I have an Azure Powershell task. I do not see a way to specify environment variables for the Azure Powershell script that the Azure Powershell task runs.
You can do it in a build pipeline by simply specifying "env" for the Azure PowerShell task:
- task: AzurePowerShell@5
inputs:
azureSubscription: '...'
ScriptType: 'FilePath'
ScriptPath: '...'
ScriptArguments: '...'
FailOnStandardError: true
azurePowerShellVersion: 'LatestVersion'
env:
USERNAME: $(username)
PASSWORD: $(password)
But I don't see any way of specifying "env" in a release pipeline:
How can this be done?

