This file contains 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
# Setting the script to authenticate using the system access token on the Azure DevOps Build Agent | |
# Set the agent job to "Allow scripts to access OAuth token" in the build | |
$pat = "Bearer $env:System_AccessToken" | |
# this will be the correlation value used to collect all the builds | |
$sourceVersion = $env:BUILD_SOURCEVERSION | |
Write-Output ("##vso[task.setvariable variable=sourceVersion;]$sourceVersion") | |
$organizationName = ([System.Uri]$env:SYSTEM_TEAMFOUNDATIONCOLLECTIONURI).Host.split('.')[0] |
This file contains 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
# variables | |
$location="<selected region>" | |
$name_suffix="<your student id>" | |
$group_name="identitylab" | |
# create the group | |
New-AzureRmResourceGroup -Name $group_name -Location $location | |
$template_uri="https://raw.githubusercontent.com/Azure/azure-quickstart-templates/master/active-directory-new-domain/azuredeploy.json" |
This file contains 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
{ | |
"id": "f54fd36e-57c8-4408-a870-3ef2b3b4b685", | |
"acceptMappedClaims": null, | |
"accessTokenAcceptedVersion": null, | |
"addIns": [], | |
"allowPublicClient": null, | |
"appId": "da66ee7b-d762-4e19-8d7c-66a9974baeab", | |
"appRoles": [ | |
{ | |
"allowedMemberTypes": [ |
This file contains 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
# created the service broker via command | |
SECURITY_USER_NAME=<username> | |
SECURITY_USER_PASSWORD=<the password> | |
URL=http://meta-azure-service-broker.<public ip value here>.xip.io | |
cf create-service-broker meta-azure-service-broker $SECURITY_USER_NAME $SECURITY_USER_PASSWORD $URL | |
# enabled service for redis | |
cf enable-service-access azure-rediscache |
This file contains 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
# The following example assigns the Azure Kubernetes Service Cluster Admin Role to an individual user account. | |
# This is controlled via Azure AD -> Azure AKS (separate from AAD integration with | |
# AKS where someone can assign a user a cluster role | |
# Get the resource ID of your AKS cluster | |
AKS_CLUSTER=$(az aks show --resource-group myResourceGroup --name myAKSCluster --query id -o tsv) | |
# Get the account credentials for the logged in user | |
ACCOUNT_UPN=$(az account show --query user.name -o tsv) |
This file contains 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
# get list of nodes | |
kubectl get nodes | |
# beta.kubernetes.io/os=windows | |
# taint | |
nodes=$(kubectl get no \ | |
-o jsonpath="{.items[*].metadata.name}" \ | |
-l=beta.kubernetes.io/os=windows) |
This file contains 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: DaemonSet | |
metadata: | |
name: prepull | |
spec: | |
selector: | |
matchLabels: | |
name: prepull | |
template: | |
metadata: |
This file contains 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
# Docker | |
# Build and push an image to Azure Container Registry | |
# https://docs.microsoft.com/azure/devops/pipelines/languages/docker | |
trigger: | |
- master | |
resources: | |
- repo: self |
This file contains 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
rg=apim | |
location=eastus2 | |
vnet=apim-vnet | |
az group create --name $rg --location $location | |
az network vnet create -n $vnet -g $rg -l $location \ | |
--address-prefixes 10.0.0.0/16 \ | |
--subnet-name default \ | |
--subnet-prefixes 10.0.0.0/24 |
This file contains 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
{ | |
"name": "[concat(variables('vmNodeType0Name'),'OMS')]", | |
"properties": { | |
"publisher": "Microsoft.EnterpriseCloud.Monitoring", | |
"type": "MicrosoftMonitoringAgent", | |
"typeHandlerVersion": "1.0", | |
"autoUpgradeMinorVersion": true, | |
"settings": { | |
"workspaceId": "[reference(resourceId('Microsoft.OperationalInsights/workspaces/', parameters('omsWorkspacename')), '2015-11-01-preview').customerId]" |