This is Sample project for Azure Functions. May this repository help you understand Azure Functions better.
What you can know
This sample include following.
|CSharpCompilerSlackOuthookCSharp||C#||No||Slack Interactive C# Code Roslyn Evaluation Sample. (
|CSharpCompilerWebhookCSharp||C#||No||Generic Webhook C# Code Roslyn Evaluation Sample.|
|DotNetFrameworkVersionResponseCSharp||C#||No||Retrurn .NET Framework Friendly Name by passing .NET Framework Release Registry Value.|
|ExternalCsxWebhookCSharp||C#||No||Reference external .csx usage Sample code.|
|GenericWebhookCSharpExtensionMethod||C#||No||Extension Method usage Sample code.|
|GithubWebhookCSharp||C#||No||Github Webhook Sample code.|
|LineBotWebhookCSharp||C#||No||Line Bot Webhook Sample code with Emergency Evacuation info with sent info.|
|SSLCertificateExpireCheck||C#||No||SSL Certificate Checker. Often introduce in AWS Lambda but you can do with C# + AzureFucntions, too!|
|VSTSWebhookCSharp||C#||No||Visual Studio Team Service (VSTS) Webhook Sample code.|
|WebhookCSharpGithubOctokit||C#||No||NuGet package reference sample for Octokit.|
|WebhookCSharpSendToChatWork||C#||No||Chatwork Notification Sample code.|
|WebhookCSharpSendToSlack||C#||No||Slack Notification Sample code.|
|src/PreCompiledFunctionSample||C#||Yes||Basic sample of PreCompiled Function. Build artifact will published right under root as PreCompiledFunctionSample.|
|src/PreCompileEnvironmentVariables||C#||Yes||Basic sample of PreCompiled Function with Logger. Build artifact will published right under root as PreCompileEnvironmentVariables.|
GitHub Integration Sample
You may find this repository structure is fit with Azure Functions CI by Github.
This repogitory Sync with Azure Functions by GitHub Integration.
Precompiled functions reference
Refer basic information with https://github.com/Azure/azure-webjobs-sdk-script/wiki/Precompiled-functions .
Following additional tips will be useful for first step.
|Precomplied function's Run signature will accept TraceWriter. Use Logger as same as .csx even you are using Precompile. You need to add Microsoft.Azure.WebJobs.Host nuget package to refer TraceWriter.|
|Precompiled function required to add Microsoft.AspNet.WebApi.Core nuget package for several HttpRequestMessage Extensions.|
|Precompiled function's dll will be locked by w3wp.exe when deployed function. You should kill w3wp.exe and restart AppService to deploy new PreCompiled dll.|
Recommend Azure Functions settings for stability
These settings are my recommendation with using AzureFunctions.
|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. Azure Functions host (0.x) are deprecated and will be remove starting February 1st, 2017. if you're using preview features, you continue to set your minor version explicitly (i.e. ~1.0), rather than just the major version(~1)..
You can find Release note here.
|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 in AppService 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.
|Stop nesting multiple Azure Functions, use
This is efficient and speedier way to call functions.
|Use AppSettings to store secret values. This eliminate sensitive value in the source code.
You can load it with both
C# sample with screenShot:
See C# Dev Samples for more details
There's are possible but I never recommend. These settings will bring complexity
|Default TimeZone is UTC, but you can use LocalTime zone with
You can obtain all timezone string with
Detail is here : Changing the server time zone on Azure Web Apps