Automated azure sql export fails

前端 未结 2 1258
孤城傲影
孤城傲影 2021-01-22 22:20

I need to get the .bacpac files exported to blob storage automatically. In the azure management portal I have configured it so that it export the db. But it fails again and agai

2条回答
  •  攒了一身酷
    2021-01-22 22:59

    This error is generally due a schema change in the database which has resulted in an object becoming invalid.

    You can see if this is the case by doing a manual export in the portal. The export will fail, with a red notification being generated saying "Export database 'db_name' failed. Clicking on the "Details" will show another line with an arrow in a circle which will contain the actual error message.

    The error message will likely look like:

     Error encountered during the service operation. 
     Validation of the schema model for data package failed.
     Error SQL71501: Error validating element.... 
    

    In most cases this is the result of a schema change that has rendered a stored procedure, view or function invalid. The simplest example of this is dropping a column that is referenced in a stored procedure or view.

    The reason for this is that a bacpac file also generates the commands needed to replicate the schema. If some of these commands fail (because they reference a non existent column), then the entire restore would fail.

    Simply fix any views/stored procedures/functions that are mentioned in the error log and the export should resume.

提交回复
热议问题