This video goes over two Azure IP addresses used for Azure VM’s. The WireServer IP of 168.63.129.16 and the Azure Instance Metadata Service (IMDS) IP address 169.254.169.254. In the video, I go over what each is used for and then give a demonstration on using the WireServer IP address to query DNS. After that, I use the IMDS REST Endpoint to pull metadata including the Azure environment and scheduled events.
PowerShell Commands
IMDS Overview:
$metadata = Invoke-RestMethod -Headers @{"Metadata"="true"} -Method GET -Uri http://169.254.169.254/metadata/instance?api-version=2019-06-01$metadata | ConvertTo-Json -Depth 99
Get the OS SKU:
Invoke-RestMethod -Headers @{"Metadata"="true"} -Method GET -Uri "http://169.254.169.254/metadata/instance/compute/sku?api-version=2017-08-01&format=text"
Get Scheduled Events:
Invoke-RestMethod -Headers @{"Metadata"="true"} -Method Get -Uri http://169.254.169.254/metadata/scheduledevents?api-version=2019-08-01 | ConvertTo-Json -Depth 99
Referenced Videos
Azure Files SMB Access On-premises with Private Endpoints:
https://www.ciraltos.com/azure-files-smb-access-on-premises-with-private-endpoints/
How to use Postman and PowerShell to Query API Data
https://www.ciraltos.com/how-to-use-postman-and-powershell-to-query-api-data/