Creating a common code repository for better manageability within a function app
In all our previous chapters, we wrote all the code in the run
function. I did that to make everything simple and focus more on conceptual stuff related to Azure Functions instead of code architecture and all. Now, it's time to discuss the features that Azure Functions provide related to code architecture and re-usability. Most of the recipes covered in this chapter talk about them.
In our RegisterUser
function, we could refactor the code into multiple classes and functions. However, we will not focus on refactoring all the code, but we will just pull out the code related to sending the emails.
Note
In your application, make sure you use the architectural design principles and practices based on your requirements.
Let's start refactoring the code.
How to do it...
- Create a new
ManualTrigger - C#
template, as shown in the following screenshot, with the nameSharedClasses
:

- Once the trigger is created, navigate to the...