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 as an event handler for Event Grid. However, it includes detailed PowerShell instructions and examples, which are primarily relevant to Windows environments, without offering equivalent Linux-native scripting examples (such as Bash or shell scripting). The PowerShell sections are given equal prominence to the CLI, and there is no mention of Linux-specific tools or patterns. This may give the impression of a Windows-centric approach, especially for users seeking Linux-native automation guidance.
Recommendations:
  • Clarify that Azure CLI commands are fully cross-platform and can be run on Linux, macOS, and Windows.
  • Consider providing Bash or shell script examples for automation scenarios, especially in sections where PowerShell is featured.
  • Explicitly mention that PowerShell Core is available cross-platform, or provide links to Linux installation instructions if PowerShell examples are retained.
  • Add a note or section highlighting Linux and macOS support for all command-line operations, and recommend CLI as the default for cross-platform compatibility.
  • Where possible, include troubleshooting or environment setup notes relevant to Linux users (e.g., authentication, environment variables).
GitHub Create pull request

Scan History

Date Scan ID Status Bias Status
2025-09-03 00:00 #100 completed ✅ Clean
2025-08-01 00:00 #67 completed ✅ Clean
2025-07-13 21:37 #48 completed ❌ Biased
2025-07-09 13:09 #3 cancelled ✅ Clean
2025-07-08 04:23 #2 cancelled ❌ Biased

Flagged Code Snippets

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
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: