Use PowerShell to create cloud DR environment using Azure SQL Databases (PaaS) with integrated azure SQL Analytics Solution and send Email Report with the connection string details.
Description:
Use PowerShell to deploy cloud service with Azure SQL Database (PaaS) with good resilience to outages (GEO Replications, Failover Groups) and with integrated azure SQL Analytics Solution.
PowerShell:
The script will include the following:
Connect to Azure Account;
Use existing or create new Resource Group;
Create primary Azure Logical SQL Server;
Set an admin login and password for your server;
Set Firewall Settings (IP address range);
Create Azure SQL Database;
Create a new login for the Azure SQL Server;
Create a new DB user for the existing login;
Create Failover Azure Logical SQL Server, including admin login, password and firewall rules (Optional);
Create Failover Group Name (Optional);
Add Database to the exiting Failover Group (Optional);
Create a new login for the Failover Azure SQL Server with matching SID (Optional);
Create a Workspace in the existing Resource Group;
Enable Azure SQL Analytics Intelligence Pack;
Enable Azure Diagnostics for Azure SQL database;
Configure Azure SQL Databases to stream diagnostics telemetry;
Send Email notification with connection string parameters.
Powershell script:
Script usage example:
Note.
You can repeat the script multiple times. If the resource you are creating already exist script will just skip that part with a message.
Note. You should use read/write listener endpoint within the connection string.
My name is Zoran, currently living in Auckland, New Zealand. I am a data specialist with more than 15 years of hands-on experience in database administration and optimisation. I am also, Certified Microsoft Trainer (MCT) and Microsoft Certified Solutions Expert (MCSE) with a Master‘s degree in Information Technology. Sharing knowledge and contributing to the SQL Server community is my passion. I am also an organiser of the Auckland SQL User Meetup Group. As well I am active blogger and speaker at different SQL events such as SQL Saturdays, Meetups etc.
Leave a Reply