Skip to content
DeV1L edited this page Jan 29, 2017 · 3 revisions

Requirements

  1. Run As account.
    Azure Automation Run As account should be created. Read here how to do it.

  2. Azure Storage account.
    You can use existing or create new storage account.

Prepare to run

  1. Upload your SQL scripts into specific container in Azure Blob storage.
    And change script variables: $ResourceGroupName, $StorageAccountName, $Container

  2. Save storage account key as Azure Automation variable asset named StorageAccountKey (type can be chosen "encrypted").

  3. Save your Azure SQL Database credentials as Azure Automation credential asset.

  4. Save script in Azure Automation Runbooks.

Run

You can run it manually or create a schedule. During this you have to specify input parameters:

  • SQLSERVER - your Azure SQL Database server name;
  • SQLSERVERPORT - your Azure SQL Database server port (if it 1433 - don't put anything);
  • DATABASE - your Azure SQL Database name;
  • SCRIPT - name of file in blob storage should be executed (case sensitive).

Known issues

If you have an error Timeout expired. The timeout period elapsed prior to completion of the operation or the server is not responding. modify the $Cmd.CommandTimeout value in the script.

Clone this wiki locally