Prerequisites
You will need Visual Studio installed, with Azure development workload.
Scenario
Creating a personalized application for users.
Aim
Create a function that stores user details.
Steps for Completion
- Create a new function, called PostUser, using the HttpTrigger template. If you are competent in another language, like JavaScript or F#, you can try creating it in that language.
- Create a new model called User. Think about what properties you'd like to include, but as a minimum, you will need an email address and a unique identifier (these can be the same property).
- Modify the function to decode a JSON-formatted request into this model.
Outcome
You have a function ready to store user details.
Refer to the complete code placed at Code/Serverless-Architectureswith-Azure/Lesson 3/BeginningAzureServerlessArchitecture/Models/.
Before the transactions have taken place: User.cs: https://goo.gl/9FpHce.
After the transactions have taken place: PostUsers.cs: https://goo.gl/CWxA2S.