Azure Functions

Add @sentry/node as a dependency:

npm install --save @sentry/node

To set up Sentry error logging for an Azure Function:

"use strict";

const Sentry = require("@sentry/node");

  dsn: "",

module.exports = async function(context, req) {
  try {
    await notExistFunction();
  } catch (e) {
    await Sentry.flush(2000);

  context.res = {
    status: 200,
    body: "Hello from Azure Cloud Function!",

You can obtain the DSN using your Sentry account from your organization's Settings > Projects > Client Keys (DSN) in the Sentry web UI.

Note: You need to call both captureException and flush for captured events to be successfully delivered to Sentry.

Check out Sentry's Azure sample apps for detailed examples. Refer to the JavaScript docs for more configuration options.

You can edit this page on GitHub.