Lab Description | This lab covers the installation of tools that you will use in the labs. |
---|---|
Estimated Time to Complete | 50 minutes |
Key Takeaways | 1. Download and install the required tools |
2. Know what version of the tools are installed | |
3. Learn to configure VS Code and install extensions | |
By the end of this lab, you should have: Git, Visual Studio - SSDT, Visual Studio Code, Azure PowerShell, SSMS, Azure Data Studio, SQLPackage.exe | |
Author | Frank Garofalo |
For those new to DevOps, Source Control, and Database Projects, there are many tools that you need to familiarize yourself with. This module walks you through installing and configuring the required tools for this lab, as well as making sure they are on the current supported versions.
-
Right Click on Windows PowerShell from either the Desktop or the Start Menu
-
Select Run as Administrator
- Run the following PowerShell Command to set your execution policy to Unrestricted:
Set-ExecutionPolicy Unrestricted
- Select "Yes to All" if prompted. Execution policies determine whether you can load configuration files, such as your PowerShell profile, or run scripts and whether scripts must be digitally signed before they are run. More information on this topic can be found here: https://docs.microsoft.com/en-us/powershell/module/microsoft.powershell.security/set-executionpolicy?view=powershell-6#parameters
- Run the following PowerShell Command:
Install-Module -Name 'Az'
-
If not already installed, you may be prompted to install the NuGet provider. Select Yes if this is the case.
-
You may receive a warning message stating you are installing modules from an untrusted repository. Select Yes to All if this is the case. This process may take several minutes.
-
Run the following PowerShell Command to verify the module has installed correctly:
Get-Module -Name '*Az*' -ListAvailable
-
If installed, Az.* modules should be returned
-
Run the following PowerShell Command to turn off autosaving Azure credentials
(some Azure PowerShell versions have this on as the default)
Disable-AzContextAutosave
Expected return:
PS C:\> Disable-AzContextAutosave
Mode : Process
ContextDirectory :
ContextFile :
CacheDirectory :
CacheFile :
Settings : {}
-
In a web browser, navigate to https://git-scm.com/download/win
-
The 64-bit version of Git for Windows should begin automatically downloading, if it does not select 64-bit Git for Windows Setup
-
Note the location of the installation files
-
Run the Git for Windows installation file
-
Accept the EULA by clicking Next
-
Accept the default Destination Location and click Next
-
Accept the default Components and click Next
-
Accept the default Start Menu Folder of "Git" and click Next
-
Accept the default editor of Vim and click Next
-
Accept the default "Git from the command line and also from 3rd-party software" and click Next
-
Accept OpenSSL as the default HTTPS transport backend and click Next
-
Accept the default Windows-style "Configuring the line ending conversions" and click Next
-
Accept the default MinTTY terminal emulator and click Next
-
Accept the default Configuring extra options and click Next
-
Click Install
-
Uncheck "View Release Notes" and click Finish
-
In a web browser, navigate to https://code.visualstudio.com
-
Click Download for Windows
-
Note the location of the installation files
-
Run the VSCodeUserSetup installation file
-
If you are prompted with a message "This User Installer is not meant to be run as an Administrator" Click OK
-
Accept the EULA and click Next
-
Accept the default installation location and click Next
-
Accept the default Start Menu Folder and click Next
-
Select All additional tasks and click Next (Optional)
-
Click Install
-
Uncheck "Launch Visual Studio Code" and click Finish
-
In a web browser, navigate to https://visualstudio.microsoft.com/downloads/
-
Click Free Download on Community Edition
if you have a license, download the appropriate edition
- Note the location of the installation files
-
Run the vs_community installation file
-
Accept the EULA and click Next
-
Select Workloads -> Other Toolsets -> Data storage and processing
-
Make sure SQL Server Data Tools is selected
-
Click Install
This is a large install and can take some time to complete(~20 mins)
SSMS is not required for this lab, but is useful to connect to and query Azure SQL Database with.
-
In a web browser, navigate to https://aka.ms/ssmsfullsetup
-
Note the location of the installation file
-
Run the SSMS-Setup-ENU installation file
-
Leave default installation path
-
Click Install
-
Once Setup completes click Close
Azure Data Studio is not required for this lab, but is useful to connect to and query Azure SQL Database with.
-
In a web browser, navigate to https://go.microsoft.com/fwlink/?linkid=2113530
-
Note the location of the installation file
-
Run the azuredatastudio-windows-user-setup installation file
-
If you are prompted with a message "This User Installer is not meant to be run as an Administrator" Click OK
-
Accept the EULA and click Next
-
Accept the default installation location and click Next
-
Accept the default Start Menu Folder and click Next
-
Select all additional tasks and click Next (Optional)
-
Click Install
-
Uncheck "Launch Azure Data Studio" and click Finish
-
In a web browser, navigate to https://go.microsoft.com/fwlink/?linkid=2113703
-
Note the location of the installation file
-
Run the DacFramework installation file
-
Click Next
-
Accept the EULA and click Next
-
Click Install
-
click Finish to complete the install
The sqlpackage installs to: C:\Program Files\Microsoft SQL Server\150\DAC\bin
-
Launch VS Code
-
Select the terminal. This is typically in the lower right pane of VS Code and is often tabbed with other panes, such as Problems, Output, and Debug Console. If you do not see Terminal, click View in the top menu bar and click Terminal.
-
Type the following PowerShell command:
Get-Module -Name 'Az.Compute' -ListAvailable | Select-Object -Property 'Version'
- The expected output is 3.3.0 or later
- From within the VS Code Terminal, Type the following git command:
git --version
-
The expected output is git version 2.24.1.windows.2 or later
-
If you experience any issues with this step, restart VS Code and try again
-
From the VS Code File Menu, click Help then About
-
The expected version is 1.41.1 or later
Credit for this exercise goes to: Azure Superpowers
-
Visual Studio Code has a rich extensibility model for interacting with and adding to the tool. The features that Visual Studio Code includes out-of-the-box are just the start. VS Code extensions let you add languages, debuggers, and tools to your installation to support your development workflow.
-
You may find an extension for Azure Repos. We do not recommend using this extension in this workshop. If you already have this extension installed, please remove it for the duration of this workshop.
-
Search for and install the following extension, published by Microsoft. Once the extension is installed, reload VS Code.
Note: Search for extensions on the activity window on the left (bottom icon)
a. PowerShell (In addition to enhancements to PowerShell, this extension includes a PowerShell ISE color theme that can found by selecting File, Preferences, Color Theme) b. Install the latest available version of the PowerShell extension, which may be newer than the version shown below.
-
You will not need any other VS Code extensions for this course. You may find extensions that attempt to connect you into Git repositories in Azure DevOps, but they are not needed and have been found to cause confusion with future steps in this workshop.
-
In VS Code, the language support for a file is based on its filename extension. However, at times you may wish to change language modes when working in a particular file. To do this, while editing a file, click on the language indicator - which is located at the bottom of the VS Code window on the right hand of the Status Bar. This will bring up the Select Language Mode drop-down where you can select another language for the current file you are working on.
- Regarding PowerShell authoring in VS Code, you will want to have the
PowerShell extension installed. You will also want to ensure that
when you are working with PowerShell code, you have the VS Code
language set to PowerShell, and you will want to use the PowerShell
Integrated Console. You will need have at least one PowerShell file
open in VS Code for the PowerShell Integrated Console to appear.
-
Operating in this configuration will provide you with the best PowerShell experience, and enable familiar options from the PowerShell ISE, such as pressing F8 to execute a selected area of code.
-
NOTE: When it comes to authoring PowerShell code in this course, we recommend that you type your commands in the top editor window, and use the F8 key to execute your code. Typing your code in the editor window allows you to save the commands you type throughout this course so you can easily refer to them later. The top editor window also enables you to be able to select and execute multiple lines of PowerShell.
Azure PowerShell
We have seen issues in previous workshops if a system has multiple
versions of the Azure PowerShell module installed. If you run into
module related issues, remove all Azure modules from
C:\Program Files\WindowsPowerShell\Modules and install the Azure
module again.
While it is technically possible to have both the Az and AzureRM PowerShell modules installed, we recommend removing the AzureRM modules and using only the Az modules.
The Az PowerShell module requires .Net Framework Runtime 4.7.2 or higher
Azure subscriptions
TRIAL SUBSCRIPTIONS ARE NOT SUPPORTED FOR THIS WORKSHOP