Proposed Pull Request Change

title description services author ms.service ms.devlang ms.topic ms.date ms.author ms.custom ai-usage
Use Event Grid for App Configuration data change notifications Learn how to use Azure App Configuration event subscriptions to send key-value modification events to a web endpoint azure-app-configuration maud-lv azure-app-configuration csharp how-to 08/28/2026 malev devx-track-azurecli ai-assisted
📄 Document Links
GitHub View on GitHub Microsoft Learn View on Microsoft Learn
⚠ Content Truncation Detected
The generated rewrite appears to be incomplete.
Original lines: -
Output lines: -
Ratio: -
Raw New Markdown
Generating updated version of doc...
Rendered New Markdown
Generating updated version of doc...
+0 -0
+0 -0
--- title: Use Event Grid for App Configuration data change notifications description: Learn how to use Azure App Configuration event subscriptions to send key-value modification events to a web endpoint services: azure-app-configuration author: maud-lv ms.service: azure-app-configuration ms.devlang: csharp ms.topic: how-to ms.date: 08/28/2026 ms.author: malev ms.custom: devx-track-azurecli ai-usage: ai-assisted # Customer intent: I want to be notified or trigger a workload when a key-value is modified. --- # Use Event Grid for App Configuration data change notifications In this article, you learn how to set up Azure App Configuration event subscriptions to send key-value modification events to a web endpoint. Azure App Configuration users can subscribe to events emitted whenever key-values are modified. These events can trigger web hooks, Azure Functions, Azure Storage Queues, or any other event handler that is supported by Azure Event Grid. Typically, you send events to an endpoint that processes the event data and takes actions. However, to simplify this article, you send the events to a web app that collects and displays the messages. ## Prerequisites - Azure subscription - [create one for free](https://azure.microsoft.com/pricing/purchase-options/azure-account?cid=msft_learn). You can optionally use the Azure Cloud Shell. [!INCLUDE [cloud-shell-try-it.md](~/reusable-content/ce-skilling/azure/includes/cloud-shell-try-it.md)] If you choose to install and use the CLI locally, this article requires that you're running the latest version of Azure CLI (2.0.70 or later). To find the version, run `az --version`. If you need to install or upgrade, see [Install Azure CLI](/cli/azure/install-azure-cli). If you aren't using Cloud Shell, you must first sign in using `az login`. ## Create a resource group Event Grid topics are Azure resources and must be placed in an Azure resource group. The resource group is a logical collection into which Azure resources are deployed and managed. Create a resource group with the [az group create](/cli/azure/group) command. The following example creates a resource group named _`<ResourceGroupName>`_ in the *westus* location. Replace _`<ResourceGroupName>`_ with a unique name for your resource group. ```azurecli-interactive az group create --name <ResourceGroupName> --location westus ``` ## Create an App Configuration store Replace _`<AppConfigurationStoreName>`_ with a unique name for your configuration store, and _`<ResourceGroupName>`_ with the resource group you created earlier. The name must be unique because it is used as a DNS name. ```azurecli-interactive az appconfig create \ --name <AppConfigurationStoreName> \ --location westus \ --resource-group <ResourceGroupName> \ --sku free ``` ## Create a message endpoint Before subscribing to the topic, let's create the endpoint for the event message. Typically, the endpoint takes actions based on the event data. To simplify this quickstart, you deploy a [pre-built web app](https://github.com/Azure-Samples/azure-event-grid-viewer) that displays the event messages. The deployed solution includes an App Service plan, an App Service web app, and source code from GitHub. Replace _`<SiteName>`_ with a unique name for your web app. The web app name must be unique because it's part of the DNS entry. ```azurecli-interactive $sitename=<SiteName> az deployment group create \ --resource-group <ResourceGroupName> \ --template-uri "https://raw.githubusercontent.com/Azure-Samples/azure-event-grid-viewer/master/azuredeploy.json" \ --parameters siteName=$sitename hostingPlanName=viewerhost ``` The deployment may take a few minutes to complete. After the deployment has succeeded, view your web app to make sure it's running. In a web browser, navigate to: `https://<SiteName>.azurewebsites.net` You should see the site with no messages currently displayed. [!INCLUDE [register-provider-cli.md](~/reusable-content/ce-skilling/azure/includes/event-grid/register-provider-cli.md)] ## Subscribe to your App Configuration store You subscribe to a topic to tell Event Grid which events you want to track and where to send those events. The following example subscribes to the App Configuration you created, and passes the URL from your web app as the endpoint for event notification. Replace _`<EventSubscriptionName>`_ with a name for your event subscription. For _`<ResourceGroupName>`_ and _`<AppConfigurationStoreName>`_, use the values you created earlier. The endpoint for your web app must include the suffix `/api/updates/`. ```azurecli-interactive appconfigId=$(az appconfig show --name <AppConfigurationStoreName> --resource-group <ResourceGroupName> --query id --output tsv) endpoint=https://$sitename.azurewebsites.net/api/updates az eventgrid event-subscription create \ --source-resource-id $appconfigId \ --name <EventSubscriptionName> \ --endpoint $endpoint ``` View your web app again, and notice that a subscription validation event has been sent to it. Select the eye icon to expand the event data. Event Grid sends the validation event so the endpoint can verify that it wants to receive event data. The web app includes code to validate the subscription. ![View subscription event](./media/quickstarts/event-grid/view-subscription-event.png) ## Trigger an App Configuration event Now, trigger an event to see how Event Grid distributes the message to your endpoint. Create a key-value by using the _`<AppConfigurationStoreName>`_ from earlier. ```azurecli-interactive az appconfig kv set --name <AppConfigurationStoreName> --key Foo --value Bar --yes ``` You've triggered the event, and Event Grid sent the message to the endpoint you configured when subscribing. View your web app to see the event you just sent. ```json [{ "id": "00000000-0000-0000-0000-000000000000", "topic": "/subscriptions/{subscription-id}/resourceGroups/eventDemoGroup/providers/microsoft.appconfiguration/configurationstores/{appconfig-name}", "subject": "https://{appconfig-name}.azconfig.io/kv/Foo", "data": { "key": "Foo", "etag": "a1LIDdNEIV6wCnfv3xaip7fMXD3", "syncToken":"zAJw6V16=Njo1IzMzMjE3MzA=;sn=3321730" }, "eventType": "Microsoft.AppConfiguration.KeyValueModified", "eventTime": "2019-05-31T18:59:54Z", "dataVersion": "1", "metadataVersion": "1" }] ``` ## Clean up resources If you plan to continue working with this App Configuration and event subscription, do not clean up the resources created in this article. If you do not plan to continue, use the following command to delete the resources you created in this article. Replace _`<ResourceGroupName>`_ with the resource group you created above. ```azurecli-interactive az group delete --name <ResourceGroupName> ``` ## Next steps Now that you know how to create topics and event subscriptions, learn more about key-value events and what Event Grid can help you do: - [Reacting to Key-Value Events](concept-app-configuration-event.md) - [About Event Grid](../event-grid/overview.md) - [Azure Event Grid handlers](../event-grid/event-handlers.md)
Success! Branch created successfully. Create Pull Request on GitHub
Error: