Task 04 - Verify setup and sign in to Azure
Introduction
Now that you have installed all the necessary software (or set up a GitHub Codespace), the final step is to verify that everything is working correctly and sign in to Azure.
Description
In this task, you will verify that all required tools are installed and functioning properly. You will also sign in to Azure using the Azure CLI and Azure Developer CLI to ensure that you are ready for the remaining exercises.
Success Criteria
- All required tools are installed and returning the expected version numbers.
- You are signed in to Azure via the Azure CLI.
- You are signed in to Azure via the Azure Developer CLI (azd).
Learning Resources
Key Tasks
01: Verify installed tools
Run the following commands to confirm that all required tools are installed and accessible from your terminal or Codespace.
Expand this section to view the solution
Open a terminal (or the integrated terminal in VS Code / your Codespace) and run each of the following commands:
# Azure CLI
az --version
You should see output indicating Azure CLI version 2.x or later.
# Azure Developer CLI
azd version
You should see output indicating the azd version.
# Python
python --version
You should see a version number of 3.12.x or later (3.14 recommended).
# Git
git --version
You should see output indicating git version 2.x or later.
If any of the commands above fail or return an unexpected version, revisit the previous task and ensure the corresponding software is installed correctly. On Windows, you may need to restart your terminal or VS Code after installation for the PATH changes to take effect.
02: Sign in to Azure CLI
You need to be authenticated with the Azure CLI to deploy and manage resources in later exercises.
Expand this section to view the solution
Run the following command to sign in:
az login
A browser window will open prompting you to sign in with your Azure credentials. Complete the sign-in process and return to your terminal.
If you are using a GitHub Codespace or a remote environment without browser access, use the device code flow:
az login --use-device-code
After signing in, verify that you are connected to the correct subscription:
az account show --output table
If you need to switch subscriptions, list all available subscriptions and set the desired one:
az account list --output table
az account set --subscription "<subscription-name-or-id>"
If you receive an error message reading, “Your sign-in was successful but does not meet the criteria to access this resource,” you are likely using a Microsoft EMU account or some other account that has stringent restrictions. You will need to use an external MCAPS subscription or another paid subscription to continue.
03: Sign in to Azure Developer CLI (azd)
The Azure Developer CLI is also used during certain exercises. Sign in to ensure it is ready.
Expand this section to view the solution
Run the following command to sign in:
azd auth login
A browser window will open prompting you to sign in. Complete the sign-in process and return to your terminal.
If you are in a remote environment, use:
azd auth login --use-device-code
Verify that you are logged in:
azd auth login --check-status
04: (Optional) Verify Docker installation
If you are using a GitHub Codespace, there is no docker installed. We will use workarround to build docker image without docker.
If you installed Docker Desktop or Rancher Desktop, verify that the Docker engine is running.
Expand this section to view the solution
Run the following command:
docker --version
You should see output indicating the Docker version. Then verify the engine is running:
docker info
If Docker is not running, start Docker Desktop or Rancher Desktop from your applications menu and wait for it to finish starting before retrying the commands.