Answers for "dynamically create azure functions"

0

dynamically create azure functions

PUT https://management.azure.com/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/functions/{functionName}?api-version=2016-08-01
Authorization: Bearer <Your Token>
Content-type: application/json
Body: "properties": {   
    "files":
    {         
    "index.js": "module.exports = async function (context, req) {\r\n    context.log('JavaScript HTTP trigger function processed a request.');\r\n    context.log(req.body.name);\r\n\r\n    if (req.query.name || (req.body && req.body.name)) {\r\n        context.res = {\r\n            \/\/ status: 200, \/* Defaults to 200 *\/\r\n            body: \"Hello \" + (req.query.name || req.body.name)\r\n        };\r\n    }\r\n    else {\r\n        context.res = {\r\n            status: 400,\r\n            body: \"Please pass a name on the query string or in the request body\"\r\n        };\r\n    }\r\n};"
    },
    "test_data": "",
    "config": {
      "bindings": [
        {
          "name": "req",
          "type": "httpTrigger",
          "direction": "in"
        },
        {
          "type": "http",
          "name": "res",
          "direction":"out"
        }
      ],
      "disabled": false
    }
  }
}
Posted by: Guest on January-17-2021

Code answers related to "dynamically create azure functions"

Browse Popular Code Answers by Language