# Exercise - Set up the environment

Completed

In this unit, you'll use a script to deploy the existing eShopOnContainers app to Azure Kubernetes Service (AKS).

## Open the development environment and create the Azure resources

Note

If you wish to use GitHub Codespaces, navigate to your codespaces for the MicrosoftDocs/mslearn-aspnet-core repository. Create a new codespace using the main branch, and then skip to step 3.

1. From a new Visual Studio Code window, press Ctrl+Shift+P to open the command palette, and then search for and select Remote-Containers: Clone Repository in Container Volume.

2. Provide the following repository URL: https://github.com/MicrosoftDocs/mslearn-aspnet-core

Visual Studio Code creates your development container.

3. After the project loads in the container, expand the modules directory, then microservices-aspnet-core, and then finally deploy. Right-click on the k8s directory and select Open in Integrated Terminal. This location contains the scripts you're going to use in this module. (Note: By default, Code will display k8s on the same line as deploy because deploy only contains subdirectories.)

4. In the new terminal pane, sign in to the Azure CLI. If using GitHub Codespaces, include the --use-device-code flag. If you are using Visual Studio Code, you may optionally omit the flag.

az login --use-device-code

5. View your selected Azure subscription.

az account show -o table


If the wrong subscription is selected, select the correct one using the az account set command.

6. Run the quickstart script:

Important

The quickstart script creates Azure resources in the centralus region. This behavior can be customized by changing the defaultLocation variable at the top of quickstart.sh before you run the script.

./quickstart.sh


The preceding command runs a script that completes the following steps:

• Provisions AKS and Azure Container Registry resources.
• Deploys the containers to a fully managed Kubernetes service in Azure, known as AKS.
• Displays connection information upon completion.

Tip

This unit uses scripts to keep focus on the learning objectives. The script outputs colored text to indicate the commands being executed. You can inspect the script and the output to better understand the commands used.

The script deploys a modified version of the eShopOnContainers reference app. While the script is running, continue to the next unit to review the eShopOnContainers architecture.