Share via

Programmatically getting error notification from Azure Function App

David Gardiner 51 Reputation points MVP
2021-07-02T04:07:09.88+00:00

I have an Azure Function that presumably has some configuration problem and so is failing to run. In the portal I see the following highlighted text:

111163-image.png

I have a continuous deployment script that deploys new versions of the function, and has a step after the new version is published to test that it can call an endpoint. In this instance that step failed (with 'Function host is not running.' which makes sense), but in that case I'd really like to include a bit more detail about why the function is failing by adding the text from the error/notification that's shown in the Portal.

It seems like the error happens so early in the lifecycle of the function that nothing gets logged to AppInsights. The Azure Function deployment logs themselves don't seem to contain any info (as the actual deployment part is fine, it's just when the function goes to run that it fails)

Is there an API or CLI command I can use to get that text?

Azure Functions
Azure Functions

An Azure service that provides an event-driven serverless compute platform.


1 answer

Sort by: Most helpful
  1. ChaitanyaNaykodi-MSFT 27,671 Reputation points Microsoft Employee Moderator
    2021-07-08T17:21:21.613+00:00

    Hello @David Gardiner , Just following up here to see if the issue was related to the misconfigured app-setting.

    In addition to that you can get the text for the error received by streaming the logs as mentioned here in the documentation. You can achieve this via Portal, VS Code, Core Tools, Azure CLI and Azure Powershell.

    Please let me know if there are any concerns. Thank you!

    Was this answer helpful?

    0 comments No comments

Your answer

Answers can be marked as 'Accepted' by the question author and 'Recommended' by moderators, which helps users know the answer solved the author's problem.