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
powershell_heavy
Summary
The documentation page demonstrates a strong Windows bias throughout. All code samples and application instructions are based on C#/.NET and target Windows platforms (e.g., Windows Store app, Windows toast notifications). The deployment workflow is described exclusively using Visual Studio and Azure WebJobs, both of which are Windows-centric tools. There are no Linux, cross-platform, or non-Windows examples, nor is there mention of how to implement or deploy the solution on Linux or using non-Windows tools.
Recommendations
  • Add equivalent sample code and instructions for Linux environments, such as using .NET Core/6+ on Linux, or alternative languages (e.g., Python, Node.js) that are cross-platform.
  • Provide examples of deploying the backend listener as an Azure Function or containerized service, which can be developed and run on Linux as well as Windows.
  • Include instructions for command-line deployment and management (e.g., using Azure CLI, Bash scripts) instead of or in addition to Visual Studio and right-click workflows.
  • Demonstrate how to send notifications to non-Windows mobile platforms (e.g., Android, iOS) using Notification Hubs, with relevant code samples.
  • Explicitly mention cross-platform options and clarify which steps are Windows-specific, offering alternatives where possible.
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-12 23:44 #41 cancelled Biased Biased

Flagged Code Snippets

    private async void InitNotificationsAsync()
    {
        var channel = await PushNotificationChannelManager.CreatePushNotificationChannelForApplicationAsync();

        var hub = new NotificationHub("[HubName]", "[DefaultListenSharedAccessSignature]");
        var result = await hub.RegisterNativeAsync(channel.Uri);

        // Displays the registration ID so you know it was successful
        if (result.RegistrationId != null)
        {
            var dialog = new MessageDialog("Registration successful: " + result.RegistrationId);
            dialog.Commands.Add(new UICommand("OK"));
            await dialog.ShowAsync();
        }
    }
    
    static async Task ReceiveMessageAndSendNotificationAsync(string connectionString)
    {
        // Initialize the Notification Hub
        string hubConnectionString = ConfigurationManager.AppSettings.Get
                ("Microsoft.NotificationHub.ConnectionString");
        hub = NotificationHubClient.CreateClientFromConnectionString
                (hubConnectionString, "enterprisepushservicehub");

        ServiceBusClient Client = new ServiceBusClient(connectionString);
        ServiceBusReceiver receiver = Client.CreateReceiver(topicName, subscriptionName);

        // Continuously process messages received from the subscription
        while (true)
        {
            ServiceBusReceivedMessage message = await receiver.ReceiveMessageAsync();
            var toastMessage = @"<toast><visual><binding template=""ToastText01""><text id=""1"">{messagepayload}</text></binding></visual></toast>";

            if (message != null)
            {
                try
                {
                    Console.WriteLine(message.MessageId);
                    Console.WriteLine(message.SequenceNumber);
                    string messageBody = message.Body.ToString();
                    Console.WriteLine("Body: " + messageBody + "\n");

                    toastMessage = toastMessage.Replace("{messagepayload}", messageBody);
                    SendNotificationAsync(toastMessage);

                    // Remove message from subscription
                    await receiver.CompleteMessageAsync(message);
                }
                catch (Exception)
                {
                    // Indicate a problem, unlock message in subscription
                    await receiver.AbandonMessageAsync(message);
                }
            }
        }
    }
    static async void SendNotificationAsync(string message)
    {
        await hub.SendWindowsNativeNotificationAsync(message);
    }