Skip to main content
azd extensions azd rest
azd rest

Prerequisites

Before installing azd rest, make sure you have:

  • Azure Developer CLI (azd) installed on your system
  • Azure subscription and appropriate permissions
  • Azure CLI login — run az login to authenticate

If you don't have azd installed, visit the official installation guide.

Install azd rest

Install the azd rest extension using the following commands for your platform:

Terminal window
# Install Azure Developer CLI
winget install microsoft.azd
# Add extension source
azd extension source add -n jongio -t url -l https://jongio.github.io/azd-extensions/registry.json
# Install extension
azd extension install jongio.azd.rest

Verify Installation

Confirm that azd rest is installed correctly:

Terminal window
azd rest version

You should see output similar to:

azd rest
Version: 0.1.0
Build Date: 2026-01-09T10:30:45Z
Git Commit: abc123def

Make Your First Request

List your Azure subscriptions — authentication is handled automatically:

Terminal window
azd rest get https://management.azure.com/subscriptions?api-version=2020-01-01

You should see a JSON response with your subscriptions:

{
"value": [
{
"id": "/subscriptions/00000000-0000-0000-0000-000000000000",
"subscriptionId": "00000000-0000-0000-0000-000000000000",
"displayName": "My Subscription",
"state": "Enabled"
}
]
}

How Authentication Works

azd rest automatically detects the Azure service you're calling and applies the correct OAuth scope. It uses your Azure CLI credentials (via az login) to acquire tokens.

Automatic Scope Detection

No need to specify scopes for common Azure services:

Terminal window
# Management API — auto-detected
azd rest get https://management.azure.com/subscriptions?api-version=2020-01-01
# Key Vault — auto-detected
azd rest get https://myvault.vault.azure.net/secrets/mysecret?api-version=7.4
# Microsoft Graph — auto-detected
azd rest get https://graph.microsoft.com/v1.0/me

Custom Scopes

For non-Azure endpoints, provide a scope manually:

Terminal window
azd rest get https://api.myservice.com/data --scope https://myservice.com/.default

No Authentication

For public APIs that don't require auth:

Terminal window
azd rest get https://api.github.com/repos/Azure/azure-dev --no-auth

Common Commands

GET Request

Terminal window
azd rest get https://management.azure.com/subscriptions?api-version=2020-01-01

POST with JSON Body

Terminal window
azd rest post https://management.azure.com/subscriptions/{sub}/resourceGroups/{rg}/providers/Microsoft.Storage/storageAccounts/{name}?api-version=2021-04-01 \
--data '{"location":"eastus","kind":"StorageV2","sku":{"name":"Standard_LRS"}}'

POST with Body from File

Terminal window
azd rest post https://api.example.com/resource --data-file request.json

Verbose Output

Terminal window
azd rest get https://management.azure.com/subscriptions?api-version=2020-01-01 --verbose

Save Response to File

Terminal window
azd rest get https://management.azure.com/subscriptions?api-version=2020-01-01 \
--output-file subscriptions.json

Custom Headers

Terminal window
azd rest get https://api.example.com/resource \
--header "X-Custom-Header: value" \
--header "Accept: application/json"

Next Steps

📚 Explore Examples

See real-world usage examples for different Azure services.

View Examples →

📖 CLI Reference

Learn about all commands, flags, and supported services.

Read Reference →