I hope you will finish #25daysofserverless !!
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# Variables | |
SUBSCRIPTION_ID=$(az account show --query id --output tsv) # Subscription ID | |
ROLE_NAME="8e3af657-a8ff-443c-a75c-2fe8c4bcb635" # Owner role | |
ROLE_DEFINITION_ID="/subscriptions/${SUBSCRIPTION_ID}/providers/Microsoft.Authorization/roleDefinitions/${ROLE_NAME}" # Role definition resource ID | |
PRINCIPAL_ID=$(az ad user show --id $(az account show --query user.name -o tsv) --query id -o tsv) # Your account object ID | |
ROLE_ASSIGNMENT_ID=$(uuidgen) # Generate a unique GUID for the role assignment | |
JUSTIFICATION="I need access to [$(az account show --query name --output tsv)] Azure subscription" # Justification for the role assignment | |
API_VERSION="2020-10-01" # API version |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
apiVersion: apps/v1 | |
kind: Deployment | |
metadata: | |
name: hellofromnode-deployment | |
labels: | |
environment: dev | |
app: hellofromnode | |
spec: | |
replicas: 1 | |
template: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#https://medium.com/@ferarias/docker-in-windows-11-using-wsl2-8e30faddc32c | |
$wslip = wsl -- ip -o -4 -json addr list eth0 | ConvertFrom-Json | %{ $_.addr_info.local } ` | ?{ $_ } | |
Write-Host "Setting Docker context 'wsl' to host=tcp://$($wslip):2375" | |
docker context update wsl --docker "host=tcp://$($wslip):2375" | |
docker context use wsl |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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"; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html> | |
<html lang="en"> | |
<head> | |
<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 --> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// 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 | |
/// https://github.com/aspnet/AspNetIdentity/blob/master/src/Microsoft.AspNet.Identity.Core/AsyncHelper.cs | |
/// </summary> | |
public class AsyncHelper | |
{ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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(() => |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Invoke-AzureRmResourceAction -ResourceGroupName <your-resource-group> -ResourceType "Microsoft.Web/sites" -ResourceName <Your-Azure-Function> -Action syncfunctiontriggers -ApiVersion "2018-02-01" -Force |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"$schema": "http://schema.management.azure.com/schemas/2014-04-01-preview/deploymentTemplate.json", | |
"contentVersion": "1.0.0.0", | |
"parameters": { | |
"location": { | |
"type": "string", | |
"defaultValue": "[resourceGroup().location]" | |
}, | |
"registryPassword": { | |
"type": "SecureString" |
NewerOlder