Skip to content

Instantly share code, notes, and snippets.


Paweł Haracz PawelHaracz

View GitHub Profile
View C4Generator.cs
using Microsoft.Extensions.Options;
using Structurizr;
using Structurizr.Api;
namespace model.c4
public class C4Generator
private readonly Options.Structurizr _options;
private const string MicroserviceTag = "Microservice";
View Authenticate-example.html
<!DOCTYPE html>
<html lang="en">
<title>Serverless Authentication</title>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<meta http-equiv="X-UA-Compatible" content="ie=edge" />
<!-- Latest compiled and minified CSS -->

Merry Christmas and a Happy New Year!

I hope you will finish #25daysofserverless !!

PawelHaracz / AsyncHelper.cs
Last active Jun 5, 2019
the validator checks whitelist and decodes token and compare this with appId claim. An AsyncHelper invoke asynchronous method synchronously. A startup class is a normal .net core startup class
View AsyncHelper.cs
// Copyright (c) Microsoft Corporation, Inc. All rights reserved.
// Licensed under the MIT License, Version 2.0. See License.txt in the project root for license information.
/// <summary>
/// Helper created by microsoft
/// </summary>
public class AsyncHelper
PawelHaracz / AsyncHelper.cs
Created Jun 5, 2019
the validator checks whitelist and decodes token and compare this with appId claim;
View AsyncHelper.cs
public class AsyncHelper
private static readonly TaskFactory _myTaskFactory = new TaskFactory(CancellationToken.None,
TaskCreationOptions.None, TaskContinuationOptions.None, TaskScheduler.Default);
public static TResult RunSync<TResult>(Func<Task<TResult>> func)
var cultureUi = CultureInfo.CurrentUICulture;
var culture = CultureInfo.CurrentCulture;
return _myTaskFactory.StartNew(() =>
View sync-functions-triggers.ps1
Invoke-AzureRmResourceAction -ResourceGroupName <your-resource-group> -ResourceType "Microsoft.Web/sites" -ResourceName <Your-Azure-Function> -Action syncfunctiontriggers -ApiVersion "2018-02-01" -Force
View Qbank-Mesh.json
"$schema": "",
"contentVersion": "",
"parameters": {
"location": {
"type": "string",
"defaultValue": "[resourceGroup().location]"
"registryPassword": {
"type": "SecureString"
View dockerfile
FROM microsoft/dotnet:2.1-sdk AS build
# copy csproj and restore as distinct layers
COPY src/nuget.config ./src/
COPY src/*.sln ./src/
COPY src/Qbank.Questions/*.csproj ./src/Qbank.Questions/
COPY src/Qbank.Questions.WebApi/*.csproj ./src/Qbank.Questions.WebApi/
COPY test/Qbank.Questions.Test/*.csproj ./test/Qbank.Questions.Test/
PawelHaracz /
Created Sep 3, 2018 — forked from richlander/
ASP.NET Core dotnet and docker commands for HTTPS
dotnet dev-certs https -ep %USERPROFILE%\.aspnet\https\aspnetapp.pfx -p crypticpassword
dotnet dev-certs https --trust
docker pull microsoft/dotnet-samples:aspnetapp
docker run --rm -it -p 8000:80 -p 8001:443 -e ASPNETCORE_URLS="https://+;http://+" -e ASPNETCORE_HTTPS_PORT=8001 -e ASPNETCORE_Kestrel__Certificates__Default__Password="crypticpassword" -e ASPNETCORE_Kestrel__Certificates__Default__Path=/https/aspnetapp.pfx -v %USERPROFILE%\.aspnet\https:/https/ microsoft/dotnet-samples:aspnetapp
You can’t perform that action at this time.