Trying out Function as a Service — With Azure Function
This is the next article in my function-getting-started series, which aims to see which platform is quickest to move to in term of development effort
See my previous article with Google Function here
This time will be about Azure function.
Azure function documentation page
Same target as previous post, I want to quickly build up an API endpoint (HTTP trigger function) with will return a list of news sources
It will look like this as the result”:
Expected output
Now, let create our first function
Search for function in the dashboard
Create new function
Add detail for function
Azure function supports different scenarios to trigger and different languages. We’ll go with API/Webhook call and Javascript.
Selection function template (language and trigger type)
Now, let add up the content of our function to return what we want
Code for index.js
Then hit Save → Run
We can retrieve the URL for our function from “Get function URL” label above
Get function URL
Let’s try to call the function from POSTMAN client
POSTMAN result
Yay! we got our function now working as expected. Ready to scale and add more feature!