> ## Documentation Index
> Fetch the complete documentation index at: https://praison.ai/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# Deploy CLI: Azure

> Deploy agents to Azure Container Apps using praisonai deploy

Deploy agents to Azure Container Apps using `praisonai deploy run --type cloud --provider azure`.

<Note>
  As of PR #4307, `subscription_id` is **required** for Azure Container Apps deployments. `deploy`, `status`, and `destroy` fail fast when it is missing, and every `az` command now targets the configured subscription via `--subscription` — you no longer need to `az account set` beforehand for the deploy to land in the right subscription.
</Note>

## Minimal Azure Deploy

```yaml theme={"theme":{"light":"vitesse-light","dark":"vitesse-dark"}}
# agents.yaml
framework: praisonai
roles:
  assistant:
    role: Assistant
    goal: Help users
    tasks:
      help:
        description: Answer questions
        expected_output: A helpful reply

deploy:
  type: cloud
  cloud:
    provider: azure
    region: eastus
    service_name: my-agent
    resource_group: my-rg
    subscription_id: ${AZURE_SUBSCRIPTION_ID}   # required — deploy fails fast without it
```

```bash theme={"theme":{"light":"vitesse-light","dark":"vitesse-dark"}}
praisonai deploy run --file agents.yaml --type cloud --provider azure
```

That is the shortest path to a running Azure Container App — one YAML file, one command. Every `az` call under the hood targets `AZURE_SUBSCRIPTION_ID`; no `az account set` needed.

## CLI

```bash theme={"theme":{"light":"vitesse-light","dark":"vitesse-dark"}}
pip install praisonai
export OPENAI_API_KEY="your-key"
export AZURE_SUBSCRIPTION_ID="your-subscription-id"

# Initialize with Azure deploy config
praisonai deploy init --file agents.yaml --type cloud --provider azure

# Check readiness
praisonai deploy doctor --provider azure

# Deploy to Azure
praisonai deploy run --file agents.yaml --type cloud --provider azure
```

**Expected Output:**

```
🚀 Starting deployment...

☁️  Deploying to Azure Container Apps
  • Subscription: your-subscription-id
  • Resource Group: praisonai-rg
  • Region: eastus
  • Service: praisonai-service

📦 Building and pushing Docker image...
🚀 Creating Container App...

✅ Deployment successful!
🔗 URL: https://praisonai-service.azurecontainerapps.io

Metadata:
  • provider: azure
  • region: eastus
  • resource_group: praisonai-rg
  • service: praisonai-service
```

**Verify:**

```bash theme={"theme":{"light":"vitesse-light","dark":"vitesse-dark"}}
curl https://praisonai-service.azurecontainerapps.io/health
```

## Python

```python theme={"theme":{"light":"vitesse-light","dark":"vitesse-dark"}}
from praisonai.deploy import Deploy, DeployConfig, DeployType, CloudProvider
from praisonai.deploy.models import CloudConfig

config = DeployConfig(
    type=DeployType.CLOUD,
    cloud=CloudConfig(
        provider=CloudProvider.AZURE,
        region="eastus",
        service_name="praisonai-service",
        resource_group="praisonai-rg",
        subscription_id="your-subscription-id",
        cpu="0.5",
        memory="1024",
        min_instances=1,
        max_instances=10
    )
)

deploy = Deploy(config, "agents.yaml")
result = deploy.deploy()

print(f"URL: {result.url}")
```

## agents.yaml

```yaml theme={"theme":{"light":"vitesse-light","dark":"vitesse-dark"}}
framework: praisonai
topic: helpful assistant
roles:
  assistant:
    role: Assistant
    goal: Help users with their questions
    backstory: You are a helpful assistant
    tasks:
      help_task:
        description: Answer user questions
        expected_output: Helpful response

deploy:
  type: cloud
  cloud:
    provider: azure
    region: "eastus"
    service_name: "praisonai-service"
    resource_group: "praisonai-rg"
    subscription_id: "${AZURE_SUBSCRIPTION_ID}"
    cpu: "0.5"
    memory: "1024"
    min_instances: 1
    max_instances: 10
    env_vars:
      OPENAI_API_KEY: "${OPENAI_API_KEY}"
```

## Azure Cloud Config Options

| Field             | Type   | Default      | Description                                                                                                                    |
| ----------------- | ------ | ------------ | ------------------------------------------------------------------------------------------------------------------------------ |
| `provider`        | string | -            | Must be `azure`                                                                                                                |
| `region`          | string | **required** | Azure region (e.g., `eastus`)                                                                                                  |
| `service_name`    | string | **required** | Container App name                                                                                                             |
| `resource_group`  | string | **required** | Azure resource group                                                                                                           |
| `subscription_id` | string | **required** | Azure subscription ID. Deployment fails fast if unset — every `az` command now targets this subscription via `--subscription`. |
| `cpu`             | string | `0.5`        | CPU cores                                                                                                                      |
| `memory`          | string | `1024`       | Memory in MB                                                                                                                   |
| `min_instances`   | int    | `1`          | Minimum instances                                                                                                              |
| `max_instances`   | int    | `10`         | Maximum instances                                                                                                              |
| `env_vars`        | dict   | `null`       | Environment variables                                                                                                          |

## Check Deployment Status

```bash theme={"theme":{"light":"vitesse-light","dark":"vitesse-dark"}}
praisonai deploy status --file agents.yaml
```

## Destroy Deployment

```bash theme={"theme":{"light":"vitesse-light","dark":"vitesse-dark"}}
praisonai deploy destroy --file agents.yaml --yes
```

## Troubleshooting

| Issue                          | Fix                                                                                                                                                                                                                                                                                                                                     |
| ------------------------------ | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| Azure credentials              | `az login` or set env vars                                                                                                                                                                                                                                                                                                              |
| Subscription ID missing        | `deploy`/`status`/`destroy` now fail fast with `"Please specify subscription_id in cloud config"`. Add `subscription_id` to the `cloud:` section of `agents.yaml`.                                                                                                                                                                      |
| Deployed to wrong subscription | Fixed in v2.x. Every `az` command now includes `--subscription <configured id>`. If `praisonai deploy doctor --provider azure` reports an ambient-vs-configured mismatch, run `az account set --subscription <configured id>` or trust the doctor's `fix_suggestion` — the deploy itself will still target the configured subscription. |
| Resource group missing         | Create via Azure portal or CLI                                                                                                                                                                                                                                                                                                          |
| Deploy failed                  | Run `praisonai deploy doctor --provider azure`                                                                                                                                                                                                                                                                                          |

<Accordion title="Manual Azure CLI Validation (Optional)">
  These commands are for manual validation only. Use `praisonai deploy` for deployment.

  ```bash theme={"theme":{"light":"vitesse-light","dark":"vitesse-dark"}}
  # Verify Azure CLI
  az account show

  # List Container Apps
  az containerapp list --resource-group praisonai-rg

  # View logs
  az containerapp logs show --name praisonai-service --resource-group praisonai-rg
  ```
</Accordion>

## Related

* [Deploy CLI Overview](./index) - All deploy commands
* [AWS Deploy](./aws) - Deploy to AWS
* [GCP Deploy](./gcp) - Deploy to Google Cloud
