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

Bias Types:
⚠️ powershell_heavy
⚠️ windows_tools
⚠️ windows_first
Summary:
The documentation provides both Azure CLI and Azure PowerShell examples for configuring Service Bus queues and topics as event handlers for Azure Event Grid events. While Azure CLI is cross-platform, the inclusion of Azure PowerShell commands (which are most commonly used on Windows and have a Windows-centric history) introduces a Windows bias. Additionally, the PowerShell sections are given equal prominence to CLI, and there are no explicit Linux shell (e.g., Bash) or scripting examples, nor any mention of Linux-specific considerations. The documentation does not mention or demonstrate Linux-native tools or workflows beyond the CLI.
Recommendations:
  • Clarify that Azure CLI commands are fully supported and tested on Linux, macOS, and Windows.
  • Consider providing Bash script examples or explicitly noting that CLI commands work in Linux shells.
  • If PowerShell is included, mention that PowerShell Core is cross-platform and provide installation guidance for Linux users.
  • Add a brief section or note highlighting Linux compatibility and any differences (if any) when running commands on Linux.
  • Ensure that CLI examples appear before PowerShell examples to avoid the perception of Windows-first bias.
GitHub Create pull request

Scan History

Date Scan ID Status Bias Status
2025-07-12 23:44 #41 in_progress ❌ Biased
2025-07-12 00:58 #8 cancelled ✅ Clean
2025-07-10 05:06 #7 processing ✅ Clean

Flagged Code Snippets

You can also use the [`az eventgrid topic event-subscription`](/cli/azure/eventgrid/topic/event-subscription) command for custom topics, the [`az eventgrid system-topic event-subscription`](/cli/azure/eventgrid/system-topic/event-subscription) command for system topics, and the [`az eventgrid partner topic event-subscription create`](/cli/azure/eventgrid/partner/topic/event-subscription#az-eventgrid-partner-topic-event-subscription-create) command for partner topics. ### Use Azure PowerShell Use the [New-AzEventGridSubscription](/powershell/module/az.eventgrid/new-azeventgridsubscription) command with `-EndpointType` set to `servicebusqueue` and `-Endpoint` set to `/subscriptions/{AZURE SUBSCRIPTION}/resourceGroups/<RESOURCE GROUP NAME>/providers/Microsoft.ServiceBus/namespaces/<NAMESPACE NAME>/queues/<QUEUE NAME>`. Here's an example:
You can also use the [`New-AzEventGridSystemTopicEventSubscription`](/powershell/module/az.eventgrid/new-azeventgridsystemtopiceventsubscription) command for system topics, and the [`New-AzEventGridPartnerTopicEventSubscription`](/powershell/module/az.eventgrid/new-azeventgridpartnertopiceventsubscription) command for partner topics. ## Service Bus topics You can route events in Event Grid directly to Service Bus topics for command and control messaging scenarios. ### Use Azure portal In the Azure portal, while creating an event subscription, select **Service Bus Topic** as the endpoint type and then click **select an endpoint** to choose a Service Bus topic. :::image type="content" source="./media/handler-service-bus/topic.png" lightbox="./media/handler-service-bus/topic.png" alt-text="Screenshot showing the configuration of a Service Bus topic handler."::: ### Use Azure CLI Use the [`az eventgrid event-subscription create`](/cli/azure/eventgrid/event-subscription) command with `--endpoint-type` set to `servicebustopic` and `--endpoint` set to `/subscriptions/{AZURE SUBSCRIPTION}/resourceGroups/<RESOURCE GROUP NAME>/providers/Microsoft.ServiceBus/namespaces/<NAMESPACE NAME>/topics/<TOPIC NAME>`. Here's an example:
You can also use the [`az eventgrid topic event-subscription`](/cli/azure/eventgrid/topic/event-subscription) command for custom topics, the [`az eventgrid system-topic event-subscription`](/cli/azure/eventgrid/system-topic/event-subscription) command for system topics, and the [`az eventgrid partner topic event-subscription create`](/cli/azure/eventgrid/partner/topic/event-subscription#az-eventgrid-partner-topic-event-subscription-create) command for partner topics. ### Use Azure PowerShell Use the [New-AzEventGridSubscription](/powershell/module/az.eventgrid/new-azeventgridsubscription) command with `-EndpointType` set to `servicebustopic` and `-Endpoint` set to `/subscriptions/{AZURE SUBSCRIPTION}/resourceGroups/<RESOURCE GROUP NAME>/providers/Microsoft.ServiceBus/namespaces/<NAMESPACE NAME>/topics/<TOPIC NAME>`. Here's an example:
You can also use the [`New-AzEventGridSystemTopicEventSubscription`](/powershell/module/az.eventgrid/new-azeventgridsystemtopiceventsubscription) command for system topics, and the [`New-AzEventGridPartnerTopicEventSubscription`](/powershell/module/az.eventgrid/new-azeventgridpartnertopiceventsubscription) command for partner topics. [!INCLUDE [message-headers](./includes/message-headers.md)] When you send an event to a Service Bus queue or topic as a brokered message, the `messageid` of the brokered message is an internal system ID. The internal system ID for the message is maintained across redelivery of the event so that you can avoid duplicate deliveries by turning on **duplicate detection** on the service bus entity. We recommend that you enable duration of the duplicate detection on the Service Bus entity to be either the time-to-live (TTL) of the event or max retry duration, whichever is longer. ## Delivery properties Event subscriptions allow you to set up HTTP headers that are included in delivered events. This capability allows you to set custom headers that the destination requires. You can set custom headers on the events that are delivered to Azure Service Bus queues and topics. Azure Service Bus supports the use of following message properties when sending single messages. | Header name | Header type | | :-- | :-- | | `MessageId` | Dynamic | | `PartitionKey` | Static or dynamic | | `SessionId` | Static or dynamic | | `CorrelationId` | Static or dynamic | | `Label` | Static or dynamic | | `ReplyTo` | Static or dynamic | | `ReplyToSessionId` | Static or dynamic | | `To` |Static or dynamic | | `ViaPartitionKey` | Static or dynamic | > [!NOTE] > - The default value of `MessageId` is the internal ID of the Event Grid event. You can override it. For example, `data.field`. > - You can only set either `SessionId` or `MessageId`. For more information, see [Custom delivery properties](delivery-properties.md). ## REST examples (for PUT) ### Service Bus queue