Activity: Performing a geo-restore of an Azure SQL Database with PowerShell
Let's once again consider our example of ToyStore Ltd. Mike is aware that, although on the cloud, his data is still physically stored on servers. Hence, there is a possibility of data loss due to natural disasters. In these instances, he would have to perform a geo-restore operation. This section makes use of PowerShell to perform a geo-restore:
- Press Windows key + R to open the Run dialog box. In the Run dialog box, type
powershell ise
to open a new PowerShell editor window. - In PowerShell, click File from the top menu, and then select New to create a new PowerShell script file:
Figure 5.42: Creating a new PowerShell script
- In the new PowerShell script file, copy the code as instructed in the following steps.
Define the PowerShell script parameters. The parameters are self-explanatory:
param( Â Â Â Â Â Â Â Â Â Â Â [Parameter(Mandatory=$true)] Â ...