Skip to content

Instantly share code, notes, and snippets.

Avatar

Paul Batum paulbatum

View GitHub Profile
@paulbatum
paulbatum / Function1.cs
Last active Jan 24, 2019
Event Hub Batch Example
View Function1.cs
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Microsoft.Azure.EventHubs;
using Microsoft.Azure.WebJobs;
using Microsoft.Extensions.Logging;
namespace FunctionApp12
@paulbatum
paulbatum / gist:f7170955a46971456da2e69926af9d9d
Created Oct 19, 2018
Notification Hubs WebJobs SDK Extension error
View gist:f7170955a46971456da2e69926af9d9d
DryIoc.ContainerException
HResult=0x80131509
Message=Unable to get constructor of NotificationHubsExtensionConfigProvider using provided constructor selector when resolving singleton NotificationHubsExtensionConfigProvider: IExtensionConfigProvider {ServiceKey=DefaultKey(4), ReturnDefaultIfNotRegistered} #105
in wrapper IEnumerable<IExtensionConfigProvider> as parameter "registeredExtensions" #1
in singleton DefaultExtensionRegistryFactory: IExtensionRegistryFactory #52
from container.
Source=Microsoft.Azure.WebJobs.Script.WebHost
StackTrace:
at DryIoc.Throw.ThrowIfNull[T](T arg, Int32 error, Object arg0, Object arg1, Object arg2, Object arg3) in C:\azure-webjobs-sdk-script\src\WebJobs.Script.WebHost\DependencyInjection\DryIoc\Container.cs:line 8939
at DryIoc.ReflectionFactory.CreateExpressionOrDefault(Request request) in C:\azure-webjobs-sdk-script\src\WebJobs.Script.WebHost\DependencyInjection\DryIoc\Container.cs:line 6996
View host.json
{
"version": "2.0",
"extensions": {
"http": {
"maxConcurrentRequests": 1,
"maxOutstandingRequests": 4
}
}
}
View assemblyload.md

Assembly Resolution in Azure Functions

The goal of this post is to help .NET developers better understand assembly resolution and loading problems and limitations.

One common provide guidance on how to avoid or mitigate some of those issues, when possible, and go over some of the details on how this will be improved in the next version of Azure Functions.

In the following sections, we dive into the details of how things work today

View myfunctions.cs
using System.Linq;
using System.Net;
using System.Net.Http;
using System.Threading.Tasks;
using Microsoft.Azure.WebJobs;
using Microsoft.Azure.WebJobs.Extensions.Http;
using Microsoft.Azure.WebJobs.Host;
namespace FunctionApp14
{
@paulbatum
paulbatum / Test1.cs
Created Dec 22, 2017
Example test project for testing the default http trigger in azure functions
View Test1.cs
using System;
using System.Diagnostics;
using System.Net;
using System.Net.Http;
using System.Threading.Tasks;
using System.Web.Http;
using FunctionApp22_UnitTesting;
using Microsoft.Azure.WebJobs.Host;
using Xunit;
@paulbatum
paulbatum / BCryptTest.cs
Created Nov 24, 2017
Functions Tiered Jit Test
View BCryptTest.cs
using System.IO;
using Microsoft.AspNetCore.Mvc;
using Microsoft.Azure.WebJobs;
using Microsoft.Azure.WebJobs.Extensions.Http;
using Microsoft.AspNetCore.Http;
using Microsoft.Azure.WebJobs.Host;
using Newtonsoft.Json;
namespace TieredJitTest
@paulbatum
paulbatum / EventHubTrigger.csx
Created Oct 11, 2017
Setting PartitionKey in Azure Functions
View EventHubTrigger.csx
#r "Microsoft.ServiceBus"
using System;
using System.Text;
using Microsoft.ServiceBus.Messaging;
public static void Run(EventData myEventHubMessage, TraceWriter log)
{
log.Info($"C# Event Hub trigger function processed a message with partition key: {myEventHubMessage.PartitionKey}");
}
@paulbatum
paulbatum / costcalculator.cs
Last active Apr 28, 2019
Azure Functions pricing calculation
View costcalculator.cs
const decimal executionCountCost = 0.20m / 1000000m;
const decimal gbSecCost = 0.000016m;
const decimal executionUnitsToGbSecConversion = 1m / (1024 * 1000);
long executionCountPerHour = 6500012;
long executionUnitsPerHour = 90305037184;
int runDurationDays = 9;
Console.WriteLine("All prices in USD");
You can’t perform that action at this time.