canonical: https://jentic.com/apis/azure.com/azure-sql-database-import

# Microsoft Azure Azure SQL Database Import/Export spec

Jentic publishes the only available OpenAPI specification for Azure SQL Database Import/Export spec, keeping it validated and agent-ready. The API drives BACPAC-based import and export operations on Azure SQL Database, letting agents export a database to Azure Blob Storage, import a BACPAC into a new database, or register an extension that tracks the operation. It targets the Microsoft.Sql resource provider on Azure Resource Manager and is intended for migration, archival, and environment-cloning workflows rather than live data access.

## For AI agents

Export Azure SQL databases to BACPAC files in Blob Storage and import BACPACs back into new or existing databases.

## Scope

Does not handle live query, point-in-time restore, or schema migration - use for BACPAC import and export operations only.

## Capabilities

- Export an Azure SQL database to a BACPAC file in Azure Blob Storage
- Import a BACPAC file from Blob Storage into a new Azure SQL database
- Register an import-export extension on an existing database
- Provide storage account credentials inline with the export request
- Specify edition, service objective, and max size for an imported database
- Drive long-running import or export operations from infrastructure automation

## Use cases

### Scheduled BACPAC export for archival

Run a nightly export of an Azure SQL database to Azure Blob Storage so the BACPAC sits alongside long-term retention backups in a separate storage account. The POST /databases/{databaseName}/export operation accepts inline storage credentials and returns an operation handle that callers poll until the BACPAC is written. Useful for compliance-driven archival where point-in-time backups alone are insufficient.

Example prompt: POST to /databases/{databaseName}/export with the target storage URI, key type, and admin credentials, then poll the returned operation until status is Succeeded

### Environment cloning via BACPAC import

Clone a production database into a development or staging environment by importing a previously exported BACPAC into a freshly provisioned database. The PUT /servers/{serverName}/import operation creates the target database and loads the BACPAC in one call. This is the canonical pattern for spinning up isolated test environments without exposing them to production traffic.

Example prompt: PUT to /servers/{serverName}/import with the source BACPAC URI, target database name, edition Standard, and serviceObjective S1, then verify the new database appears in the server's database list

### Cross-subscription database migration

Move a database between Azure subscriptions by exporting it to a shared blob container, then importing into a server in the destination subscription. The same import/export operations work in both directions, with the storage URI acting as the handoff point. Avoids the more complex geo-replication or DMS flows when a one-time migration is enough.

Example prompt: Export source database to blob://migration/db.bacpac, then issue PUT /servers/{newServerName}/import in the destination subscription pointing at the same URI

### Agent-driven backup and restore

Let an AI agent execute a one-shot export or import in response to a developer request, without needing to know the exact ARM resource path or storage credential format. Through Jentic, the agent searches for the export operation, loads the storage URI and credential schema, and executes the call. Removes the need for ad hoc PowerShell or az CLI scripting.

Example prompt: Search Jentic for 'export azure sql database to bacpac', load the storage credential schema, and execute against the target database

## Key endpoints

| Method | Path | Description |
| --- | --- | --- |
| POST | /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/export | Export a database to a BACPAC in Blob Storage |
| POST | /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/import | Import a BACPAC into a new database |
| PUT | /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/extensions/{extensionName} | Register an import or export extension |

## Key resources

- **export** — Export a database to a BACPAC in Blob Storage
- **import** — Import a BACPAC into a new database under a server
- **extensions** — Register an import or export extension on an existing database

## Why Jentic

- **Setup:** Wiring the Azure SQL Import/Export API by hand means registering an Azure AD app for OAuth2 bearer auth against management.azure.com, assembling the long Microsoft.Sql resource path, plumbing inline storage account credentials into the export body, and polling the Azure-AsyncOperation header until the BACPAC lands. Through Jentic you install once, import Azure SQL Database Import/Export from the API Directory, store the Azure AD credential once, and your agent calls it.
- **Permission scoping:** The database sits in the URL path (/servers/{serverName}/databases/{databaseName}/export), so a rule can pin your agent to one server or database and let it export or import only there. You choose the operations it may call, so the extension-registration PUT is not included unless you add it.
- **Credential handling:** Your Azure AD credential and any storage account key are stored once, encrypted, by your own Jentic One instance and injected at execution time. They never enter the agent's prompt, logs, or context.
- **Discovery method:** Agents search Jentic by intent such as 'export an azure sql database to a bacpac' or 'import a bacpac into a new database', and Jentic returns the matching Microsoft.Sql import or export operation with its storage credential input schema so the agent calls the right endpoint without assembling the ARM path by hand.

## Related APIs

- **Azure SQL Database backup** — Manages point-in-time backups for the same databases this API exports
- **Azure SQL Database** — Provisions the SQL databases that import/export operates against
- **Azure SQL Server Backup Long Term Retention Vault** — Stores backups in a managed retention vault rather than BACPAC files

## FAQ

### Why is there no official OpenAPI spec for Azure SQL Database Import/Export spec?

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

The API uses Azure AD OAuth 2.0 with the implicit flow, scoped to user_impersonation against management.azure.com. Through Jentic, the bearer token is held in your Jentic One instance so service principal secrets never enter the agent's context.

### Can I export a database to my own storage account with this API?

Yes. The POST /databases/{databaseName}/export request accepts a storageUri, storageKeyType (StorageAccessKey or SharedAccessKey), and storageKey, plus the admin login and password. The BACPAC is written to the URI you supply.

### What are the rate limits for this API?

Azure Resource Manager applies tenant-level throttling - typically 12,000 reads and 1,200 writes per hour per subscription. Import and export are long-running operations that return 202 Accepted; track completion via the Azure-AsyncOperation header rather than retrying.

### How do I run a BACPAC import through Jentic?

Run pip install jentic, then search for 'import bacpac azure sql'. Jentic returns the PUT /servers/{serverName}/import operation, loads the storage credential and database settings schema, and executes against your target server.

### Does this API restore from automated backups?

No. This API works with BACPAC files in Blob Storage only. For point-in-time restore from Azure-managed backups, use the azure-sql-database-backup API on the same Microsoft.Sql provider.

### Can I limit what my agent is allowed to do with the Azure SQL Database Import/Export API?

Yes. Jentic One runs self-hosted, so your own rules decide which operations and credentials the agent may use. Because the server and database sit in the URL path, you can pin the agent to a single server or database and let it call only the export or import operation there. The extension-registration PUT stays off unless you explicitly add it to what the agent may call.
