| title | Azure CLI script sample - Create custom topic and send event | Microsoft Docs |
|---|---|
| description | This article provides a sample Azure CLI script that shows how to create a custom topic and send an event to the custom topic using Azure CLI. |
| ms.devlang | azurecli |
| ms.topic | sample |
| ms.date | 03/29/2022 |
| ms.custom | devx-track-azurecli |
This article provides a sample Azure CLI script that shows how to create a custom topic and send an event to the custom topic using Azure CLI.
[!INCLUDE quickstarts-free-trial-note]
[!INCLUDE azure-cli-prepare-your-environment.md]
[!INCLUDE cli-launch-cloud-shell-sign-in.md]
:::code language="azurecli" source="~/azure_cli_scripts/event-grid/create-topic-subscribe/event-grid.sh" id="FullScript":::
[!INCLUDE cli-clean-up-resources.md]
az group delete --name $resourceGroup
This script uses the following command to create the event subscription. Each command in the table links to command-specific documentation.
| Command | Notes |
|---|---|
az eventgrid event-subscription create |
Create an Event Grid subscription. |
- For information about querying subscriptions, see Query Event Grid subscriptions.
- For more information on the Azure CLI, see Azure CLI documentation.