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
โ ๏ธ
windows_tools
โ ๏ธ
missing_linux_example
Summary:
The documentation demonstrates a Windows-first bias, with Windows tools and workflows (Visual Studio, PowerShell, Windows command prompt) presented as the default or primary approach. Linux alternatives are mentioned but often as secondary, less detailed, or referenced externally. Some programming language setup instructions are Windows-centric, and Linux-specific guidance is sometimes relegated to links or brief notes. PowerShell and Windows command prompt are used for examples, while Linux equivalents are less prominent or missing in some sections.
Recommendations:
- Present Linux and Windows instructions in parallel, giving equal prominence to both platforms in all sections.
- For each command-line example (e.g., cloning repos, setting environment variables), provide both Windows (cmd/PowerShell) and Linux (bash) syntax side by side.
- In the prerequisites and setup sections, explicitly list Linux (and macOS, if supported) requirements and installation steps, not just as links but with inline instructions.
- Avoid language like 'This tutorial is oriented toward a Windows-based workstation'โinstead, state that the tutorial supports both Windows and Linux, and structure content accordingly.
- For programming language pivots, ensure Linux build/run instructions are as detailed as Windows ones (e.g., for C, include gcc/make/CMake on Linux, not just Visual Studio).
- Where PowerShell is used for key derivation, provide a bash/openssl equivalent with equal detail and explanation.
- Ensure all screenshots and UI walkthroughs are platform-neutral or provide Linux equivalents where applicable.
- Review all sections for implicit Windows assumptions (e.g., file paths, tool names) and provide cross-platform alternatives.
Create pull request
Flagged Code Snippets
$KEY='<group_primary_key>'
$REG_ID='<device_registration_id>'
$hmacsha256 = New-Object System.Security.Cryptography.HMACSHA256
$hmacsha256.key = [Convert]::FromBase64String($KEY)
$sig = $hmacsha256.ComputeHash([Text.Encoding]::ASCII.GetBytes($REG_ID))
$derivedkey = [Convert]::ToBase64String($sig)
echo "`n$derivedkey`n"
\azure-iot-sdk-c\cmake\azure_iot_sdks.sln
cd .\azure-iot-sdk-csharp\provisioning\device\samples\how to guides\SymmetricKeySample
D:\azure-iot-sdk-csharp\provisioning\device\samples\how to guides\SymmetricKeySample>dotnet run --i 0ne00000A0A --r sn-007-888-abc-mac-a1-b2-c3-d4-e5-f6 --p sbDDeEzRuEuGKag+kQKV+T1QGakRtHpsERLP0yPjwR93TrpEgEh/Y07CXstfha6dhIPWvdD1nRxK5T0KGKA+nQ==
Initializing the device provisioning client...
Initialized for registration Id sn-007-888-abc-mac-a1-b2-c3-d4-e5-f6.
Registering with the device provisioning service...
Registration status: Assigned.
Device sn-007-888-abc-mac-a1-b2-c3-d4-e5-f6 registered to contoso-hub-2.azure-devices.net.
Creating symmetric key authentication for IoT Hub...
Testing the provisioned device with IoT Hub...
Sending a telemetry message...
Finished.
cd azure-iot-sdk-node\provisioning\device\samples
set PROVISIONING_HOST=global.azure-devices-provisioning.net
set PROVISIONING_HOST=global.azure-devices-provisioning.net
set PROVISIONING_SYMMETRIC_KEY=<derived-device-key>
D:\azure-iot-sdk-python\samples\async-hub-scenarios>python provision_symmetric_key.py
The complete registration result is
sn-007-888-abc-mac-a1-b2-c3-d4-e5-f6
contoso-hub-2.azure-devices.net
initialAssignment
null
Will send telemetry from the provisioned device
sending message #1
sending message #2
sending message #3
sending message #4
sending message #5
sending message #6
sending message #7
sending message #8
sending message #9
sending message #10
done sending message #1
done sending message #2
done sending message #3
done sending message #4
done sending message #5
done sending message #6
done sending message #7
done sending message #8
done sending message #9
done sending message #10
set PROVISIONING_REGISTRATION_ID=<registration-id>
cd azure-iot-sdk-python\samples\async-hub-scenarios
$ cmake -Dhsm_type_symm_key:BOOL=ON -Duse_prov_client:BOOL=ON ..
-- Building for: Visual Studio 16 2019
-- Selecting Windows SDK version 10.0.19041.0 to target Windows 10.0.22621.
-- The C compiler identification is MSVC 19.29.30146.0
-- The CXX compiler identification is MSVC 19.29.30146.0
...
-- Configuring done
-- Generating done
-- Build files have been written to: C:/azure-iot-sdk-c/cmake