Exported database from Azure SQL failed to be imported to Azure SQL or to local SQL Server

Symptoms:  When using blob auditing on Azure SQL Server or Database, after you export database to .bacpac file if you import the database to another Azure SQL DB that already have blob auditing enabled at the server level you may get this error message: Could not import package. Error SQL72014: .Net SqlClient Data Provider: Msg…


Lesson Learned #23: How to add AAD Security Groups to Azure SQL Database?

In these days, we are receiving multiples cases where our customer needs to add Azure SQL Database groups from Azure Active Directory. This is an example to how to archive it. Using the Portal in Azure: I created a user called SQLMember. I created a group called SQLGroup, adding the member SQLMember.   Using SQL…


ARM Template to deploy server with Auditing and Threat Detection turned ON

I would like to share an example of a template that can be used to deploy server with multiple databases and to turn ON Auditing and Threat Detection at server and individual database levels. A few guidelines: Auditing server policy can be set after creation of all databases, so you should add dependency on all databases to…


Accessing Azure SQL DB from Azure VM using a static Public IP adress

As it’s known Azure SQL DB relies on the FQDN of the server the database is on for resolution. So how can we access Azure SQL DB from an Azure VM using a Public IP and make sure that it remains the same?further how we can disallow arbitrary machines from within the Windows Azure environment…


Sample: Joining tables from different Azure SQL Databases

Abstract: The Elastic Database Query feature allows you to perform cross-database queries to access remote tables. It is a great feature if you plan to send straight-forward queries with well-defined Where clauses to the remote database. But as soon as you need to join a remote table with a local table, you are in for…


Fix identities after migrating through SQL Replica

One of the most common migration procedures to SQL Azure is by configuring replication from your previous environment to your brand new SQL DB: https://msdn.microsoft.com/en-US/library/mt589530.aspx   This is a very nice migration process, as it allows original database to be available in Production until very few moments before SQL Database goes live. However, if your…


BACPAC Export failing with Unable to reconnect – Timeout expired

I had a support case recently where the export of a SQL Server database into a BACPAC file was failing. The first attempt was done through SQL Server Management Studio 2016, by right-clicking the database -> Tasks -> Export Data-Tier Application. Another attempt using the sqlpackage.exe command-line tool showed the identical results though. The following operations…


Elastic Database Jobs: Sample for Running T-SQL Code in Multiple Databases

Introduction: After moving from on-premise SQL Server to Azure SQL Database, the SQL Server Agent service is no longer available to you. Administrators are therefore missing the ability to run recurring jobs, in order to execute T-SQL scripts and Stored Procedures on a schedule. Elastic Database Jobs are one way of implementing a scheduled execution on…


Does Azure SQL DB support automatic indexed views?

Are indexed views used automatically in SQL Azure without “WITH (NOEXPAND)”?How does it work?and How the query optimizer decides to use it or not ? The query optimizer uses indexed views to speed up the query execution. Which means SQL Server’s query optimizer realizes the precomputed sums of all the Quantity values for each value are…