Connect Microsoft Azure to Claude Code

Inventory Azure subscriptions and resources, inspect virtual machines, and read the activity log. Add Toolspoke to Claude Code once and it can use 12 Microsoft Azure actions. Your Microsoft Azure credential stays in Toolspoke, and you choose which actions Claude Code may call.

Set it up in Claude Code

Three steps, the first one once for every toolkit you will ever add.

  1. Add Toolspoke to Claude Code

    Run it in your project, then /mcp to sign in

    claude mcp add --transport http toolspoke https://toolspoke.com/mcp

    The sign-in opens in your browser, and Toolspoke asks you to approve it.

  2. Install Microsoft Azure and connect it

    Add Microsoft Azure to a project in your Toolspoke workspace.

    Service principal (client credentials). You provide it once, when you install the connector. Toolspoke encrypts it at rest and decrypts it only for the length of a single call, and the gateway attaches it to the outbound request itself, so it is never part of the arguments an agent sends.

    Directory (tenant) ID
    Entra admin centre → App registrations → your app → Overview. It names the directory the sign-in happens in, and goes into the token endpoint address.
    Application (client) ID
    Shown beside the tenant ID on the app's Overview page. This is the service principal Azure will see as the caller.
    Client secret
    App registration → Certificates & secrets → New client secret. Copy the Value, not the Secret ID, the Value is shown once and never again. Give the service principal its RBAC role separately, under the subscription's Access control (IAM); Reader covers every read this connector makes.
  3. Choose what Claude Code may do

    All 12 actions start on. Switch off any of the 3 actions that change something in Microsoft Azure, and Claude Code gets a refusal if it tries.

What you can ask Claude Code for

A few of the Microsoft Azure actions that only read, so they are safe to try first.

  • List every subscription this service principal can see, with each one's id, display name and state
  • List the resource groups in one subscription, with each group's name, location and tags
  • Read the subscription's activity log, the control-plane audit trail of who changed what and whether it worked

What Claude Code can do in Microsoft Azure

9 actions read, one writes and 2 delete or permanently change something.

Reads

  • List subscriptions

    List every subscription this service principal can see, with each one's id, display name and state. Call it first when you do not know which subscription to act on, and to find out whether the connection reaches anything at all, an empty list means the app registration exists but has been given no RBAC role on any subscription. The subscriptionId returned here is what every other operation's subscription_id argument takes.

  • List resource groups

    List the resource groups in one subscription, with each group's name, location and tags. Resource groups are how Azure work is usually organised, so this is the natural second call after list_subscriptions and the way to find the resource_group name that the virtual machine operations need. Use list_resources instead when the question is about a kind of resource rather than about where things are grouped.

  • List resources

    List resources across a whole subscription, of any type, with each one's full ARM id, name, type, location and tags. This is the general inventory call and the one to reach for when the question is "what is running here" or "where is the thing called X", narrow it with `filter`, which is the only practical way to keep the answer small in a busy subscription. The `id` it returns is the fully qualified resource id that get_resource takes. For virtual machines specifically, list_virtual_machines returns their configuration rather than this generic envelope.

  • Get resource

    Fetch one resource of any type by its fully qualified ARM id, returning the provider's own properties for it rather than the generic summary a listing gives. Ids come from list_resources and look like /subscriptions/{guid}/resourceGroups/prod-rg/providers/Microsoft.Web/sites/my-app. IMPORTANT: api_version here belongs to the resource's own provider, not to ARM. Microsoft.Web, Microsoft.Compute and Microsoft.Storage each version independently, and a version the provider does not recognise is rejected outright. Read the `type` from list_resources, then pass the api-version documented for that type.

  • List virtual machines

    List every virtual machine in a subscription with its size, image, OS disk, network interfaces and provisioning state. This returns the machine's configuration, which is what it was built as, it does not say whether the machine is running right now. For that, call get_vm_instance_view with the resource group and name from here. The `id` of each machine is also a valid get_resource id.

  • Get vm instance view

    Report one virtual machine's run-time state: power state (running, stopped, deallocated), provisioning state, agent and extension health, boot diagnostics and disk status. This is the operation that answers "is it up", list_virtual_machines describes how a machine is configured and says nothing about whether it is currently running. Call it before and after start_vm, restart_vm or deallocate_vm, since all three return as soon as Azure accepts the request rather than when the machine has finished changing state. Resource group and machine name come from list_virtual_machines.

  • List storage accounts

    List the storage accounts in a subscription with their kind, SKU, replication, endpoints and network access settings. Useful for finding where blob data lives and for auditing exposure, allowBlobPublicAccess, minimumTlsVersion and publicNetworkAccess all come back here. Access keys are deliberately not returned by this endpoint and this connector exposes no operation that returns them.

  • Query activity logs

    Read the subscription's activity log, the control-plane audit trail of who changed what and whether it worked. This is the operation to reach for after an unexplained change: it names the caller, the operation, the resource and the outcome. `filter` is REQUIRED and Azure accepts only a handful of exact shapes, always starting with a time range: "eventTimestamp ge '2026-08-20T00:00:00Z' and eventTimestamp le '2026-08-21T00:00:00Z'", optionally followed by exactly one of `and resourceGroupName eq '…'`, `and resourceUri eq '…'`, `and resourceProvider eq '…'` or `and correlationId eq '…'`. No other syntax is accepted, and a malformed filter is rejected rather than ignored. The log holds 90 days.

  • List app services

    List the App Service web apps and function apps in a subscription, with each one's state, default hostname, hosting plan, runtime stack and HTTPS settings. Use it to find which app serves a hostname, or to check whether an app is stopped. Deployment, restarts and configuration changes are not exposed here, this connector reads App Service and does not operate it.

Writes

  • Start vm

    Start a stopped or deallocated virtual machine. Classified a write rather than destructive because it brings capacity back rather than taking it away, and calling it on a machine that is already running is harmless. It does cost money the moment the machine boots. Azure answers 202 Accepted immediately and starts the machine in the background, so confirm with get_vm_instance_view rather than treating the response as proof it is up.

Deletes or permanently changes

  • Restart vm

    Restart a running virtual machine. Everything on it goes down and comes back, which is visible to whatever depends on that machine and is not undone by calling start_vm afterwards, so this is classified destructive, out of reach of a read-only or write grant, and an install has to grant full access or name it explicitly. Azure answers 202 Accepted at once; watch the power state with get_vm_instance_view to see the restart finish.

  • Deallocate vm

    Shut a virtual machine down and release its compute, which is the operation that actually stops the bill for it, an in-guest shutdown leaves the machine allocated and still charged. The machine goes down, its dynamic IP is released unless it is a static one, and local temporary disks are lost, so this is classified destructive and cannot be reached by a read-only or write grant. start_vm brings it back, but not to the same ephemeral state. Azure answers 202 Accepted at once; confirm the deallocated power state with get_vm_instance_view.

Microsoft Azure in Claude Code: questions

Does Claude Code see my Microsoft Azure credential?

No. The credential is stored encrypted in Toolspoke, and the gateway adds it to each call. Claude Code only ever talks to Toolspoke, and the dashboard shows the last four characters of the credential and nothing more.

Can I stop Claude Code from changing things in Microsoft Azure?

Yes. Each of the 12 actions can be switched off for a project. Turn off the 3 that change something and Claude Code can only read.

Will 12 actions crowd Claude Code's context?

No. Toolspoke shows Claude Code five bridge tools, plus a guide where a toolkit has one, and Claude Code searches for the Microsoft Azure action it needs when it needs it. Adding more toolkits does not add more tools to its list.

Can I add it once for every project?

Yes. Add --scope user to the command and Claude Code keeps Toolspoke in every project on this machine. Without it, the server is added to the project you ran the command in.

What does it cost?

Tool calls are free on every plan, and a Microsoft Azure call does not run in a sandbox, so it bills nothing.

Try Microsoft Azure in Claude Code

Free to start, and tool calls cost nothing on any plan.