Yesterday while working for a customer, I had to setup Log Shipping for SQL Server 2016 on Azure. Setting up Log Shipping is easy and well documented here at Below Link:

Configure Log Shipping SQL Server

But log shipping requires a File Share to be created so that both servers Primary and Secondary can access the Transaction Logs.

To setup file sharing, I used Azure Storage File Service. But this required some specific configuration.

I had to Add the File Share Credentials to Windows Credentials Manager of both the systems for SQL Server & SQL Server agent service accounts using following steps:

  1. Open CMD.exe for a specific user usingĀ  following in windows run box

runas /user:<accountname for sql agent> cmd.exe

  1. Add Credentials to Windows Credentials Manager using:

C:\>cmdkey /add:<yourstorageaccountname> /user:<domainname>\<yourstorageaccountname> /pass:<YourStorageAccountKeyWhichEndsIn==>

After doing this the file share was available to service accounts as the credentials were being saved in windows credentials manager.

All I had to was to following along the article mentioned earlier and I had Setup Log Shipping on Azure using Azure File Shares.