Skip to content

Instantly share code, notes, and snippets.

View brettsam's full-sized avatar

Brett Samblanet brettsam

  • Microsoft Corporation
  • Cincinnati, OH
  • X @brett_sam
View GitHub Profile
using System.Collections.Concurrent;
using System.Diagnostics;
using Azure.Storage.Blobs;
using Microsoft.ApplicationInsights;
using Microsoft.ApplicationInsights.Extensibility;
using Microsoft.Azure.Functions.Worker;
using Microsoft.Azure.Functions.Worker.Http;
using Microsoft.Extensions.Logging;
namespace Isolated
@brettsam
brettsam / Program.cs
Created February 11, 2022 17:11
EH Producer
using Azure.Messaging.EventHubs;
using Azure.Messaging.EventHubs.Producer;
using System.Text;
string connectionString = "<EH CONNSTRING>";
string eventHubName = "test";
int numOfEventsPerBatch = 10;
EventHubProducerClient producerClient = new EventHubProducerClient(connectionString, eventHubName);
@brettsam
brettsam / Dockerfile
Created July 26, 2021 22:41
Grpc Repro
ARG HOST_VERSION=3.2.0
FROM mcr.microsoft.com/dotnet/sdk:5.0 AS installer-env
ARG HOST_VERSION
COPY --from=mcr.microsoft.com/dotnet/core/sdk:3.1 /usr/share/dotnet /usr/share/dotnet
COPY . /src/dotnet-function-app
RUN cd /src/dotnet-function-app && \
mkdir -p /home/site/wwwroot && \
dotnet publish *.csproj --output /home/site/wwwroot
@brettsam
brettsam / MyLoadContext.cs
Last active May 21, 2021 14:36
ProxyBuilderRepro
using System.IO;
using System.Reflection;
using System.Runtime.Loader;
namespace ProxyBuilderRepro
{
public class MyLoadContext : AssemblyLoadContext
{
public MyLoadContext(string name)
: base(name)
public class ScheduleStatus
{
public DateTime Last { get; set; }
public DateTime Next { get; set; }
public DateTime LastUpdated { get; set; }
}
@brettsam
brettsam / Function1.cs
Created August 19, 2020 15:20
LoadContext Repro
using System.Net.Http;
using System.Threading.Tasks;
using Microsoft.Azure.WebJobs;
using Microsoft.Azure.WebJobs.Extensions.Http;
using Microsoft.Extensions.Logging;
namespace FunctionApp75
{
public static class Function1
{
Autofac
dotnet-aspnet-codegenerator-design
DotNetTI.BreakingChangeAnalysis
Google.Protobuf
Grpc.Core
Grpc.Core.Api
Marklio.Metadata
Microsoft.AI.DependencyCollector
Microsoft.AI.EventCounterCollector
Microsoft.AI.PerfCounterCollector
@brettsam
brettsam / deps.txt
Last active June 10, 2020 18:33
Comparing 13353 to hotfix
Autofac
dotnet-aspnet-codegenerator-design
DotNetTI.BreakingChangeAnalysis
Google.Protobuf
Grpc.Core
Grpc.Core.Api
Marklio.Metadata
Microsoft.AI.DependencyCollector
Microsoft.AI.EventCounterCollector
Microsoft.AI.PerfCounterCollector
static async Task Main(string[] args)
{
var connStr = "";
CloudStorageAccount storageAccount = CloudStorageAccount.Parse(connStr);
CloudBlobClient blobClient = storageAccount.CreateCloudBlobClient();
CloudBlobContainer container = blobClient.GetContainerReference("samples-workitems");
var _cancelTimeout = TimeSpan.FromMinutes(2);
container.CreateIfNotExists();
@brettsam
brettsam / Function1.cs
Last active November 15, 2019 17:55
Logging Repro
using System.IO;
using System.Threading.Tasks;
using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.Mvc;
using Microsoft.Azure.WebJobs;
using Microsoft.Azure.WebJobs.Extensions.Http;
using Microsoft.Extensions.Logging;
using Newtonsoft.Json;
namespace MyNamespace