canonical: https://jentic.com/apis/azure.com/azure-managementlockclient

# Microsoft Azure ManagementLockClient

Jentic publishes the only available OpenAPI specification for ManagementLockClient, keeping it validated and agent-ready. The Azure Management Locks API applies CanNotDelete and ReadOnly locks to subscriptions, resource groups, or individual resources so users cannot accidentally modify or delete production assets. Use it to create, list, get, and delete locks at any ARM scope, including by-scope variants for arbitrary nested resource paths. Authentication is via Azure Active Directory OAuth 2.0 on Azure Resource Manager.

## For AI agents

Apply and remove Azure delete or read-only locks at subscription, resource group, or resource scope to protect critical assets. Useful for production guardrails and change-freeze enforcement.

## Scope

Does not handle RBAC role assignments, policy evaluation, or resource configuration - use for applying CanNotDelete and ReadOnly locks to Azure scopes only.

## Capabilities

- Create or update a CanNotDelete or ReadOnly lock on a subscription, resource group, or resource
- List every management lock in a subscription to audit which assets are protected
- Filter locks by resource group to inspect protections inside a single environment
- Delete a lock to lift a change freeze without touching the underlying resource
- Apply a lock at an arbitrary scope path for nested or extension resources
- Enumerate Microsoft.Authorization operations exposed for lock management

## Use cases

### Protect production resource groups

Operations teams put CanNotDelete locks on every production resource group to prevent accidental teardown via portal or CLI. The lock blocks delete operations on the group and its descendants until the lock is removed, while still allowing day-to-day data plane operations on the resources within. The lock is created with one PUT call per resource group.

Example prompt: PUT /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Authorization/locks/{lockName} with properties.level set to CanNotDelete and a notes value naming the change ticket.

### Apply a tenant-wide change freeze

During regulated reporting windows, agents iterate every subscription and apply ReadOnly locks at the subscription level so configuration cannot drift. The List endpoints confirm coverage, and a parallel cleanup workflow removes the locks at the end of the freeze. Lock notes carry the reason and freeze identifier for audit.

Example prompt: For each subscription, PUT /subscriptions/{subscriptionId}/providers/Microsoft.Authorization/locks/{lockName} with level ReadOnly, then verify with GET on the same path.

### Audit lock coverage before an outage

Before a major change window, governance reviews the full set of management locks across the subscription to confirm critical resources are protected and that locks scheduled for the window are absent or scheduled for lifting. The list endpoints support filter queries to narrow results by resource type or name.

Example prompt: GET /subscriptions/{subscriptionId}/providers/Microsoft.Authorization/locks and emit a report grouping locks by level and scope, highlighting resources missing a CanNotDelete lock.

### Agent-driven lock lifecycle

Through Jentic, an AI agent can react to a Slack approval and automatically lock or unlock the affected resource group. The agent searches for 'apply azure delete lock', loads the input schema, and executes with the resource group name and lock level. Jentic injects the Azure AD bearer token at execution time so the agent never sees secrets.

Example prompt: Use Jentic search 'create azure cannotdelete lock', load ManagementLocks_CreateOrUpdateAtResourceGroupLevel, supply the resource group and lock name with level CanNotDelete, and execute.

## Key endpoints

| Method | Path | Description |
| --- | --- | --- |
| PUT | /subscriptions/{subscriptionId}/providers/Microsoft.Authorization/locks/{lockName} | Create or update a subscription-level lock |
| PUT | /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Authorization/locks/{lockName} | Create or update a resource group lock |
| GET | /subscriptions/{subscriptionId}/providers/Microsoft.Authorization/locks | List all locks in a subscription |
| GET | /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Authorization/locks | List locks in a resource group |
| DELETE | /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Authorization/locks/{lockName} | Delete a resource group lock |
| PUT | /{scope}/providers/Microsoft.Authorization/locks/{lockName} | Create or update a lock at any ARM scope |

## Key resources

- **ManagementLocks** — Create, get, list, and delete CanNotDelete and ReadOnly locks at subscription, resource group, resource, and arbitrary scope levels.
- **AuthorizationOperations** — Enumerate the Microsoft.Authorization resource provider operations available to locks tooling.

## Why Jentic

- **Setup:** Wiring the Management Locks API by hand means setting up MSAL and an Azure AD service principal, minting bearer tokens against management.azure.com, and handling the several ARM scope variants for subscription, resource group, and arbitrary paths yourself. Through Jentic you install once, import ManagementLockClient from the API Directory, store the service principal credentials once, and your agent calls it.
- **Permission scoping:** The scope and lock name travel in the URL path (/resourceGroups/{resourceGroupName}/providers/Microsoft.Authorization/locks/{lockName}), so a rule can pin your agent to applying and reading locks on a named resource group. You choose the operations it may call, so deleting a lock is not included unless you add it.
- **Credential handling:** Your Azure AD client credentials are stored once, encrypted, by your own Jentic One instance and exchanged for a short-lived ARM-scoped bearer token at execution time. The raw secret never enters the agent's prompt, logs, or context.
- **Discovery method:** Agents search Jentic by intent such as 'lock an azure resource group against deletion' or 'list all management locks in a subscription', and Jentic returns the matching ManagementLocks operation with its input schema and required scope path so the agent calls the right endpoint directly.

## Related APIs

- **Authorization Management Client** — Apply RBAC role assignments alongside locks for layered protection.
- **Policy Client** — Enforce governance via policy assignments rather than locks.
- **Resource Management Client** — Manage the resources and resource groups that locks protect.
- **Management Link Client** — Document dependencies between protected resources for impact analysis.

## FAQ

### Why is there no official OpenAPI spec for ManagementLockClient?

Microsoft Azure does not publish a standalone OpenAPI specification for the management locks API. Jentic generates and maintains this spec so that AI agents and developers can call ManagementLockClient via structured tooling. It is validated against the live API and kept up to date. Get started with Jentic One, the self-hosted execution layer.

### What authentication does the Management Locks API use?

The API uses Azure Active Directory OAuth 2.0 via the azure_auth scheme on https://management.azure.com/. Through Jentic, your Azure AD application credentials are stored encrypted in your Jentic One instance and exchanged for a short-lived bearer token at request time, so raw secrets never reach the agent.

### Can I lock a resource group against deletion with this API?

Yes. Call PUT /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Authorization/locks/{lockName} with a body that sets properties.level to CanNotDelete. The lock applies to the group and every resource under it until removed.

### What lock levels does this API support?

Two levels: CanNotDelete blocks delete operations while permitting reads and updates, and ReadOnly blocks both delete and update operations. Both are set on the request body's properties.level field when creating or updating a lock.

### What are the rate limits for the Management Locks API?

Lock endpoints inherit the standard Azure Resource Manager throttle quotas, exposed via x-ms-ratelimit-remaining-* response headers. Bulk lock operations should respect those headers and back off when remaining quota approaches zero.

### How do I apply a lock through Jentic?

Search Jentic for 'create azure delete lock', load the ManagementLocks_CreateOrUpdateAtResourceGroupLevel operation, supply lock name and level in the body, then execute. Jentic returns the created lock object with its id field for downstream cleanup workflows.

### Does removing a lock affect the underlying resource?

No. DELETE on a lock path removes the lock object only and leaves the locked resource untouched. The resource immediately becomes available for the operations the lock was previously blocking.

### Can I limit what my agent is allowed to do with the Azure Management Locks API?

Yes. Jentic One is self-hosted, so your own rules decide which lock operations and credentials the agent may use. Because the ARM scope and lock name travel in the URL path, such as /resourceGroups/{resourceGroupName}/providers/Microsoft.Authorization/locks/{lockName}, you can pin the agent to creating and reading CanNotDelete or ReadOnly locks on a single named resource group. You also choose which operations it may call, so deleting a lock stays out of reach unless you explicitly add that operation.
