-1

I have a JavaScript httpTrigger Function on Azure that I want to call in another httpTrigger Function. Both are in the same resource group. I know about Durable Functions and Queue Storage but (according to my limited knowledge) neither is perfect in this scenario because:

  1. I'd have to change the Function to activityTrigger to use Durable Functions, meaning that I wouldn't be able to use it separately to handle HTTP requests.
  2. if I used the Function in Queue Storage, it would trigger the other Function every time it's called, which is not what I want.

Edit: I decided to go with Durable Functions after all. To anyone who wants to build a workflow on Microsoft infrastructure, there are typically a few options to choose from, including what was recommended by other users below:

  1. Durable Functions
  2. Logic App
  3. BizTalk Server
  4. HTTP request
michal
  • 67
  • 7

2 Answers2

0

You can use a http module to call another function

var http = require('http');

module.exports= function (context) {
  context.log('JavaScript HTTP trigger function processed a request.');

  var options = {
      host: '<Another Function URL>',
      port: '80',
      path: '/test',
      method: 'POST'
  };

SwethaKandikonda
  • 7,513
  • 2
  • 4
  • 18
0

I decided to use Durable Functions.

Durable Functions require setting up a storage service for the Function App. You'll need to add a few application settings in your Function App (below) but before you do that, back up your current functions.

  • WEBSITE_CONTENTSHARE — to get the value, navigate to your storage and go to File shares
  • WEBSITE_CONTENTAZUREFILECONNECTIONSTRING — use either of the Access keys from your storage account
  • AzureWebJobsStorage — use the storage account's name, which you can also get in Access keys
michal
  • 67
  • 7