-
Notifications
You must be signed in to change notification settings - Fork 0
Home
-
Run As account.
Azure Automation Run As account should be created. Read here how to do it. -
Azure Storage account.
You can use existing or create new storage account.
-
Upload your SQL scripts into specific container in Azure Blob storage.
And change script variables:$ResourceGroupName, $StorageAccountName, $Container -
Save storage account key as Azure Automation variable asset named StorageAccountKey (type can be chosen "encrypted").
-
Save your Azure SQL Database credentials as Azure Automation credential asset.
-
Save script in Azure Automation Runbooks.
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).
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.