How to call another function with in an Azure function

前端 未结 6 963
醉话见心
醉话见心 2021-02-07 00:21

I have written 3 functions as follows

  1. create users in db
  2. fetch users from db
  3. process users

In [3] function, I will call [2] functi

6条回答
  •  甜味超标
    2021-02-07 00:52

    I know we have Durable Functions but I call my functions like a normal static method and it works, here an example :

    public static class HelloWorld
    {
        [FunctionName("HelloWorld")]
        public static string Run([HttpTrigger(AuthorizationLevel.Anonymous, "get", Route = null)] HttpRequest req, ILogger log)
        {
            return "Hello World";
        }
    
    }
    
    public static class HelloWorldCall
    {
        [FunctionName("HelloWorldCall")]
        public static string Run([HttpTrigger(AuthorizationLevel.Anonymous, "get", Route = null)] HttpRequest req, ILogger log)
        {
            var caller = HelloWorld.Run(req, log);
            return caller;
        }
    
    }
    

提交回复
热议问题