Debugging Azure Function hosted in Azure using Visual Studio
In one of the previous recipes, Connecting to the Azure Storage from Visual Studio, you learned how to connect a storage account from the local code. In this recipe, you'll learn how to debug the live code running in the Azure cloud environment. You'll perform the following steps in the BlobTriggerCSharp
function of the FunctionAppinVisualStudio
function application:
- Change the path of the container in the Azure Management portal to that of the new container.
- Open the function application in Visual Studio 2019.
- Attach the debugger from within Visual Studio 2019 to the required Azure function.
- Create a blob in the new storage container.
- Debug the application after the breakpoints are hit.
Getting ready
Create a container named cookbookfiles-live
in the storage account. You'll be uploading a blob to this container.