Skip to content

Instantly share code, notes, and snippets.

View peteraritchie's full-sized avatar
😖

Peter Ritchie peteraritchie

😖
View GitHub Profile

If you're looking for an example of the split required when you're building in Linux and signing in Windows, that's what we do with xUnit.net. In particular, you need to:

-- https://discord.com/channels/966483029830824008/966484831

$rgName = 'learn-rg'
$location = 'EastUS'
$vnetName = 'myVNet'
$vnetAddressPrefix = '10.0.0.0/16'
$subnetName = 'default'
$subnetAddressPrefix = '10.0.0.0/24'
#
$rgParams = @{
Name = $rgName
$webappname = "mywebapp752638527"
$resourceGroupName = 'learn-deploy-container-acr-rg'
$location = 'eastus'
$appServicePlanName="$webappname-deploy"
$tags = @{'createdDate'=(Get-Date).ToString("yyyy-MM-dd"); 'intention'='learn'}
$containerRegistryName="peterritchie"
$webImageName="webimage"
az configure --defaults group=$resourceGroupName location=$location

useful quick AZ commands

remove resource group

Remove-AzResourceGroup -Name $rgName -Confirm False
az group delete --name $rgName --Yes
#!/bin/bash
az configure --defaults location=westus
az configure --defaults group="scalesetrg"
az vmss create \
--name webServerScaleSet \
--lb-sku Standard \
--image UbuntuLTS \
--upgrade-policy-mode automatic \
--custom-data cloud-init.yaml \
#!/bin/bash
az configure --defaults location=eastus
az configure --defaults group="resourceGroup"
# Create VM in default resource group and default location
az vm create \
--name support-web-vm01 \
--image Canonical:UbuntuServer:16.04-LTS:latest \
--size Standard_DS1_v2 \
--admin-username azureuser \
# Create SSH Key pair
ssh-keygen -m PEM -t rsa -b 4096
# Create a new VM with port 3389 open (skip subnet, VNet, and NSG)
New-AzVm `
-ResourceGroupName $rgName `
-Name $vmName `
-Location $location `
-OpenPorts 3389
# create and add a VM data disk
$myRgName = "resourceGroup"
$myVMName = "VM1"
$newDiskName = "data2"
Add-AzVMDataDisk -VM $myVM -Name $newDiskName -LUN 1 -DiskSizeinGB 1 -CreateOption Empty
Update-AzVM -ResourceGroupName $myRGName -VM $myVM
# change caching of a VM Data disk