I'm deploying a dacpac to Azure as a part of a release pipeline using the "Azure SQL Database deployment" task.
I am getting the error: "Cannot use a CONTAINS or FREETEXT predicate on table or indexed view 'table' because it is not full-text indexed."
The table the dacpac is deployed to is an empty database that has been created every-time in a prior Azure CLI task and is dropped later in the deployment.
The issues appears to be an issue with the ordering...
Investigating the publish script shows:
Line 2489 - Creates the full text index catalog
Line 70374 - Create Stored Procedure - Fails Here
Line 80491 - Creates full text on table
So the stored procedure is created before the full text index it depends on.
I have tried:
- Adding /p:IncludeTransactionalScripts=True in the "Additional SqlPackage.exe Arguments" (which made no difference as far as I can tell)
- A pre-deployment script to manually add the full-text index before doing anything else. This failed too. Due to the fact that the table it needed to add the index too has yet to exist in the pre-deployment stage.
Temporary Work Around:
It's worth noting that I have got a temporary work around. In that I have the "Azure SQL Database deployment" task run twice. First time throwing the error but with "Continue on Error" selected and then second time around succeeding. This feel really hacky and bad though.