SQL Server Azure Installing Elastic jobs using Powershell

Hi Folks,

We are back as mentioned in my last post I will now demonstrate how to create Elastic Jobs using powershell.

Kindly refer to the Microsoft link which describes the same.


As mentioned in the link we need to have our prerequisites in place before proceeding with further steps.

1) An Azure Subscription(Even Free trail would suffice)

2)Azure PowerShell. Install the latest version using the web platform installer

3)NuGet Command-line Utility(nuget.exe) is used to install the Elastic Database jobs package.

After downloading the Windows Azure Powershell  web platform installer we need to install the component so that it would allow us to work on Azure related powershell cmdlets

4) After the installation gets completed  we need to launch the powershell & need to fire the below command. In my case I kept my nuget.exe inside C drive.

PS C:\>.\nuget install Microsoft.Azure.SqlDatabase.Jobs -prerelease

5)once the above steps gets completed the Elastic Database jobs files are placed in the local directory in a folder named Microsoft.Azure.SqlDatabase.Jobs.x.x.xxxx.x where x.x.xxxx.x reflects the version number. In my case it is Microsoft.Azure.SqlDatabase.Jobs.0.8.3362.1
The PowerShell cmdlets (including required client .dlls) are located in the tools\ElasticDatabaseJobs sub-directory and the PowerShell scripts to install, upgrade and uninstall also reside in the tools sub-directory. Below is the screenshot of the files what we will get

6) Now Navigate to the tools directory.

7)Execute the .\InstallElasticDatabaseJobsCmdlets.ps1 script to copy the ElasticDatabaseJobs directory into $home\Documents\WindowsPowerShell\Modules

8)Execute the .\InstallElasticDatabaseJobs.ps1 PowerShell script and supply values for its requested variables. This script will create the components described in Elastic Database jobs components and pricing along with configuring the Azure Cloud Service to appropriately use the dependent components.

When you run this command a window opens asking for a user name and password. This is not your Azure credentials, enter the user name and password that will be the administrator credentials you want to create for the new server.

9) I encountered few errors as my SQL Server location was setup as Central India where as the default location is Central US.
10) After some debugging finally I was able to deploy the jobs successfully.

In the next post we will see how to schedule the jobs. Happy Reading :)