An Azure service for ingesting, preparing, and transforming data at scale.
Hi Faisal Riaz,
Yes, cross-tenant Azure SQL schema and data synchronization is entirely feasible using Azure services like Azure Data Factory for data movement and Azure DevOps for schema deployments, all executed from your tenant. This keeps everything under your control while securely accessing the client's database through service principals. Since both databases share the same schema, mapping becomes straightforward, and you can selectively copy data from specific tables as needed.
For schema synchronization, the best approach involves generating DACPAC files from your database project and deploying them via Azure DevOps Release Pipelines. Set up multi-stage pipelines where each stage targets the client's Azure SQL Database using a service principal created in their tenant for authentication. Use Azure CLI or PowerShell tasks to publish schema-only DACPACs, ensuring no data is altered during these deployments. This method supports automation and handles tables, views, and other objects reliably across tenants.
Data synchronization works best with ADF pipelines hosted in your tenant, leveraging Copy Activities or Data Flows to move data from selected source tables to matching sink tables in the client database. Create linked services for both databases authenticated via service principals—the client's SP needs db_datareader on source tables and db_datawriter on sinks, with credentials securely stored in your Azure Key Vault. For ongoing incremental syncs, enable Change Tracking or CDC on your source tables and use ADF watermarks or change data capture to efficiently handle deltas, avoiding full reloads on large datasets.
Security remains paramount: always store service principal secrets or certificates in Key Vault, grant least-privilege permissions like db_datareader/db_datawriter, and consider private endpoints for VNet isolation if networking policies require it. Monitor pipelines through ADF activity logs and Azure Monitor, and enable SQL Auditing on the client side for compliance. This setup mirrors real-world patterns used in multi-tenant SaaS scenarios, providing reliability without needing access to the client's tenant for pipeline execution.
While SQL Data Sync offers an alternative via PowerShell for cross-tenant member registration, it falls short for selective table syncs and requires more manual schema handling, making ADF and DevOps the superior, scalable choice for your needs.