Going further
Import from a CI/CD pipeline
The same job as the scheduled import, triggered after a migration deploys instead of on a timer — so the documentation updates when the schema does, and drift is caught at deploy.
Wrap the extractor as a stored procedure in your database (once). The demo workspace documents this flow — load the demo and open the ZestreaDB extraction flow to see what it looks like.
Store the Automation Key as a pipeline secret and expose it to the step as
ZESTREA_KEY.Grant the service account GRANT VIEW DEFINITION and GRANT SELECT ON sys.sql_expression_dependencies.
Add this as the post-deploy step — pick your authentication and copy the whole command:
SQL login
SERVER=your-server.example.com,1433 DATABASE=YourDatabase SQLUSER=your-user SQLPASS=your-password ZESTREA_KEY=your-api-keysqlcmd -S "$SERVER" -U "$SQLUSER" -P "$SQLPASS" -C -d "$DATABASE" \ -Q "EXEC dbo.ZestreaDB_ExtractSchema" \ -h -1 -W -y 0 -o /tmp/schema.json \ && curl -X POST https://zestreadb.com/api/v1/ingest/schema \ -H "Authorization: Bearer $ZESTREA_KEY" \ -H "Content-Type: application/json" \ --data-binary @/tmp/schema.jsonWindows auth
SERVER=your-server.example.com,1433 DATABASE=YourDatabase ZESTREA_KEY=your-api-keysqlcmd -S "$SERVER" -E -C -d "$DATABASE" \ -Q "EXEC dbo.ZestreaDB_ExtractSchema" \ -h -1 -W -y 0 -o /tmp/schema.json \ && curl -X POST https://zestreadb.com/api/v1/ingest/schema \ -H "Authorization: Bearer $ZESTREA_KEY" \ -H "Content-Type: application/json" \ --data-binary @/tmp/schema.jsonEntra ID
SERVER=your-server.example.com,1433 DATABASE=YourDatabase ZESTREA_KEY=your-api-keysqlcmd -S "$SERVER" -G -C -d "$DATABASE" \ -Q "EXEC dbo.ZestreaDB_ExtractSchema" \ -h -1 -W -y 0 -o /tmp/schema.json \ && curl -X POST https://zestreadb.com/api/v1/ingest/schema \ -H "Authorization: Bearer $ZESTREA_KEY" \ -H "Content-Type: application/json" \ --data-binary @/tmp/schema.jsonThe
-h -1 -W -y 0flags stopsqlcmdformatting the output for a terminal.
Running on every deploy is cheap: the extractor’s content hash means a deploy that did not change the schema does nothing.