How to call another function with in an Azure function

前端 未结 6 826
醉话见心
醉话见心 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 01:15

    I din't find any good sources, I did the below, it worked fine.

    To call other function with its url, of below format:

    https://my-functn-app-1.azurewebsites.net/some-path-here1?code=123412somecodehereemiii888ii88k123m123l123k1l23k1l3==

    In Node.js, I called as below:

    let request_options = {
            method: 'GET',
            host: 'my-functn-app-1.azurewebsites.net',
            path: '/path1/path2?&q1=v1&q2=v2&code=123412somecodehereemiii888ii88k123m123l123k1l23k1l3',
            headers: {
                'Content-Type': 'application/json'
            }
    };
    require('https')
        .request(
             request_options,
             function (res) {
                   // do something here
             });
    

    Worked with no issues.
    It should work similar way for other programming languages.
    Hope this helps.

提交回复
热议问题