In Azure Portal, you can get function URL directly from portal. there is also another way here that you can get Azure Function URL using Azure ARM API. But I want to know, Is there any way to get "Function URL" by code (Node.js, Python, ...) in Azure Function Apps directly?
1 Answer
For Node.js azure function, you can just use this line of code: req.originalUrl.
Detailed steps as below:
1.In Azure portal, create a Http Trigger function, select JavaScript as it's Programming Language.
2.In the index.js file, add this line of code: context.log(req.originalUrl);
3.Sample code like below:
module.exports = function (context, req) {
context.log(req.originalUrl);
//write you other logic below
};
3 Comments
Reza Amya
Thank you so much, it's working :). if there is any reference, I will be so much happier to know where it is.
Ivan Glasenberg
@RezaAmya, you can refer to this nodejs tutorial
Đonny
What if it's timer-triggered function?

