First published on MSDN on Nov 04, 2016
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 the Azure SQL Database platform. The feature is available through the Azure Portal, but only in a very limited way. To take advantage of the full feature set, you will have to use the corresponding PowerShell cmdlets.
The sample assumes that you already have two Azure SQL Databases on the same SQL server, either in an Elastic Pool or as two unpooled databases. You will create a sample table in each database, and then use the Elastic Database Job to insert rows into both databases.
(6) Open a connection to the Elastic Database jobs
(this will ask you for the credentials to login to the jobs server and database - you have created these through the Install steps in article "
Installing Elastic Database jobs overview
" mentioned above)
(7) Create an encrypted credential for job execution across databases
(this will ask you for the credentials to login to your user databases - it assumes that the same credentials are valid for all databases)
(15) You may run the preceding step repeatedly until the "Lifecycle" columns reports "Succeeded". If you then check the sample tables in the databases, you should see that one row had been inserted in each of them:
select * from ConnectionDetails
I hope that these steps will help you getting started with Elastic Database Jobs. Please leave a comment below in case you encounter any issues with this article!