Working with the REST API
Working with the REST APIs
#!/bin/bash
# Proper install
sudo apt-get -y install jq
sudo pip install yq
# YOLO
curl \
--silent \
--url https://github.com/stedolan/jq/releases/download/jq-1.6/jq-linux64 \
--location \
--output ./jq
chmod +x ./jq
sudo mv ./jq /usr/local/bin
sudo chown root.root /usr/local/bin/jq
A few variables first
Doing a device login (AAD v2)
Using a service principal (AAD v1)
Create an AAD app with a specified password
The underlying GraphAPI call for creating an app with a given password
Using managed VM identity (running inside an Azure VM) (AAD v1)
Fetch the subscription ID, from the Azure VM's instance metadata endpoint
Invoke the ARM API, for example with a listing of resource groups
Fetching a secret from Azure KeyVault using a managed identity
Force the instance metadata service to skip the token cache
Shutdown a VM, quite radically (skip graceful shutdown, just turn it off)
Talking to Azure Blob Storage
Uploading a blob
Commit suicide using managed identity
Last updated