Skip to content

Instantly share code, notes, and snippets.

@gregjhogan
gregjhogan / arm-template-hashtable-lookup.json
Last active April 10, 2018 18:41
ARM template SKU lookup
{
"$schema": "https://schema.management.azure.com/schemas/2015-01-01/deploymentTemplate.json#",
"contentVersion": "1.0.0",
"parameters": {
"sku": {
"type": "string",
"defaultValue": "B1"
}
},
"variables": {
@GeorgDangl
GeorgDangl / ApiKeyRequirement.cs
Created July 10, 2018 14:48
Using Policy Based API Key Authorization in ASP.NET Core
public class ApiKeyRequirement : IAuthorizationRequirement
{
public IReadOnlyList<string> ApiKeys { get; set; }
public ApiKeyRequirement(IEnumerable<string> apiKeys)
{
ApiKeys = apiKeys?.ToList() ?? new List<string>();
}
}