Load Microsoft Support data to DuckDB
Build a Microsoft Support to DuckDB pipeline with your coding agent. One prompt scaffolds it with the dltHub AI harness, plus the Microsoft Support API base URL, auth, endpoints, and incremental loading.
The Azure Support REST API allows users to programmatically create and manage Azure support tickets and access troubleshooting resources for billing, subscription, and technical issues. Everything needed to build a working Microsoft Support → DuckDB pipeline is on this page: the API's base URL, authentication, endpoints, pagination and incremental field — plus a prompt that hands the whole job to your coding agent.
Build your Microsoft Support to DuckDB pipeline
Paste this prompt into Claude, Codex, or Cursor. The agent does the rest.
PromptRunuvx dlthub-init@latestto build a pipeline from Microsoft Support to DuckDB and run it on dltHub
That scaffolds a dltHub workspace and installs the dltHub AI harness — the project rules, the secrets-management skill, and the dlt MCP server your agent needs to work safely. From there it reads the Microsoft Support API, proposes the endpoints to load, then writes, runs and validates the pipeline while you review rather than type. Credentials are inspected through MCP tools, so your agent never reads secrets.toml itself. How the LLM-native workflow works →
Prefer to write it yourself? Every fact the agent uses is below.
Microsoft Support API at a glance
| Base URL | https://management.azure.com |
| Example endpoint | GET subscriptions/{subscriptionId}/providers/Microsoft.Support/supportTickets |
| Records found at | value |
| Authentication | requests require a Bearer token obtained from Microsoft Entra ID (Azure AD) — sent in the Authorization header, prefixed Bearer |
| Pagination | Cursor-based |
| Incremental field | nextLink |
| Record id | name |
| API reference | https://learn.microsoft.com/en-us/rest/api/support/ |
These values come from the Microsoft Support API reference — the authoritative source if anything here looks out of date.
How do I authenticate with the Microsoft Support API?
Authentication requires an Azure Active Directory (Microsoft Entra) OAuth2 access token provided in the Authorization header as a Bearer token. For certain scenarios like on-behalf-of requests, an additional x-ms-authorization-auxiliary header may be required.
1. Get your credentials
- Confirm the correct API: Microsoft Support REST API (Azure Support) is a control-plane Azure REST API under the Azure resource manager endpoint https://management.azure.com and uses Microsoft Entra ID (Azure AD) OAuth2 bearer authentication. 2) Ensure you have Azure prerequisites for the API operations (at minimum, an Azure subscription id and the right support-plan/role depending on which operations you call). The API reference lists prerequisites such as subscription ID and appropriate support-request contributor/reader access depending on the operation. 3) Create an Entra ID app registration (service principal) and grant it permissions to call Azure Microsoft.Support APIs (assign an appropriate role to the service principal). The Azure SDK guidance notes you must register an AAD application and grant access to Azure MicrosoftSupport by assigning the suitable role; roles like Owner do not grant the necessary permissions. 4) Store your Entra credentials as environment variables (recommended for production). The SDK README example sets: - AZURE_CLIENT_ID - AZURE_TENANT_ID - AZURE_CLIENT_SECRET 5) Obtain an OAuth2 access token for calls to https://management.azure.com. - The Azure Resource Manager REST guidance states that you must include the token in the Authorization header as Bearer {access-token}. - For interactive CLI testing, you can retrieve a token with az account get-access-token --query accessToken --output tsv and pass it as Authorization: Bearer $token. 6) Use the access token in requests to the Support REST API, e.g. Authorization: Bearer plus the standard Content-Type: application/json when you send a body. 7) If you are using the Azure Support REST client libraries, they handle token acquisition for you when you supply an Entra credential provider (for example, DefaultAzureCredential), but the underlying requirement remains: calls are authenticated with Azure/Entra bearer tokens.
2. Add them to .dlt/secrets.toml
[sources.microsoft_support_source] AZURE_TENANT_ID = "your_tenant_id" AZURE_CLIENT_SECRET = "your_client_secret" # dlt will use these to acquire an Entra (Azure AD) OAuth2 bearer token for https://management.azure.com and send it as the HTTP Authorization header.
dlt reads this file automatically at runtime. With the harness, the setup-secrets skill prompts you for the values and never handles the raw credential in chat. For production, see setting up credentials with dlt.
What Microsoft Support data can I load into DuckDB?
These are the Microsoft Support endpoints dlt can load into DuckDB:
| Resource | Endpoint | Method | Data selector | Description |
|---|---|---|---|---|
| support_tickets | subscriptions/{subscriptionId}/providers/Microsoft.Support/supportTickets | GET | value | Lists all support tickets for a subscription. |
| communications | subscriptions/{subscriptionId}/providers/Microsoft.Support/supportTickets/{supportTicketName}/communications | GET | value | Lists all communications for a support ticket. |
| services | providers/Microsoft.Support/services | GET | value | Lists all services available for support. |
| problem_classifications | providers/Microsoft.Support/services/{serviceName}/problemClassifications | GET | value | Lists problem classifications for a specific service. |
| operations | providers/Microsoft.Support/operations | GET | value | Lists all available support REST API operations. |
How do I load only new Microsoft Support records?
Microsoft Support exposes nextLink on subscriptions/{subscriptionId}/providers/Microsoft.Support/supportTickets, so dlt can request only the records that changed since the last run. Set it as the cursor_path and dlt tracks the high-water mark for you between runs.
{"name": "support_tickets", "endpoint": { "path": "subscriptions/{subscriptionId}/providers/Microsoft.Support/supportTickets", "data_selector": "value", "incremental": {"cursor_path": "nextLink", "initial_value": "2024-01-01T00:00:00Z"}, }}
On the first run dlt loads everything from initial_value; on every run after that it requests only what changed and appends with write_disposition="merge" if you set a primary key. See incremental loading.
What does the generated Microsoft Support pipeline look like?
A standard dlt REST API pipeline — the same code you would write by hand, loading /providers/Microsoft.Support/operations and /subscriptions/{subscriptionId}/providers/Microsoft.Support/supportTickets from the Microsoft Support API into DuckDB:
import dlt from dlt.sources.rest_api import RESTAPIConfig, rest_api_resources @dlt.source def microsoft_support_source(access_token=dlt.secrets.value): config: RESTAPIConfig = { "client": { "base_url": "https://management.azure.com", "auth": {"type": "bearer", "token": access_token}, }, "resources": [ {"name": "support_tickets", "endpoint": {"path": "subscriptions/{subscriptionId}/providers/Microsoft.Support/supportTickets", "data_selector": "value"}}, {"name": "communications", "endpoint": {"path": "subscriptions/{subscriptionId}/providers/Microsoft.Support/supportTickets/{supportTicketName}/communications", "data_selector": "value"}} ], } yield from rest_api_resources(config) def load_microsoft_support_to_duckdb() -> None: pipeline = dlt.pipeline( pipeline_name="microsoft_support_pipeline", destination="duckdb", dataset_name="microsoft_support_data", ) load_info = pipeline.run(microsoft_support_source()) print(load_info) if __name__ == "__main__": load_microsoft_support_to_duckdb()
Run it with python microsoft_support_pipeline.py. The agent iterates on this until it loads cleanly — you review and approve, rather than write it from scratch.
How do I query Microsoft Support data in DuckDB?
dlt creates one table per resource. Query the loaded data with Python or SQL — or ask your agent to, through the MCP server's execute_sql_query tool.
Python (pandas DataFrame):
import dlt data = dlt.pipeline("microsoft_support_pipeline").dataset() df = data.support_tickets.df() print(df.head())
SQL:
SELECT * FROM microsoft_support_data.support_tickets LIMIT 10;
See querying your data with dataset and exploring it in marimo notebooks.
How do I deploy the Microsoft Support to DuckDB pipeline in production?
The pipeline runs locally, which is ideal for prototyping and one-off analysis. When you need it on a schedule, monitored on every load, and shared with your team, deploy the same dlt code on the dltHub platform — no infrastructure to maintain. The prompt above already ends with "run it on dltHub", so your agent can take it there directly.
- Deploy & schedule — run the pipeline as a managed job with automatic retries.
- Monitor — observable job queues, alerting, and load metrics for every run.
- Transform — promote raw Microsoft Support loads into governed, documented models.
- Visualize & share — explore data in notebooks and publish live dashboards instead of static screenshots.
What other destinations can I load Microsoft Support data to?
dlt loads into any of these — only the destination argument changes:
| Destination | Example value |
|---|---|
| PostgreSQL | "postgres" |
| BigQuery | "bigquery" |
| Snowflake | "snowflake" |
| Redshift | "redshift" |
| Databricks | "databricks" |
| Filesystem (S3, GCS, Azure) | "filesystem" |
Set dlt.pipeline(destination="snowflake") and add credentials in .dlt/secrets.toml. On the dltHub platform the same pipeline runs against a managed Iceberg lakehouse. See the full destinations list.
Next steps
Was this page helpful?
Community Hub
Need more dlt context for Microsoft Support to DuckDB?
Request dlt skills, commands, AGENT.md files, and AI-native context.