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
}
}
}
Are there any code examples left?
New code examples in category Other
-
Other 2023-03-27 22:50:10 how to select the whole line in vscode with keyboard shortcut
-
Other 2022-03-27 22:45:24 income of a web developer
-
Other 2022-03-27 22:35:01 \pyrcc_main.py: File does not exist 'resources.qrc'
-
Other 2022-03-27 22:30:45 rick roll embed code
-
Other 2022-03-27 22:20:08 Circuit_04_Potentiometer
-
Other 2022-03-27 22:20:05 iterative power
-
Other 2022-03-27 22:15:11 flutter run all
-
Other 2022-03-27 22:10:05 when is karlson release
-
Other 2022-03-27 22:10:02 wp .htaccess example
-
Other 2022-03-27 22:00:08 bash pause in file read line by line