Skip to content

Instantly share code, notes, and snippets.

View olafloogman's full-sized avatar

Olaf Loogman olafloogman

  • Sydney, NSW, Australia
View GitHub Profile
targetScope = 'resourceGroup'
@description('Resource name to check in current scope (resource group)')
param resourceName string
@description('Resource ID of user managed identity with reader permissions in current scope')
param identityPrincipalId string
param location string = resourceGroup().location
param utcValue string = utcNow()
[FunctionName("LiquidTransformer")]
public static async Task<HttpResponseMessage> Run([HttpTrigger(AuthorizationLevel.Function, "post", Route = "liquidtransformer/{liquidtransformfilename}")] HttpRequestMessage req,
[Blob("liquid-transforms/{liquidtransformfilename}", FileAccess.Read)] Stream inputBlob,
TraceWriter log)
{
log.Info("C# HTTP trigger function processed a request.");
}
static void Main(string[] args)
{
HttpClient client = new HttpClient();
// STS
string cloud = "https://login.microsoftonline.com";
string tenantId = "e0e04c7d-4d23-4078-9562-cea9be7bffed";
string authority = $"{cloud}/{tenantId}";
// Application
{
"aud": "a3439c32-d6b0-474d-9858-a18ec2ccee34",
"iss": "https://sts.windows.net/e0e04c7d-4d23-4078-9562-cea9be7bffed/",
"iat": 1543195219,
"nbf": 1543195219,
"exp": 1543199119,
"acr": "1",
"aio": "WSQA2/8JAAAAwckn0nW5xdREv07jXYtrTRntXLTrURn34W7tvirCijs=",
"amr": [
"pwd"
{
"id": "d6c777d2-a522-4c11-8bf2-3dc03f56ba5c",
"accessTokenAcceptedVersion": null,
"allowPublicClient": false,
"appId": "f0439c32-d6b0-474d-9858-a18ea2ccee99",
"appRoles": [
{
"allowedMemberTypes": [
"User",
"Application"
"createdDateTime": "2018-11-26T01:45:29Z",
"groupMembershipClaims": "All",
"identifierUris": [
"https://loogman.onmicrosoft.com/ac4871ea-f9bb-6c1d-83ae-ef4ea22dd503"
],
<policies>
<inbound>
<base />
<validate-jwt header-name="Authorization" failed-validation-httpcode="401" failed-validation-error-message="Unauthorized" require-expiration-time="true" require-scheme="Bearer" require-signed-tokens="true" clock-skew="0">
<openid-config url="https://login.microsoftonline.com/e0e04c7d-4d23-4078-9562-cea9be7bffed/v2.0/.well-known/openid-configuration" />
<issuer-signing-keys>
<key>MIIDBTCCAe2gAwIBAgIQKGZsKfAUzaJHVantyrwVdzANBgkqhkiG9w0BAQsFADAtMSswKQYDVQQDEyJhY2NvdW50cy5hY2Nlc3Njb250cm9sLndpbmRvd3MubmV0MB4XDTE4MTAwMTAwMDAwMFoXDTIwMTAwMTAwMDAwMFowLTErMCkGA1UEAxMiYWNjb3VudHMuYWNjZXNzY29udHJvbC53aW5kb3dzLm5ldDCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBAJrUafn5X9QkUDRCyYHsbK3tGgcQ1GiHEcrJmmAcVsYB9K9nH3cKHu3nVraOazG5EpF1ccVfPevQs+lg5l90pjkgHVTLt51V3CDlSG5yCOUc/Vuo+WKyJ8j/xT0P17meFjH17iLRlzfG6H3pdXoQW4UvWBL4BaXzwQr0g9SVQq1A/2GbVxRj0tPvvZ3E8TTxHLKNzSa6fhQxEmfH/J340QdZn3Hj8BnSrLs53S9xRj2y5/IaTuGV5/ysrCJmuFwZ6r27NF9AKlhBv4O2my+txzPQ
{
"$schema": "http://json.schemastore.org/proxies",
"proxies": {
"logic": {
"matchCondition": {
"route": "/api/logic"
},
"backendUri": "https://%LogicAppBackEndUri%&name={request.querystring.name}"
}
}
Param(
[string] $AppName
)
$ResourceGroupName = $AppName + "-rg"
$FunctionName = $AppName + "-func"
$needPsLogin = $true
Try
{
"$schema": "https://schema.management.azure.com/schemas/2015-01-01/deploymentTemplate.json#",
"contentVersion": "1.0.0.0",
"parameters": {
"logicAppLocation": {
"type": "string",
"defaultValue": "[resourceGroup().location]"
},
"storageAccountType": {
"type": "string",