Search icon
Arrow left icon
All Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Newsletters
Free Learning
Arrow right icon
Learning Azure Functions

You're reading from  Learning Azure Functions

Product type Book
Published in Sep 2017
Publisher Packt
ISBN-13 9781787122932
Pages 240 pages
Edition 1st Edition
Languages
Concepts

HTTP trigger


The HTTP trigger is normally used to create the API or services, where we request for data using the HTTP protocol and get the response. We can also integrate the HTTP trigger with a Webhook.

Let's start creating the HTTP trigger. We have already created a simple Azure Function and trigger. Now we will create the HTTP Login API. In this, we will send the login credential through an HTTP post request and get the response as to whether the user is valid or not.

Since we have already created a Function app in the previous example, we can now add multiple functions to it.

  1. Click on + |, select HttpTrigger-JavaScript, provide the function name, and click on the Create button:
  1. After we click on the Create button, the default template will be available. Now, we can edit and test the function:
  1. Now edit the code as follows:
  1. Save and run the code, as shown in the following screenshot:
  1. The login service is ready. Now let's check this service in Postman.
  2. To get the URL from the function, click on...
lock icon The rest of the chapter is locked
Register for a free Packt account to unlock a world of extra content!
A free Packt account unlocks extra newsletters, articles, discounted offers, and much more. Start advancing your knowledge today.
Unlock this book and the full library FREE for 7 days
Get unlimited access to 7000+ expert-authored eBooks and videos courses covering every tech area you can think of
Renews at €14.99/month. Cancel anytime}