Function Apps are stored using a basic file structure, as shown previously. Given this, they can be deployed through mechanisms that support a file structure in a similar way to Web Apps, including the use of continuous integration and continuous deployment.
Deployment options are available in the App Service settings.
Deployment credentials allows the setting of the username and password for deployment via FTP or Git. The FTP endpoint for the Function App can be found in Properties of the App Service.
Deployment options provides access in order to set up deployment from a number of sources.
For example, to set up Github as the deployment source, we would choose GitHub from the list. For most of the sources, we need to authorize access to the specific account. Once this has been provided, the source can be configured.
If Visual Studio Team Services is chosen as the deployment, it is not necessary to authorize access if the instance of Visual Studio Team Services has already been configured within the Azure subscription.
When developing functions, as with all development, it is important to ensure that it can be easily tested and that it is then fully tested before production deployment.
There are many ways to test a function, some of which have been shown previously through the chapter, but it is worth reviewing them here:
Using these approaches either individually or together there can be confidence that the function will operate as expected.
Function Apps can exist in the context of a current App Service Plan or App Service Environment, or it can be serverless and used via a Consumption Service Plan where the user needs to have no knowledge of or responsibility for the underlying infrastructure.
When used in an App Service Plan, the Function App can be scaled in the same way as any other service within an App Service plan by changing the plan settings.
When the Function App is in a Consumption Service Plan, it is scaled based on need. The unit of scale is the Function App itself, and scaling is automatic and adds new instances as required. When the instances are no longer required based on the demand, they are removed automatically.
Another important feature of Function Apps is the ability to monitor the executions of each function. Monitoring is available in each function via the Monitor tab.
You can look at the invocation logs to see the specific messages and the number of successful or failed messages, and drill in to the message content.
The live event stream displays a graphical representation of the performance of the specific function including number of executions started and completed each second, number of failed executions per second, and the average execution time.
Using the monitoring is not only a way of getting an understanding of how exactly a function is performing, but also a good way of checking on invocations of functions and if errors are detected across your application.