canonical: https://jentic.com/apis/azure.com/deploymentscriptsclient

# Microsoft Azure DeploymentScriptsClient

Jentic publishes the only available OpenAPI specification for DeploymentScriptsClient, keeping it validated and agent-ready. The API manages Azure Resource Manager Deployment Scripts under Microsoft.Resources, the resource type that lets ARM templates run inline PowerShell or Bash scripts during a deployment. It covers create, get, update, delete, and listing of script resources at subscription and resource-group scope, plus the dedicated logs endpoints for retrieving execution output.

## For AI agents

Create, manage, and inspect Azure ARM Deployment Scripts - including their execution logs - at subscription and resource group scope.

## Scope

Does not run arbitrary scripts outside an ARM deployment, manage deployments themselves, or schedule recurring jobs - use for ARM Deployment Script resources and their logs only.

## Capabilities

- Create or update an ARM Deployment Script with inline PowerShell or Bash content
- List Deployment Scripts at subscription and resource-group scope
- Retrieve a specific Deployment Script and its current provisioning state
- Patch tags and configuration on an existing Deployment Script
- Delete a Deployment Script and its associated runtime resources
- Fetch the captured stdout/stderr logs from a Deployment Script run

## Use cases

### Inline scripts inside ARM deployments

ARM templates often need a small piece of imperative logic - generating a random password, calling out to another service, or seeding a resource - that pure declarative templates cannot express. Deployment Scripts let the template author embed PowerShell or Bash that runs as part of the deployment, and this API manages the resulting script resources that record execution and outputs.

Example prompt: Create a Deployment Script named 'seed-db' in resource group 'app-rg' that runs an inline Bash one-liner against the configured storage account and exposes the script output via outputs

### Post-deployment log retrieval

When a Deployment Script run fails, the operator needs the captured stdout and stderr to diagnose the failure. The logs endpoints return the latest log stream for a script, so an automation flow can collect, archive, and surface the output without logging into the Azure portal.

Example prompt: Fetch the default log stream for the Deployment Script 'seed-db' in resource group 'app-rg' and return the last 200 lines

### Cleanup of completed scripts

Deployment Script resources persist after a run and can accumulate. A nightly job lists Deployment Scripts in a subscription and deletes any whose deployments have completed and whose logs have been archived, keeping the resource graph tidy without touching active scripts.

Example prompt: List Deployment Scripts in resource group 'app-rg' older than 30 days and delete every script whose provisioning state is Succeeded

### Agent-driven deployment hook

An AI agent stitching together an Azure environment deployment uses a Deployment Script as an extension point. Through Jentic the agent searches for the create operation, supplies the inline script and identity, then polls the get-and-logs endpoints until the script completes - all without leaving its scoped credential context.

Example prompt: Create a Deployment Script that prints the current Azure region, then poll its provisioning state until Succeeded and return the captured log output

## Key endpoints

| Method | Path | Description |
| --- | --- | --- |
| GET | /subscriptions/{subscriptionId}/providers/Microsoft.Resources/deploymentScripts | List Deployment Scripts in a subscription |
| GET | /subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.Resources/deploymentScripts | List Deployment Scripts in a resource group |
| PUT | /subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.Resources/deploymentScripts/{scriptName} | Create or update a Deployment Script |
| GET | /subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.Resources/deploymentScripts/{scriptName} | Get a Deployment Script |
| DELETE | /subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.Resources/deploymentScripts/{scriptName} | Delete a Deployment Script |
| GET | /subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.Resources/deploymentScripts/{scriptName}/logs | List logs for a Deployment Script |
| GET | /subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.Resources/deploymentScripts/{scriptName}/logs/default | Get the default log stream for a Deployment Script |

## Key resources

- **DeploymentScripts** — ARM script resources that run PowerShell or Bash during a deployment, scoped at resource group and listable across the subscription
- **DeploymentScriptLogs** — Captured stdout/stderr output from a Deployment Script run, fetchable via the logs and logs/default endpoints

## Why Jentic

- **Setup:** Wiring the Microsoft.Resources/deploymentScripts API by hand means acquiring Azure AD OAuth 2.0 bearer tokens, building the long ARM URLs under management.azure.com, and polling the long-running create and delete operations with your own backoff. Through Jentic you install once, import DeploymentScriptsClient from the API Directory, store the Azure AD credential once, and your agent calls it.
- **Permission scoping:** The script resource id sits in the URL path (/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.Resources/deploymentScripts/{scriptName}), so a rule can pin your agent to one subscription and resource group and the scripts inside it. You choose the operations it may call, so destructive ones like deleting a Deployment Script are not included unless you add them.
- **Credential handling:** Your Azure AD credential is stored once, encrypted, by your own Jentic One instance and injected as a short-lived bearer token at execution time. It never enters the agent's prompt, logs, or context.
- **Discovery method:** Agents search Jentic by intent such as 'create an azure arm deployment script' or 'get deployment script logs', and Jentic returns the matching operation with its resource-group, script-name, kind, and inline-script input schema so the agent calls the right endpoint without reading the ARM reference.

## Related APIs

- **DeploymentAdminClient** — Lists Azure Stack deployment action plans rather than ARM Deployment Scripts
- **DevTestLabsClient** — Manages DevTest Labs environments and ARM-template-based artefacts
- **DeletedWebApps API Client** — Tracks soft-deleted App Service apps that may have been removed by a deployment

## FAQ

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

Microsoft Azure does not publish an OpenAPI specification. Jentic generates and maintains this spec so that AI agents and developers can call DeploymentScriptsClient 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 Deployment Scripts API use?

The API runs through Azure Resource Manager and uses OAuth 2.0 bearer tokens issued by Azure Active Directory. Through Jentic, the AAD client secret or managed identity refresh token is held in the encrypted vault and a short-lived access token is supplied at execute time so the bearer token never appears in the agent's context.

### Can I retrieve the output of a Deployment Script run with this API?

Yes. GET .../deploymentScripts/{scriptName}/logs lists the available log streams and GET .../deploymentScripts/{scriptName}/logs/default returns the captured stdout/stderr from the script's container run. Logs persist as long as the Deployment Script resource exists.

### What are the rate limits for the Deployment Scripts API?

Azure Resource Manager applies subscription-level read and write throttles (around 12,000 reads per hour and 1,200 writes per hour per region per subscription) and returns 429 with a Retry-After header when exceeded. Deployment Script create and delete are long-running and should be polled with backoff.

### How do I create a Deployment Script through Jentic?

Search Jentic for 'create azure deployment script', load the schema for PUT .../deploymentScripts/{scriptName}, then execute with the script kind (AzurePowerShell or AzureCLI), the inline script body, retentionInterval, and a user-assigned managed identity. The pip install jentic Python SDK uses the async search, load, execute pattern.

### Is the Deployment Scripts API free?

Deployment Scripts run inside an Azure Container Instance plus a backing storage account; you pay for the container runtime and storage consumed by the run, not for the management API calls themselves. The retentionInterval on the resource controls how long the runtime artefacts persist.

### Can I limit what my agent is allowed to do with the Deployment Scripts API?

Yes. Because you run Jentic One yourself, your own rules decide which operations and credentials the agent may use, and the Deployment Script resource id lives right in the URL path (/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.Resources/deploymentScripts/{scriptName}), so a rule can pin the agent to a single subscription and resource group. You also choose exactly which operations it may call, for example granting only the list and get-logs endpoints while withholding the create/update (PUT) and delete operations. That way a destructive call like deleting a Deployment Script is unavailable unless you deliberately add it to the agent's allowed set.
