Skip to content

Instantly share code, notes, and snippets.

View cdennig's full-sized avatar
🏠
Working from home...

Christian Dennig cdennig

🏠
Working from home...
View GitHub Profile
@cdennig
cdennig / webapp.json
Last active August 18, 2017 09:09
Azure WebApp
{
"apiVersion": "2015-08-01",
"name": "[variables('apiSiteName')]",
"type": "Microsoft.Web/sites",
"location": "[resourceGroup().location]",
"dependsOn": [
"[resourceId('Microsoft.Cache/Redis/', variables('RedisCache').Name)]",
"[resourceId('Microsoft.Search/searchServices/', variables('searchAppName'))]",
"[resourceId('Microsoft.Cdn/profiles/', variables('profileName'))]",
"[resourceId('Microsoft.Web/serverFarms/', parameters('apiHostingPlanName'))]"
@cdennig
cdennig / webapp_slot.json
Last active August 18, 2017 09:10
Azure WebApp Slot
{
"name": "[concat(variables('apiSiteName'), '/staging')]",
"type": "Microsoft.Web/sites/slots",
"location": "[resourceGroup().location]",
"apiVersion": "2015-08-01",
"dependsOn": [
"[resourceId('Microsoft.Web/Sites', variables('apiSiteName'))]"
],
"tags": {
"[concat('hidden-related:', resourceGroup().id, '/providers/Microsoft.Web/serverfarms/', parameters('apiHostingPlanName'))]": "Resource",
@cdennig
cdennig / storage_cdn.json
Last active August 18, 2017 09:10
Azure Storage Account plus CDN
{
"name": "[variables('storageName')]",
"type": "Microsoft.Storage/storageAccounts",
"location": "[resourceGroup().location]",
"apiVersion": "2016-01-01",
"sku": {
"name": "Standard_LRS",
"tier": "Standard"
},
"kind": "BlobStorage",
@cdennig
cdennig / adminkeys.json
Created August 18, 2017 09:20
List Admin Keys / Redis / Azure Search
// Redis
"redis": {
"value": "[concat(reference(resourceId('Microsoft.Cache/Redis', variables('RedisCache').Name)).hostName, variables('RedisCache').WebAppRedisSettingText, listKeys(resourceId('Microsoft.Cache/Redis', variables('RedisCache').Name), '2015-08-01').primaryKey)]",
"type": "Custom"
}
// Search
"properties": {
"Search:Key": "[listAdminKeys(resourceId('Microsoft.Search/searchServices/', variables('searchAppName')), '2015-08-19').primaryKey]",
}
@cdennig
cdennig / redis_search.json
Last active August 18, 2017 09:21
Azure Redis Cache plus Azure Search
{
"type": "Microsoft.Cache/Redis",
"name": "[variables('RedisCache').Name]",
"apiVersion": "2016-04-01",
"location": "[resourceGroup().location]",
"tags": {
"displayName": "Redis Cache"
},
"properties": {
"redisVersion": "3.0",
@cdennig
cdennig / apsettings.json
Last active September 6, 2017 18:53
B2C config
{
"AzureAdB2C": {
"Instance": "https://login.microsoftonline.com/tfp/",
"ClientId": "8b2b1e43-a2f7-4538-afbf-9b7ac293ea1f",
"Domain": "aureliab2c.onmicrosoft.com",
"SignUpSignInPolicyId": "B2C_1_signupin"
},
"Logging": {
"IncludeScopes": false,
"Debug": {
@cdennig
cdennig / PeopleController.cs
Last active September 6, 2017 19:02
People Controller
using Microsoft.AspNetCore.Authorization;
using Microsoft.AspNetCore.Mvc;
namespace Backend.Controllers
{
[Authorize]
[Route("api/[controller]")]
public class PeopleController : Controller
{
[HttpGet]
@cdennig
cdennig / auth.ts
Created September 6, 2017 19:39
Auth process
import {HttpClient} from 'aurelia-fetch-client';
import {inject} from 'aurelia-framework';
import settings from './settings';
import * as jwt_decode from 'jwt-decode';
declare const Msal : any;
@inject(HttpClient)
export class Auth {
private httpClient : HttpClient;
public authenticated : boolean;
@cdennig
cdennig / main.ts
Created September 6, 2017 20:29
Aurelia main
aurelia
.start()
.then((a) => {
// get auth object from Aurelia container
let auth : Auth = a
.container
.get(Auth);
setTimeout(() => {
@cdennig
cdennig / aurelia.json
Last active September 6, 2017 20:35
Aurelia / Install dependencies
"prepend": [
"node_modules/bluebird/js/browser/bluebird.core.js",
"node_modules/aurelia-cli/lib/resources/scripts/configure-bluebird.js",
"node_modules/requirejs/require.js",
"lib/msal.js"
],
"dependencies": [
"aurelia-binding",
"aurelia-bootstrapper",
"aurelia-dependency-injection",