Book Image

SQL Server 2014 with PowerShell v5 Cookbook

By : Donabel Santos
Book Image

SQL Server 2014 with PowerShell v5 Cookbook

By: Donabel Santos

Overview of this book

Table of Contents (21 chapters)
SQL Server 2014 with PowerShell v5 Cookbook
Credits
About the Author
Acknowledgments
About the Reviewers
www.PacktPub.com
Preface
Index

Connecting to an Azure SQL database


In this recipe, we will connect to an Azure-hosted SQL Server database.

Getting ready

There are a number of prerequisites before you can follow through with this recipe. First, you must already have a Windows Azure account. If you do not, you will need to set one up.

You also need to have the Azure PowerShell cmdlets. If you do not have these installed yet, you can get them by installing the Microsoft Web Platform Installer from http://go.microsoft.com/fwlink/p/?linkid=320376&clcid=0x409. Note that this requires .NET 4.5

In addition, you also need to already have an Azure SQL database to connect to. You need to note your server name, database name, your username, and your password. You will need these when connecting to your instance in the recipe.

How to do it...

The steps to connect to your Azure SQL database using PowerShell are as follows:

  1. Open PowerShell ISE as administrator.

  2. If you haven't already done so yet, you will need to set up connectivity between...