0
votes

I am using SQL Server Database Deployment task in azure release pipeline to take back up of the database I need to set backup filename/path in a pipeline variable to use it in another task under a different deployment group in the same stage to restore the DB in case of any release error.

But for SQL Server Deployment task, i couldn't find anything as such. "Settable at release time" flag is turned ON for the variable.

Basically the requirement is to back up the Database and restore in case of any error in the DACPAC release. Please suggest a way to set the variable value in SQL Server Deployment task or any alternate way to achieve my requirement. I need the value of SQL variable @FullPath in a Pipeline Variable dynamically set during the release time.

1
Hi, How about the issue? Does the answer below resolve your question? If yes, you could Accept it as an Answer , so it could help other community members who get the same issues and we could archive this thread, thanks.Vito Liu
Just checking in to see whether this issue is still blocking you now? Any update for this issue?Vito Liu

1 Answers

0
votes

i couldn't find anything as such. "Settable at release time" flag is turned ON for the variable.

We could set the variable in the release variable tab or variable group such as FullPath = xxx, then use it in the task SQL Server Deployment via $(FullPath). Then we could set the feature Settable at release time in the variable page, please check the pic below.

I need the value of SQL variable @FullPath in a Pipeline Variable dynamically set during the release time.

We could also try to set the variable via the power script Write-Host "##vso[task.setvariable variable={variable name}]{variable value}", then we can call the variable in the another task. You could refer to this doc and ticket.