Sad Tux - Windows bias detected
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

Detected Bias Types
windows_first
missing_linux_example
windows_tools
Summary
The documentation is heavily oriented toward Windows users by exclusively referencing Visual Studio (a Windows-centric IDE) and its .http file support for making API calls. There are no examples or guidance for Linux users or for cross-platform tools/editors. The workflow assumes the use of Visual Studio and does not mention alternatives like VS Code, curl, Postman, or HTTPie, which are commonly used on Linux and macOS. While Azure CLI is cross-platform, the entire process is framed within the context of Visual Studio on Windows.
Recommendations
  • Add equivalent instructions for using cross-platform tools such as Visual Studio Code with the REST Client extension, curl, HTTPie, or Postman to make API requests.
  • Provide explicit examples for Linux and macOS users, including how to structure and send HTTP requests outside of Visual Studio.
  • Clarify that Visual Studio is primarily a Windows tool and suggest alternatives for non-Windows environments.
  • Include screenshots or terminal examples from Linux environments where appropriate.
  • Consider restructuring the article to present cross-platform methods first or in parallel with Visual Studio instructions, rather than focusing solely on Windows tooling.
GitHub Create Pull Request

Scan History

Date Scan Status Result
2026-01-14 00:00 #250 in_progress Clean Clean
2026-01-13 00:00 #246 completed Clean Clean
2026-01-11 00:00 #240 completed Clean Clean
2026-01-10 00:00 #237 completed Clean Clean
2026-01-09 00:34 #234 completed Clean Clean
2026-01-08 00:53 #231 completed Clean Clean
2026-01-06 18:15 #225 cancelled Clean Clean
2025-08-17 00:01 #83 cancelled Clean Clean
2025-07-13 21:37 #48 completed Clean Clean
2025-07-09 13:09 #3 cancelled Clean Clean
2025-07-08 04:23 #2 cancelled Biased Biased

Flagged Code Snippets

Your variables should now look something like this:

:::image type="content" source="media/how-to-use-apis/variables-token-control.png" alt-text="Screenshot of the control plane variables, including a token." lightbox="media/how-to-use-apis/variables-token-control.png":::

---

## Add requests

Now that your `.http` file is set up, you can add requests to the Azure Digital Twin APIs.

Start by opening the [Azure Digital Twins REST API reference](/rest/api/azure-digitaltwins/). This documentation contains details of all the operations covered by the APIs. Navigate to the reference page of the request you want to run. 

This article uses the [DigitalTwins Update API](/rest/api/digital-twins/dataplane/twins/digital-twins-update) from the data plane as an example.

1. **Add request template**: Copy the HTTP request shown in the reference documentation.

   :::image type="content" source="media/how-to-use-apis/copy-request.png" alt-text="Screenshot of the HTTP request in the Digital Twins API documentation." lightbox="media/how-to-use-apis/copy-request.png":::
 
    In Visual Studio, paste the request in a new line below the variables in your `.http` file. 
1. **Add parameters**: Look at the **URI Parameters** section of the reference documentation to see which parameter values are needed by the request. You can replace some with the [variables](#add-variables) you created earlier, and fill in other parameter values as appropriate. To reference a variable, put the variable name in double curly braces, like `{{variable}}`. For more information, see [Variables](/aspnet/core/test/http-files#variables).

    >[!NOTE]
    >For data plane requests, `digitaltwins-hostname` is also a parameter. Replace this parameter value with `{{hostName}}` to use the value of your host name variable.

    Here's how this step looks in an example request:
    
    :::image type="content" source="media/how-to-use-apis/add-parameters.png" alt-text="Screenshot of the request with parameters in Visual Studio." lightbox="media/how-to-use-apis/add-parameters.png":::

1. **Add authorization**: To specify authentication with your bearer token variable, add the following line (exactly as written) directly underneath the request.

    
    ---

    >[!NOTE]
    > If you need to access your Azure Digital Twins instance using a service principal or user account that belongs to a different Microsoft Entra tenant from the instance, you need to request a token from the Azure Digital Twins instance's "home" tenant. For more information on this process, see [Write app authentication code](how-to-authenticate-client.md#authenticate-across-tenants).

3. Copy the value of `accessToken` in the result. This value is your **token value** that you paste into Visual Studio to authorize your requests.

   :::image type="content" source="media/how-to-use-apis/console-access-token.png" alt-text="Screenshot of the console showing the result of the az account get-access-token command. The accessToken field with a sample value is highlighted." lightbox="media/how-to-use-apis/console-access-token.png":::

>[!TIP]
>This token is valid for at least five minutes and a maximum of 60 minutes. If you run out of time allotted for the current token, you can repeat the steps in this section to get a new one.

### Add token to `.http` file

In your `.http` file in Visual Studio, add another variable that holds the value of your token.

# [Data plane](#tab/data-plane)