Exercise - Set up Azure Sphere
Use this exercise as a setup checklist for the development computer and the attached Azure Sphere device. It covers current SDK and CLI installation, common connection troubleshooting, device claim and networking prerequisites, and development-mode preparation for later labs.
Troubleshooting
If you have trouble connecting to the Azure Sphere device over USB, first check that the device is attached and responsive.
az sphere device show-attachedOn Windows, you can also browse to
https://192.168.35.2/statusand dismiss the certificate warning. A response such as{"uptime":56}confirms direct device communication.Windows uses the Azure Sphere TAP-Windows Adapter V9 to communicate with Azure Sphere development boards over USB. The TAP adapter is required; don't remove VPN clients or TAP drivers as a blanket troubleshooting step.
If you see no TAP adapter, more than one TAP adapter, or a single TAP adapter that is not named Azure Sphere, follow the official TAP adapter repair steps. Open an elevated PowerShell or Command Prompt and run the documented repair sequence: uninstall the TAP adapters from Device Manager, then run the TAP driver installer:
powershell -ExecutionPolicy RemoteSigned -File "%ProgramData%\Microsoft\Azure Sphere\TapDriverInstaller\TapDriverInstaller.ps1" InstallThen restart the Azure Sphere Device Communication Service:
net stop AzureSphereDeviceCommunicationService net start AzureSphereDeviceCommunicationServiceReinstall the Azure Sphere SDK only if the TAP adapter is still missing after restarting the service. For full guidance, see Connection problems caused by TAP-Windows Adapter configuration.
If you use Cisco AnyConnect and the Azure Sphere TAP adapter appears unplugged, open the adapter properties and clear the Cisco AnyConnect Network Access Manager Filter Driver entry for the Azure Sphere TAP adapter. Then test again with
az sphere device show-attached.
Windows users. If the IoT Central ShowIoTCentralConfig command fails with a missing library message, close the tool, delete the
%LOCALAPPDATA%\Temp\.net\ShowIoTCentralConfigfolder, and then run ShowIoTCentralConfig again from a command prompt.
Azure Sphere SDK version
This learning module requires the latest Azure Sphere SDK and the Azure Sphere extension for Azure CLI. Use current az sphere commands for Azure Sphere operations. Azure Sphere (Legacy) service interfaces and PAPI retire on 27 September 2027, so update any older scripts or notes before that date.
Install the Azure CLI if you haven't already, and then add or update the Azure Sphere extension. To add the extension, run:
az extension add --name azure-sphere
If the extension is already installed, update it with:
az extension update --name azure-sphere
Important
A few early Seeed Azure Sphere MT3620 Development Kits require a manual OS update if they have never been used. Update the OS manually before you log in, claim the device, or connect the device to the internet. Other dev kits, including the Seeed MT3620 Mini Dev Board, or already-used Seeed Azure Sphere MT3620 Development Kits update automatically after connecting to the internet; manual update isn't required. For details, see Quickstart: Choose a catalog and claim your device.
Sign in and select the Azure subscription that contains, or will contain, your Azure Sphere catalog.
az login
az account set --subscription <subscription-id-or-name>
Windows users
This learning module supports developers on Linux and Windows using Visual Studio Code. However, if you are a Windows user comfortable using Visual Studio then you can still complete the exercises appreciating that the IDE screenshots included in this module will be different.
Use a PC running Windows 11 or Windows 10 Anniversary Update, or later.
You need to do the following:
- Install the latest Azure Sphere SDK.
- Install the Azure CLI and the Azure Sphere extension for Azure CLI.
- Install CMake and Ninja.
- Install Visual Studio Code.
- Install the Visual Studio Code Azure Sphere extension.
- Choose or create an Azure resource group and Azure Sphere catalog, and make sure your account has the required Azure RBAC permissions for the catalog.
- Claim your device into the catalog.
- Configure networking for the device.
The following Quickstart: Install the Azure Sphere SDK for Windows will step you through the process.
Install the Git client for Windows
The Git client is required to clone the Learning Path Labs and the Azure Sphere SDK Samples.
Install Git for Windows.
Install the GNU Arm Embedded Toolchain for Windows
The Arm toolchain is required only for real-time capable applications. For high-level applications, you can skip this step.
- Download the current Arm GNU Toolchain for Windows. Choose the arm-none-eabi toolchain that includes the compiler for the Arm Cortex-M4 processor.
- Install the toolchain. Visual Studio Code usually finds the installation automatically. If it doesn't, set Azure Sphere: Arm Gnu Path in Visual Studio Code to the toolchain installation directory.
- If the sample or project folder contains
vcpkg-configuration.json, you can instead use vcpkg artifacts to install and activate the toolchain for that project.
vcpkg artifact installation for Windows
From PowerShell, navigate to the real-time application project folder.
Verify that the project folder contains
vcpkg-configuration.json.Download and initialize vcpkg, and then activate the artifacts for the project.
iex (iwr -useb https://aka.ms/vcpkg-init.ps1) vcpkg activate
Ubuntu 22.04 or 24.04 LTS users
Use an x86-64 computer running 64-bit Ubuntu 22.04 LTS or Ubuntu 24.04 LTS. Other processor architectures, including Arm-based Linux computers, are not supported for the Azure Sphere SDK.
You need to do the following:
- Install the latest Azure Sphere SDK for Linux.
- Install the Azure CLI and the Azure Sphere extension for Azure CLI.
- Set up the device connection.
- Install CMake and Ninja. Don't install CMake or Ninja by using snap.
- Install Visual Studio Code.
- Install the Visual Studio Code Azure Sphere extension.
- Choose or create an Azure resource group and Azure Sphere catalog, and make sure your account has the required Azure RBAC permissions for the catalog.
- Claim your device into the catalog.
- Configure networking for the device.
The following Quickstart: Install the Azure Sphere SDK for Linux will step you through the process.
Install the Git client for Linux
The Git client is required to clone the Learning Path Labs and the Azure Sphere SDK Samples.
sudo apt install git
Install the GNU Arm Embedded Toolchain for Linux
The Arm toolchain is required only for real-time capable applications. For high-level applications, you can skip this step.
You can install the toolchain manually from Arm, or use vcpkg artifacts when the sample or project includes vcpkg-configuration.json.
Manual Arm toolchain installation
- Download the current Arm GNU Toolchain for Linux. Choose the arm-none-eabi toolchain that includes the compiler for the Arm Cortex-M4 processor.
- Follow the Arm installation instructions for your Linux distribution.
- If Visual Studio Code or command-line builds can't find the toolchain, add the toolchain
bindirectory that containsarm-none-eabi-gdbto yourPATH, or set Azure Sphere: Arm Gnu Path in Visual Studio Code to the toolchain installation directory.
vcpkg artifact installation
From a Linux terminal, navigate to the real-time application project folder.
Verify that the project folder contains
vcpkg-configuration.json.Download and initialize vcpkg, and then activate the artifacts for the project.
. <(curl https://aka.ms/vcpkg-init.sh -L) vcpkg activate
Recommended Visual Studio Code Extension
The Peacock extension allows you to change the color of your Visual Studio Code workspace. The Peacock extension is useful when you have multiple instances of Visual Studio Code open. In one of the exercises an instance of Visual Studio Code will be attached to the real-time core, and another instance will be attached to the high-level application core.
- Open Extensions sideBar panel in Visual Studio Code
- Or choose the menu options for View → Extensions
- Search for Peacock
- Click Install
- Click Reload, if required
Prepare the device for development and sideloading
Before you sideload an application or delete existing sideloaded applications, enable development on the device. This enables sideloading and debugging and assigns the device to a development device group that does not receive cloud application updates.
From the Windows PowerShell command line or Linux Terminal, sign in and set defaults for the subscription, resource group, and Azure Sphere catalog.
az login az account set --subscription <subscription-id-or-name> az config set defaults.group=<resource-group> defaults.sphere.catalog=<catalog>Confirm the attached device ID.
az sphere device list-attachedEnable development on the device. You must have the required Azure RBAC permissions on the catalog.
az sphere device enable-development --resource-group <resource-group> --catalog <catalog> --device <device-id>After development is enabled, delete any existing sideloaded applications on the device if the exercise needs a clean device.
az sphere device sideload deleteRestart Azure Sphere. This command depends on the catalog and resource group defaults set above; if those defaults aren't set in the current shell, add
--resource-group <resource-group> --catalog <catalog>explicitly. See theaz sphere device restartreference for the parameter list.az sphere device restart --device <device-id>
Enable real-time core debugging only when needed
Most high-level application exercises don't require real-time core debugging. Only complete this step when an exercise explicitly debugs a real-time capable application.
Open the appropriate command line for your operating system:
- On Windows, open PowerShell or Command Prompt as Administrator. The
--enable-rt-core-debuggingparameter installs USB debugger drivers, so the command requires an elevated shell. - On Linux, open a normal Terminal. The Azure Sphere SDK udev rules and
azspheregroup membership installed during SDK setup typically provide the access needed for this command. If the command fails with a permissions error, re-run it withsudo. See theaz sphere device enable-developmentreference, which annotates--enable-rt-core-debuggingwith "Requires administrator permissions."
az sphere device enable-development --resource-group <resource-group> --catalog <catalog> --device <device-id> --enable-rt-core-debugging- On Windows, open PowerShell or Command Prompt as Administrator. The
If you used an elevated Windows shell, close it after the command completes.
Clone the Azure Sphere Developer Learning Path
Note
Clone the Azure Sphere Developer Learning Path to a directory close to the root directory on your computer. For example, c:\lab, or ~/. The reason is that the Azure Sphere build process uses CMake which can struggle with long path and directory names.
git clone --depth 1 https://github.com/MicrosoftDocs/Azure-Sphere-Developer-Learning-Path.git Azure-Sphere
Clone the Azure Sphere samples
The Azure Sphere samples repository includes a tool required for listing Azure IoT Central network endpoints.
Clone this repository into the same directory that you cloned the Azure Sphere Developer Learning Path into.
git clone --depth 1 https://github.com/Azure/azure-sphere-samples.git