Challenge 03 - Create Backend API
<Previous Challenge - Home - Next Challenge>
Pre-requisites
- You should have completed Challenge 02
Introduction
Now that you have deployed an APIM service in Dev environment, you would now like to create a simple Hello World API that can be called via the APIM gateway and routes the calls to the backend API services hosted in Function Apps.
Description
For both scenarios, you should be able to:
- Add a function with HTTP Trigger that takes a name parameter and returns a simple message via a GET call. (e.g. “Hello [name]!”)
- Add a function with HTTP Trigger that sends name as a JSON payload and returns a simple message via a POST call. (e.g. “Hello [name]!”)
- Import the functions in API Management and name it Hello API.
- Test API GET and POST calls. To do this, students are free to use tools like Powershell Invoke-RestMethod, APIM Test tab in the Azure Portal, or Postman (highly recommended)
- For Scenario 1 - send call to the public AGW endpoint. If you are using Postman, you should install the Desktop app in the jumpbox VM.
- For Scenario 2 - send calls to the public APIM endpoint.
- Ensure that you have added Hello API to the Unlimited product.
- Browse to the Dev portal in a separate incognito/private broswer and test Hello API GET operation.
- Enable Application Insights for Hello API, keep the default values (e.g. sampling to the default value of 100%)
Success Criteria
- Verify that you are able to send GET and POST calls via the APIM endpoint and received HTTP 200 response.
Learning Resources
Advanced Challenges
- Use your newly acquired GitHub Action or DevOps Pipeline superpowers to deploy your Functions code to your Function app in a pipeline!
- Why not set up the Hello API and add it to the Unlimited API using Bicep?
Back to Top