Skip to content

Instantly share code, notes, and snippets.

@brucedkyle
Last active June 5, 2020 22:43
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save brucedkyle/36beabccd209df6ebf440306ffbdc8c3 to your computer and use it in GitHub Desktop.
Save brucedkyle/36beabccd209df6ebf440306ffbdc8c3 to your computer and use it in GitHub Desktop.
Set up Azure tooling
# Set the root path for extensions
code --extensions-dir <dir>
# List the installed extensions.
code --list-extensions
# Install extension
code --install-extension (<extension-id> | <extension-vsix-path>)
# Uninstalls an extension.
code --uninstall-extension (<extension-id> | <extension-vsix-path>)
az aks get-credentials --resource-group $RESOURCEGROUPNAME --name $AKSCLUSTERNAME
kubectl get nodes
powershell -command "(Get-Variable PSVersionTable -ValueOnly).PSVersion"
az aks install-cli
#Requires -Version 7.0
#Requires -Modules PowerShellGet
# you may need to agree to accepts signed PowerShell modules
Set-ExecutionPolicy -ExecutionPolicy AllSigned
# From https://docs.microsoft.com/en-us/powershell/azure/install-az-ps?view=azps-3.6.1
if ($PSVersionTable.PSEdition -eq 'Desktop' -and (Get-Module -Name AzureRM -ListAvailable)) {
Write-Warning -Message ('Az module not installed. Having both the AzureRM and ' +
'Az modules installed at the same time is not supported.')
} else {
Install-Module -Name Az -AllowClobber -Scope CurrentUser -Force
Install-Module -Name Az.Blueprint -Scope CurrentUser -Force
Install-Module -Name Az.Security -Scope CurrentUser -Force
Install-Module -Name Az.OperationalInsights -Scope CurrentUser -Force
Install-Module -Name Az.Network -Scope CurrentUser -Force
Install-Module -Name azuread -Scope CurrentUser -Force
}
### Adapted from https://www.thomasmaurer.ch/2019/05/how-to-install-azcopy-for-azure-storage/
$destimationPath = [Environment]::GetFolderPath("MyDocuments")
#Download AzCopy
Invoke-WebRequest -Uri "https://aka.ms/downloadazcopy-v10-windows" -OutFile AzCopy.zip -UseBasicParsing
#Curl.exe option (Windows 10 Spring 2018 Update (or later))
# curl.exe -L -o AzCopy.zip https://aka.ms/downloadazcopy-v10-windows
#Expand Archive
Expand-Archive ./AzCopy.zip ./AzCopy -Force
#Move AzCopy to the destination you want to store it
New-Item -ItemType directory -Path $destimationPath\Azure\AzCopy
Get-ChildItem ./AzCopy/*/azcopy.exe | Move-Item -Destination $destimationPath\Azure\AzCopy\AzCopy.exe
#Add your AzCopy path to the Windows environment PATH using PowerShell:
Set-Item -Path Env:Path -Value ($Env:Path + ";" + $destimationPath + "\Azure\AzCopy")
$env:Path -split ';'
curl -L https://aka.ms/InstallAzureCli | bash
Invoke-WebRequest -Uri https://aka.ms/installazurecliwindows -OutFile .\AzureCLI.msi; Start-Process msiexec.exe -Wait -ArgumentList '/I AzureCLI.msi /quiet'; rm .\AzureCLI.msi
sudo apt install git-all
# for Ubuntu 14 and above
sudo apt-get install jq
# Update the packages index and install the dependencies
sudo apt update
sudo apt install software-properties-common apt-transport-https wget
# Import the Microsoft GPG key
wget -q https://packages.microsoft.com/keys/microsoft.asc -O- | sudo apt-key add -
# Enable the Visual Studio Code repository
sudo add-apt-repository "deb [arch=amd64] https://packages.microsoft.com/repos/vscode stable main"
# Install the latest version of Visual Studio Code with:
sudo apt update
sudo apt install code
Get-AzResourceProvider -ListAvailable | Select-Object ProviderNamespace, RegistrationState
az provider list --query "[].{Provider:namespace, Status:registrationState}" --out table
Register-AzResourceProvider -ProviderNamespace Microsoft.Batch
az provider register --namespace Microsoft.Batch
# Connect to Azure with a browser sign in token
Connect-AzAccount
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment