Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. Web Development
  3. Cloud Computing
  4. HttpRequest from Logic App is null

HttpRequest from Logic App is null

Scheduled Pinned Locked Moved Cloud Computing
databasecomcloudxmljson
2 Posts 1 Posters 9 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • T Offline
    T Offline
    TNCaver
    wrote on last edited by
    #1

    I've set up an Azure Logic App to pass the body of emails received in an Outlook 365 inbox to an Azure HTTP-triggered function, similar to the set up shown here: [Call Azure Functions from workflows - Azure Logic Apps | Microsoft Learn](https://learn.microsoft.com/en-us/azure/logic-apps/call-azure-functions-from-workflows?tabs=consumption#add-a-function-to-your-workflow-consumption--standard-workflows), although I am sending the email Body, not the "From" or "Received time" shown in the example. However, the logic app doesn't seem to be sending anything, as the HTTPRequest object received by the function is null. Any ideas what I've done wrong? The code of the logic app:

    {
    "definition": {
    "$schema": "https://schema.management.azure.com/providers/Microsoft.Logic/schemas/2016-06-01/workflowdefinition.json#",
    "actions": {
    "Pass_Email_Body_to_Function_MoveitEmailProcessor": {
    "inputs": {
    "body": {
    "emailBody": "@triggerBody()?['body']"
    },
    "function": {
    "id": "/subscriptions//resourceGroups//providers/Microsoft.Web/sites/my-azure-function-app/functions/myHttpTriggeredFunction"
    }
    },
    "runAfter": {},
    "type": "Function"
    }
    },
    "contentVersion": "1.0.0.0",
    "outputs": {},
    "parameters": {
    "$connections": {
    "defaultValue": {},
    "type": "Object"
    }
    },
    "triggers": {
    "When_a_new_email_arrives_(V3)": {
    "inputs": {
    "fetch": {
    "method": "get",
    "pathTemplate": {
    "template": "/v3/Mail/OnNewEmail"
    },
    "queries": {
    "folderPath": "Inbox",
    "from": "myemail@myemail.com"
    }
    },
    "host": {
    "connection": {
    "name": "@parameters('$connections')['office365_1']['connectionId']"
    }
    },
    "subscribe": {
    "body": {
    "NotificationUrl": "@{listCallbackUrl()}"
    },

    T 1 Reply Last reply
    0
    • T TNCaver

      I've set up an Azure Logic App to pass the body of emails received in an Outlook 365 inbox to an Azure HTTP-triggered function, similar to the set up shown here: [Call Azure Functions from workflows - Azure Logic Apps | Microsoft Learn](https://learn.microsoft.com/en-us/azure/logic-apps/call-azure-functions-from-workflows?tabs=consumption#add-a-function-to-your-workflow-consumption--standard-workflows), although I am sending the email Body, not the "From" or "Received time" shown in the example. However, the logic app doesn't seem to be sending anything, as the HTTPRequest object received by the function is null. Any ideas what I've done wrong? The code of the logic app:

      {
      "definition": {
      "$schema": "https://schema.management.azure.com/providers/Microsoft.Logic/schemas/2016-06-01/workflowdefinition.json#",
      "actions": {
      "Pass_Email_Body_to_Function_MoveitEmailProcessor": {
      "inputs": {
      "body": {
      "emailBody": "@triggerBody()?['body']"
      },
      "function": {
      "id": "/subscriptions//resourceGroups//providers/Microsoft.Web/sites/my-azure-function-app/functions/myHttpTriggeredFunction"
      }
      },
      "runAfter": {},
      "type": "Function"
      }
      },
      "contentVersion": "1.0.0.0",
      "outputs": {},
      "parameters": {
      "$connections": {
      "defaultValue": {},
      "type": "Object"
      }
      },
      "triggers": {
      "When_a_new_email_arrives_(V3)": {
      "inputs": {
      "fetch": {
      "method": "get",
      "pathTemplate": {
      "template": "/v3/Mail/OnNewEmail"
      },
      "queries": {
      "folderPath": "Inbox",
      "from": "myemail@myemail.com"
      }
      },
      "host": {
      "connection": {
      "name": "@parameters('$connections')['office365_1']['connectionId']"
      }
      },
      "subscribe": {
      "body": {
      "NotificationUrl": "@{listCallbackUrl()}"
      },

      T Offline
      T Offline
      TNCaver
      wrote on last edited by
      #2

      Found the issue. For anyone who runs across this or similar problem with an HTTP-Triggered Azure function in the future it may be because you are running the function in isolated worker mode. If so you must change the footprint of the function to look for an HttpRequestData object rather than an HttpRequest object in the Run parameters and return a HttpResponseData object like this:

      [Function(nameof(myHttpTriggeredFunction))]
      public static HttpResponseData Run([HttpTrigger(AuthorizationLevel.Anonymous, "post")] HttpRequestData req, FunctionContext executionContext)
      {
      // processing code here
      }

      There are no solutions, only trade-offs.
         - Thomas Sowell

      A day can really slip by when you're deliberately avoiding what you're supposed to do.
         - Calvin (Bill Watterson, Calvin & Hobbes)

      1 Reply Last reply
      0
      Reply
      • Reply as topic
      Log in to reply
      • Oldest to Newest
      • Newest to Oldest
      • Most Votes


      • Login

      • Don't have an account? Register

      • Login or register to search.
      • First post
        Last post
      0
      • Categories
      • Recent
      • Tags
      • Popular
      • World
      • Users
      • Groups