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 Windows bias by using a Windows-style file path (C:\Users\Documents\attachment.pdf) in the code example, omitting any Linux or cross-platform file path alternatives. There is no mention of Linux or macOS environments, nor are there instructions or examples for running the sample on non-Windows systems. The sample code and instructions implicitly assume a Windows environment.
Recommendations
  • Provide file path examples for both Windows (C:\Users\Documents\attachment.pdf) and Linux/macOS (/home/user/Documents/attachment.pdf) to illustrate cross-platform usage.
  • Explicitly mention that the .NET SDK and sample code are cross-platform and can be run on Windows, Linux, and macOS.
  • Add a note or section on running the sample on Linux/macOS, including any environment-specific considerations.
  • Use environment-agnostic methods for file paths in code samples, such as Path.Combine or Path.DirectorySeparatorChar.
  • Include screenshots or terminal output examples from Linux/macOS where appropriate.
GitHub Create Pull Request

Scan History

Date Scan Status Result
2025-07-12 23:44 #41 cancelled Biased Biased
2025-07-12 00:58 #8 cancelled Clean Clean
2025-07-10 05:06 #7 processing Clean Clean

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}");
}