Skip to content

Instantly share code, notes, and snippets.

View jcorioland's full-sized avatar
🏠
Working from home

Julien Corioland jcorioland

🏠
Working from home
View GitHub Profile
#!/bin/bash
#
# Execute this directly in Azure Cloud Shell (https://shell.azure.com) by pasting (SHIFT+INS on Windows, CTRL+V on Mac or Linux)
# the following line (beginning with curl...) at the command prompt and then replacing the args:
# This scripts Onboards Azure Monitor for containers to Kubernetes cluster hosted outside and connected to Azure via Azure Arc cluster
#
# 1. Creates the Default Azure log analytics workspace if doesn't exist one in specified subscription
# 2. Adds the ContainerInsights solution to the Azure log analytics workspace
# 3. Adds the workspaceResourceId tag or enable addon (if the cluster is AKS) on the provided Managed cluster resource id
# 4. Installs Azure Monitor for containers HELM chart to the K8s cluster in provided via --kube-context
az ad sp list --query "[?publisherName=='$(az ad signed-in-user show --query displayName -o tsv)'].{ApplicationId:appId,ObjectId:objectId,DisplayName:displayName}" -o table --all
#!/bin/bash
set -e
# Update + Common tools
echo "-> run apt-get update & upgrade"
sudo apt-get update && sudo apt-get upgrade -y
sudo apt-get install -y build-essential git pkg-config jq curl wget unzip
# Install Azure CLI
---
apiVersion: v1
kind: Namespace
metadata:
name: custom-metrics
---
kind: ServiceAccount
apiVersion: v1
metadata:
name: custom-metrics-azure-apiserver
@jcorioland
jcorioland / create-acs-kubernetes.md
Created October 16, 2017 15:29
Create an Azure Container Service Kubernetes Cluster with Azure CLI

Create an Azure Container Service Kubernetes Cluster with Azure CLI

Login (interactive) to your Azure subscription using Azure CLI

az login

Create a resource group

@jcorioland
jcorioland / Dockerfile
Created May 4, 2017 06:46
Exemple de Dockerfile pour une application .NET Core
FROM microsoft/dotnet:1.1.0-sdk-projectjson
MAINTAINER Julien Corioland, Microsoft (@jcorioland)
WORKDIR /app
ENTRYPOINT ["dotnet", "run"]
EXPOSE 5000
ENV ASPNETCORE_URLS http://0.0.0.0:5000
@jcorioland
jcorioland / azstoragesas.php
Created February 24, 2017 11:13
Generate Microsoft Azure Storage account shared access signature with PHP
<?php
/**
* Generates a shared access signature for Microsoft Azure storage
* cf. https://docs.microsoft.com/en-us/rest/api/storageservices/fileservices/constructing-an-account-sas
*
* @param (accountName) The name of the Microsoft Azure storage account
* @param (storageKey) The access key of the Microsoft Azure storage account
* @param (signedPermissions) Required. Specifies the signed permissions for the account SAS
* @param (signedService) Required. Specifies the signed services accessible with the account SAS
export TENANT_ID=XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX
export SP_APP_ID=XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX
export SP_PASSWORD=XXXXXXXXXXXX
export RG_NAME=XXXXXXXX
export ACS_NAME=XXXXXXXX
export AZURE_REGION=westeurope
export LINUX_ADMIN=acsadmin
export SSH_PUBLIC_KEY_FILE=XXXXXXXX
export SSH_PRIVATE_KEY_FILE=XXXXXXXX
export MASTER_COUNT=1
@jcorioland
jcorioland / HomeController.cs
Last active August 29, 2015 14:21
Sample ASP.NET Home Controller for test purpose
public class HomeController : Controller
{
public IActionResult Index()
{
return View();
}
public IActionResult About()
{
ViewBag.Message = "Your application description page.";