Azure-pipelines-tasks: Azure SQL Database Deployment - Issue - Task failure

Created on 24 May 2019  路  4Comments  路  Source: microsoft/azure-pipelines-tasks

Hi,

I'm trying to execute a simple SQL file and always the task is throwing the following error:

Invalid deployment action: Script. For SQL query operations, deployment actions should be set to valuePublish.Check out how to troubleshoot failures at https://aka.ms/sqlazuredeployreadme#troubleshooting-

However, as you can see on the attachment, on there's no option available to set as action as 'Publish'.

sql_devops_issue

Also I've tried to execute command, but the agent fails and throw the same error.

On my case, is not option to execute as dacpac extension.

Release

Most helpful comment

I ran into this today and it's incredibly frustrating. This shouldn't be closed, but should be fixed!!

All 4 comments

It is expected behavior and we have consciously added this error message in order to handle back-ward compatibility.

  1. Earlier in-order, action I/P used to come before Deploy Type I/P. (Let鈥檚 say it at Time A)
  2. Now deploy type I/P action comes before action input. ( Let鈥檚 say It at Time B )

Example :

At Time A

  1. User added a task for deployed of a SQL script. So, inputs will be
    a. Action : Publish
    b. Deploy Type: Inline SQL Script
  2. Now Customer want task to perform export action. Now inputs will be
    a. Action: Export
    b. Deploy Type: Inline SQL Script ( This input will be hidden. Because it was visible under publish action )

At Time B

  1. In the task, automatically input got switched as
    a. Deploy Type: Input SQL Script
    b. Action: Export
  2. Task that user supposed to execute export action started executing SQL scripts. ( Wrong behavior )

In order to prevent above issue, we added error check as we assume failure with right error message is better than wrong deployment.

In order to fix your above issue

  • Select deploy type to Dacpac
  • Now select action as publish
  • Now change deploy type to SQL script file.

As this will solve your issue, so closing this issue. If you have further any question or doubts feel free to reopen the issue.

Hi Ajay,

I've applied the changes as you mentioned, like deploy as DACPAC within Publish option and save it. Later, I've changed the to SQL Script file.

So ... the workardound is working!

Thanks,

Marcio Bueno

I ran into this today and it's incredibly frustrating. This shouldn't be closed, but should be fixed!!

@nadesu / @chshrikh - Can you review the feedback and take this further.

Was this page helpful?
0 / 5 - 0 ratings