This page contains Windows bias

About This Page

This page is part of the Azure documentation. It contains code examples and configuration instructions for working with Azure services.

Bias Analysis

Bias Types:
⚠️ windows_first
⚠️ powershell_heavy
⚠️ missing_linux_example
Summary:
The documentation exhibits a Windows bias by prioritizing Windows-specific tools (Visual Studio), providing detailed instructions for Windows environments first, and only referencing Linux or macOS alternatives via external links. PowerShell and Windows command prompt examples are given alongside Bash, but the development environment setup and simulation steps are heavily oriented toward Windows/Visual Studio, with Linux instructions deferred or omitted.
Recommendations:
  • Provide step-by-step instructions for setting up the development environment and building/running the Azure IoT C SDK on Linux (e.g., using gcc, make, cmake, and VS Code or other editors).
  • Include Linux/macOS command-line examples (e.g., bash, sh) alongside Windows/PowerShell/cmd examples throughout the tutorial, not just for environment variable setup.
  • Offer explicit guidance for running and debugging the simulated device sample on Linux, including how to build and execute the sample without Visual Studio.
  • Reference Linux prerequisites (e.g., gcc, make, cmake, git) directly in the prerequisites section, not only via external links.
  • Where UI steps are described (e.g., Azure Portal), note any differences for Linux users if applicable, or confirm parity.
  • Ensure that all critical steps (such as building, running, and troubleshooting the sample) are fully documented for both Windows and Linux users within the main tutorial, not just in linked resources.
GitHub Create pull request

Scan History

Date Scan ID Status Bias Status
2025-09-15 00:00 #112 completed ✅ Clean
2025-08-17 00:01 #83 in_progress ✅ Clean
2025-07-13 21:37 #48 completed ✅ Clean
2025-07-12 23:44 #41 in_progress ✅ Clean
2025-07-09 13:09 #3 cancelled ✅ Clean
2025-07-08 04:23 #2 cancelled ❌ Biased

Flagged Code Snippets

# PowerShell $env:RESOURCE_GROUP = "contoso-us-resource-group" $env:LOCATION = "westus" $env:DPS = "contoso-provisioning-service-SUFFIX" $env:TOASTER_HUB = "contoso-toasters-hub-SUFFIX" $env:HEATPUMP_HUB = "contoso-heatpumps-hub-SUFFIX"
The simulated devices use the derived device keys with each registration ID to perform symmetric key attestation. ## Prepare an Azure IoT C SDK development environment In this section, you prepare the development environment used to build the [Azure IoT C SDK](https://github.com/Azure/azure-iot-sdk-c). The SDK includes the sample code for the simulated device. This simulated device will attempt provisioning during the device's boot sequence. This section is oriented toward a Windows-based workstation. For a Linux example, see the set-up of the VMs in [Tutorial: Provision for geo latency](how-to-provision-multitenant.md). 1. Download the [CMake build system](https://cmake.org/download/). It's important that the Visual Studio prerequisites (Visual Studio and the 'Desktop development with C++' workload) are installed on your machine, **before** starting the `CMake` installation. Once the prerequisites are in place, and the download is verified, install the CMake build system. 2. Find the tag name for the [latest release](https://github.com/Azure/azure-iot-sdk-c/releases/latest) of the SDK. 3. Open a command prompt or Git Bash shell. Run the following commands to clone the latest release of the [Azure IoT Device SDK for C](https://github.com/Azure/azure-iot-sdk-c) GitHub repository. Use the tag you found in the previous step as the value for the `-b` parameter, for example: `lts_01_2023`.
If `cmake` doesn't find your C++ compiler, you might see build errors while running the command. If that happens, try running the command in the [Visual Studio command prompt](/dotnet/framework/tools/developer-command-prompt-for-vs). Once the build succeeds, the last few output lines look similar to the following output:
## Simulate the devices In this section, you update a provisioning sample named **prov\_dev\_client\_sample** located in the Azure IoT C SDK you set up previously. This sample code simulates a device boot sequence that sends the provisioning request to your Device Provisioning Service instance. The boot sequence causes the toaster device to be recognized and assigned to the IoT hub using the custom allocation policy. 1. In the Azure portal, select the **Overview** tab for your Device Provisioning Service and note down the **ID Scope** value. ![Extract Device Provisioning Service endpoint information from the portal blade](./media/quick-create-simulated-device-x509/copy-id-scope.png) 2. In Visual Studio, open the **azure_iot_sdks.sln** solution file that was generated by running CMake earlier. The solution file should be in the following location: `azure-iot-sdk-c\cmake\azure_iot_sdks.sln`. 3. In Visual Studio's *Solution Explorer* window, navigate to the **Provision\_Samples** folder. Expand the sample project named **prov\_dev\_client\_sample**. Expand **Source Files**, and open **prov\_dev\_client\_sample.c**. 4. Find the `id_scope` constant, and replace the value with your **ID Scope** value that you copied earlier.
Save the file. 2. On the Visual Studio menu, select **Debug** > **Start without debugging** to run the solution. In the prompt to rebuild the project, select **Yes**, to rebuild the project before running. The following output is an example of the simulated toaster device successfully booting up and connecting to the provisioning service instance to be assigned to the toasters IoT hub by the custom allocation policy:
Save the file. 2. On the Visual Studio menu, select **Debug** > **Start without debugging** to run the solution. In the prompt to rebuild the project, select **Yes** to rebuild the project before running. The following output is an example of the simulated heat pump device successfully booting up and connecting to the provisioning service instance to be assigned to the Contoso heat pumps IoT hub by the custom allocation policy:
5. Run the following command, which builds a version of the SDK specific to your development client platform. A Visual Studio solution for the simulated device will be generated in the `cmake` directory.
7. Right-click the **prov\_dev\_client\_sample** project and select **Set as Startup Project**. ### Simulate the Contoso toaster device 1. To simulate the toaster device, find the call to `prov_dev_set_symmetric_key_info()` in **prov\_dev\_client\_sample.c** which is commented out.