Skip to content

Files

Latest commit

50bdb45 · Jun 8, 2021

History

History
55 lines (32 loc) · 2.37 KB

functions-debug-event-grid-trigger-local.md

File metadata and controls

55 lines (32 loc) · 2.37 KB
title description author ms.topic ms.date ms.author
Azure Functions Event Grid local debugging
Learn to locally debug Azure Functions triggered by an Event Grid event
craigshoemaker
conceptual
10/18/2018
cshoe

Azure Function Event Grid Trigger Local Debugging

This article demonstrates how to debug a local function that handles an Azure Event Grid event raised by a storage account.

Prerequisites

  • Create or use an existing function app
  • Create or use an existing storage account. Event Grid notification subscription can be set on Azure Storage accounts for BlobStorage, StorageV2, or Data Lake Storage Gen2.
  • Download ngrok to allow Azure to call your local function

Create a new function

Open your function app in Visual Studio and, right-click on the project name in the Solution Explorer and click Add > New Azure Function.

In the New Azure Function window, select Event Grid trigger and click OK.

Create new function

Once the function is created, open the code file and copy the URL commented out at the top of the file. This location is used when configuring the Event Grid trigger.

Copy location

Then, set a breakpoint on the line that begins with log.LogInformation.

Set breakpoint

Next, press F5 to start a debugging session.

[!INCLUDE functions-event-grid-local-dev]

Debug the function

Once the Event Grid recognizes a new file is uploaded to the storage container, the break point is hit in your local function.

Start ngrok

Clean up resources

To clean up the resources created in this article, delete the test container in your storage account.

Next steps