Found more than one file to deploy with search pattern D:\a\r1\a\**\*.sql. There can be only one while using deply using sql query agent in azure devops release pipeline RRS feed

  • General discussion

  • Hi Team,

    Found more than one file to deploy with search pattern D:\a\r1\a\**\*.sql. There can be only one while using deploy using sql query agent in azure devops release pipeline..

    Even though it was mentioned we can use wild card for deploying sql files we still getting errors that found more than one files


    Sridhar Allada

    Monday, September 9, 2019 8:40 AM

All replies

  • Hi Sridhar,

    Are working with SQL Server on an Azure VM. The title of your forum post suggests this is the case. This is specific to Azure SQL Database (PaaS) and I am not confident that this question will gain the attention of the appropriate audience but, I did want to double check to see what you are attempting to accomplish. The following is specific to Azure SQL Database (PaaS): Azure SQL database deployment



    Monday, September 9, 2019 9:22 PM
  • Hi Mike,

    I am working with Azure SQL Database deployments and am trying to deploy the .sql files to azure SQL database using the AZure DevOps.There is pre defined agent(deploy to azure SQL DB) in release pipelines to deploy the files to azure SQL database and am using that.

    Am getting the above error(as mentioned above) while deploying the multiple .sql files to Azure SQL deployments but the same is working if am trying to deploy single file.

    Tuesday, September 10, 2019 5:19 AM
  • Hi Sridhar,

    I wanted to follow-up with the specific Azure Pipelines documentation: Azure SQL database deployment

    If you are finding multiple .sql files, these are likely scripts that have been saved to the local file system. If you are working with Azure SQL Database, you will be working with .bacpac and in the case of Managed Instance or SQL Server on an Azure VM, .bacpac and .bak files.

    Can you open the .sql files and see what they consist of? Please post any additional, relevant information to help identify what there file are. Thank you!

    Tuesday, September 17, 2019 2:16 AM
  • Hi Mike,

    .sql files can have anything like create a table,create a view,or insert statements which developers will commit the .sql files in to our source code management Bitbucket.

    I have gone through the mentioned documentation and I have used the same agent in release pipeline to deploy to Azure SQL DB.we have an option of using dacpac/inline sql script/sql script file. I have selected path of sql script file as  D:\a\r1\a\**\*.sql which should deploy all sql files but the error is stating that multiple sql files cannot be deployed. Whereas if I mentioned D:\a\r1\a\**\test.sql the file is getting executed/deployed  properly in the DB. So I would like to know whether is it possible to deploy all sql files with wildcard or do we need to mentioned each sql file name separately.Since our developers might create new sql files going forward we might need add the file names in the release pipelines whenever the is a change in the file name which is not recommended.

    Tuesday, September 17, 2019 6:17 AM
  • Thank you for this detailed feedback, Sridhar. I am investigating wildcard functionality within a pipeline. 



    Tuesday, September 17, 2019 6:51 PM
  • Are you usng an .artifactignore control within your Pipeline? The following docs: Pipeline artifacts in Azure Pipelines

    and Use the .artifactignore file  explain how to further control wildcards but in your case, the solution might be to use **.sql instead of *.sql. Try this and let me know if this works. Thank you!

    Wednesday, September 18, 2019 2:06 AM
  • Hi Mike.

    There are only .sql files in my repo..SO i think there is no need of using .artifactignore file.Please correct me if am wrong.

    Also i tried executing using **.sql and as well as *.sql and tried all other comibinations like forward slashes,backslashes('/','\'),PFB error

    #[error]Found more than one file to deploy with search pattern D:\a\r1\a\DEPLOYMENT_SCRIPTS\*.sql. There can be only one

    [error]Found more than one file to deploy with search pattern D:\a\r1\a\DEPLOYMENT_SCRIPTS\**.sql. There can be only one.

    Wednesday, September 18, 2019 6:13 AM
  • Hi Sridhar,

    The agent only allows for a single script when the Argument passed is Deploy Type = SQL Script File

    Friday, October 4, 2019 8:48 PM