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 page demonstrates a Windows bias by using a Windows-style file path (C:\Users\Documents\attachment.pdf) in the code example, without mentioning or providing a Linux/macOS equivalent. There are no examples or notes for Linux users regarding file paths or environment differences. The sample code and instructions assume a Windows environment, and there is no guidance for cross-platform usage.
Recommendations
  • Provide file path examples for both Windows (C:\Users\Documents\attachment.pdf) and Linux/macOS (/home/user/Documents/attachment.pdf) in the code sample or add a note about cross-platform file paths.
  • Explicitly mention that the .NET SDK and the example code are cross-platform and can be run on Windows, Linux, and macOS.
  • Add a section or note about running the sample on Linux/macOS, including any relevant differences (such as file permissions or path separators).
  • Ensure that all examples and instructions are inclusive of non-Windows environments to improve accessibility for Linux users.
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-12 00:00 #243 cancelled 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-09-08 00:00 #105 completed Clean Clean
2025-08-08 00:00 #74 completed Clean Clean
2025-07-13 21:37 #48 completed Biased Biased

Flagged Code Snippets

// Create the email content
var emailContent = new EmailContent("Welcome to Azure Communication Service Email APIs.")
{
    PlainText = "This email message is sent from Azure Communication Service Email.",
    Html = "<html><body><h1>Quick send email test</h1><br/><h4>This email message is sent from Azure Communication Service Email.</h4><p>This mail was sent using .NET SDK!!</p></body></html>"
};

// Create the EmailMessage
var emailMessage = new EmailMessage(
    senderAddress: "donotreply@xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx.azurecomm.net" // The email address of the domain registered with the Communication Services resource
    recipientAddress: "emailalias@contoso.com"
    content: emailContent);

// Create the EmailAttachment
var filePath = "C:\Users\Documents\attachment.pdf";
byte[] bytes = File.ReadAllBytes(filePath);
var contentBinaryData = new BinaryData(bytes);
var emailAttachment = new EmailAttachment("attachment.pdf", MediaTypeNames.Application.Pdf, contentBinaryData);

emailMessage.Attachments.Add(emailAttachment);

try
{
    EmailSendOperation emailSendOperation = emailClient.Send(WaitUntil.Completed, emailMessage);
    Console.WriteLine($"Email Sent. Status = {emailSendOperation.Value.Status}");

    /// Get the OperationId so that it can be used for tracking the message for troubleshooting
    string operationId = emailSendOperation.Id;
    Console.WriteLine($"Email operation id = {operationId}");
}
catch (RequestFailedException ex)
{
    /// OperationID is contained in the exception message and can be used for troubleshooting purposes
    Console.WriteLine($"Email send operation failed with error code: {ex.ErrorCode}, message: {ex.Message}");
}