Skip to content

Instantly share code, notes, and snippets.

@dinowang
Created November 15, 2025 06:38
Show Gist options
  • Select an option

  • Save dinowang/7d4322f22f23ea745185049740b3b229 to your computer and use it in GitHub Desktop.

Select an option

Save dinowang/7d4322f22f23ea745185049740b3b229 to your computer and use it in GitHub Desktop.
httpyac-azurecli-credentials
{{
// AzureCliCredentials
const childProcess = require('child_process');
const accessToken = childProcess.execSync('az account get-access-token --query accessToken -o tsv').toString().trim();
module.exports.accessToken = accessToken;
}}
###
GET https://management.azure.com/providers/Microsoft.Subscription/operations
?api-version=2024-08-01-preview
Authorization: Bearer {{accessToken}}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment