|
|
|
|
|
What is Azure functions template
|
|
While creating Azure Functions with Visual Studio and visual studio code, IDE provides different project templates which are used to create function triggers which can be deployed to Azure Function App. Below are the different function templates available in Visual Studio - Blob Trigger - Creates a function trigger when a blob is added to a container
- Cosmos DB Trigger - Creates a function trigger when a document change in document collection
- Event Grid Trigger - Creates a function trigger when an event grid receives a new event
- Event Hub Trigger - Creates a function trigger when an event hub receive a new event
- HTTP Trigger - Creates function triggered by HTTP Request
- IoT Hub Trigger - Creates a function trigger when an IoT hub receives a new event on the event hub endpoint
- Queue Trigger - Creates a function trigger when a message is added to specified azure storage
- Service Bus Queue Trigger - Creates a function trigger when a message is added to specified service bus queue
- Service Bus Topic Trigger - Creates a function trigger when a message is added to specified service bus topic
- Timer Trigger - Creates a function trigger on a specified schedule
|
|
|
|
|
|
What is Azure Functions Runtime?
|
|
Azure Function Runtime is a specific version runtime where your Function App runs on top of it. Currently Azure function supports 3 versions of runtime host - 1.x - Supports .NET Framework
- 2.x - Supports .NET Core2.1
- 3.x - supports .NET Core3.1
All 3 versions are supported for your production workloads. By default, Function Apps are created in 3.x version runtime. If you are using C# language to develop Azure functions and visual studio gives below options as function runtime while creating Function App - Azure Functions V3(.NET Core)
- Azure Functions V2(.NET Core)
- Azure Functions V1(.NET Framework)
In order to find the function version number in your project, refer .csproj file. 1.x version setting in .csproj file<TargetFramework>net461</TargetFramework> <AzureFunctionsVersion>v1</AzureFunctionsVersion>
2.x version setting in .csproj file<TargetFramework>netcoreapp2.1</TargetFramework> <AzureFunctionsVersion>v2</AzureFunctionsVersion>
3.x version setting in .csproj file<TargetFramework>netcoreapp2.1</TargetFramework> <AzureFunctionsVersion>v2</AzureFunctionsVersion>
We are just referring C# as language, for other languages refer Azure Functions documentation.
|
|
|
What is Azure Functions Premium plan?
|
|
Once the Azure functions are developed and deployed to azure, then you pay per use pricing model. Azure function has below hosting plans - Dedicated app service plan
- Consumption plan
- Premium plan (called as elastic premium plan)
Azure functions Premium plan is a higher plan compared to other 2 plans. It contains following features - VNET Integration- To add more security to your app, you can configure a VNET and add your function app. With this, your function app is secured with service endpoints. VNET integration is not available in other plans.
- Pre-warmed instances to avoid cold start - In consumption plan, if there are no execution/calls to your function app it scales in to Zero instances. Once it goes to zero instances, if we make any function call, it takes some time(called as cold start time) to respond to the first call (from zero to one). This latency can be avoided in Premium plan with pre-warmed instances.
- Unlimited execution duration - Consumption plan has a 10 minutes limit whereas Premium plan defaults to 30 minutes but you can modify it to unlimited(60 minutes guaranteed). Use functiontTimeout property in host.json file to change the configuration.
- Premium hardware - Provides best cores(1, 2 and 4), memory and storage.
- Multiple function apps can be deployed to the same plan and all function apps in premium plan shares pre-warmed active instances.
- Automatic Scaling - Like consumption plan, your app will scale in or scale out based on the need.
Note: Premium plan is charged based on the number of core seconds, memory used and configured pre-warmed instances.
|
|
|
How do I deploy a function app in Azure?
|
|
Once the Azure functions are developed and there are different ways you can deploy your app to Azure. The different deployment methods are - Tool based deployments - deployments are managed locally. Useful when you are doing local development and requires multiple ad-hoc deployments manually.
- Visual Studio Code publish
- Visual Studio publish
- Core tools deployments (using Zip deploy or docker container)
- App Service Deployment - deployments are managed from the Azure App Service under Deployment section. Useful when you want to deploy as part of source control commits or from a container registry.
- Deployment center - Continuous deployment using Azure Repos, GitHub, Bitbucket and Local Git or Manual deployment using One drive, Dropbox, External Git and FTP.
- Container deployments
- External Pipelines - deployment are managed by pipelines. Useful for Production scenarios where you want to do some additional validations as part CI/CD.
|
|
|
|
|
|
|
|
|
|
What are the features of Azure functions?
|
|
Below are few features of Azure functions - Serverless - Focus more on building your apps faster to add business value without managing infrastructure.
- Language of your choice - Develop your function code using C#, Java, JavaScript, Powershell and Python languages of your choice
- Custom development - Bring your own dependencies using Nuget and NPM to extend your application logic.
- Continuous Integration and Deployment - Set up your function code with continuous integration and deployment using GitHub, Azure DevOps, bitbucket and other CI/CD processes.
- Built-in Security - Protect your functions with SSL Bindings, VNet integration and OAuth providers. You can authenticate users with the OAuth standard from providers such as Active Directory, Facebook, Twitter, Google, and Microsoft Account
- Scale on demand - Automatically scale out whenever there is a need by adding compute power and scale in when the code is stopped running
- Optimized Pricing - Pay only when your app runs.
- Performance and Monitoring - Easily configure Azure App Insight to your App for monitoring and analyzing the app performance
- Connect to Other Services - Use triggers and bindings that enable your serverless applications to respond to events and connect to other services seamlessly
- Choice of hosting plan - Based on your need, you can opt for Consumption, Premium or App Service Plan
|
|
|
|