This is Sample project for Azure Functions. May this repository help you understand Azure Functions better.
I strongly recommend you to use v2 samples. v1 and csx are limited and obsolated.
Please refer v2/.
Reference | Description |
---|---|
Blog post - tech.guitarrapc.com | Blog post for AzureFuncitons by repository owner. |
Azure/Azure-Functions | AzureFunctions official repo. You may find where to report Issue, Feature Requests, Questions and Help. |
Microsoft Azure WebJobs SDK Quick Reference | Web Job SDK cheat sheet. |
Refer many samples and demo.
https://github.com/Azure/Azure-Functions/wiki/Samples-and-content
Following additional tips will be useful for first step.
Description | Screenshot |
---|---|
VS2017 Update3 and higher is required for v2. | |
Use v2 precompile function when you want to gain more faster execution and IDE compile, debug benefits. | |
Unfortunately .csx is not yet match friendly for VS Debugging. It will not detect compile error and less intellisense at all.Therefore you will find .csx will cause compile error on Function App portal so often. If you feel it reduce your efficiency, then use precompile instead. |
|
There are several way for local debug with post/get request, LinqPad, PowerShell, curl and others. I use PostMan Chrome extensions heavily when local debugging and remote debugging. |
These settings are my recommendation with using AzureFunctions.
Description | Screenshot |
---|---|
Concider to select Dynamic Service Plan if possible. This will bring you best cost efficiency and scalability. |
|
Keep your Azure Functions Runtime version up-to-date. Actually there's no meaning concider downtime because apply will be done in just a seconds. | |
Keep Function App Platform 32bit (don't change to 64bit) | |
Do not run out memory, add Dynamic Memory if needed! Default 128MB will be run out easiry. Upgrade to 256MB or higher as your app requires. Dynamic Plan pricing is relates to Memory size, but less meanful to concider. AzureFunctions pricing is here. |
|
Make sure your functions memory comsumptions will be less than 1536MB. This is limiation of Dynamic Service Plan. In case you exceed 1536MB there's 2 options. - Divide to separate functions. - Combine all functions to single App Service Plan. |
|
Use AppSettings to store secret values. This eliminate sensitive value in the source code. You can load it with both System.Environment.GetEnvironmentVariable("Key") or System.Configuration.ConfigurationManager.AppSettings["Key"] . C# sample with screenShot: GetEnvironmentVariable("Secret_Value") or ConfigurationManager.AppSettings["Secret_Value"]; See C# Dev Samples for more details |
|
appsettings.json is deprecated, use local.settings.json instead. |
|
Set AzureWebJobsStorage for Timer Triggers or others. | |
There's are possible but I never recommend. These settings will bring complexity.
Description | Screenshot |
---|---|
Don't use v1 from now. v2 is far more recommended. | |
Default TimeZone is UTC, but you can use LocalTime zone with WEBSITE_TIME_ZONE into Application Settings.You can obtain all timezone string with System.TimeZoneInfo.GetSystemTimeZones() Detail is here : Changing the server time zone on Azure Web Apps |
|
To keep Deployment simplicity, I never recommend mix up Precompile functions and .csx functions. |