# Azure

> Run the Atlantic Agentic Engine on Azure: the stack LightHouse generates, what it creates, the permissions it takes, regions, deployment profiles, and how to remove it.

The engine runs in an Azure subscription of yours, as Terraform your own GitLab pipeline applies. Models are called through Azure OpenAI, in your subscription and region, by the gateway’s identity alone. LightHouse never applies anything in your subscription.

## The stack LightHouse generates

In LightHouse, **Setup and admin → Where agents run**, choose **Azure**, a region and a profile, then **Get my stack**. LightHouse shows three files in full, each with a **Copy** button:

1. **`lighthouse-bootstrap.bicep`**, a subscription-scope deployment that a person runs once, and
2. **`lighthouse-bootstrap-identity.bicep`**, its resource group’s half, which the first file deploys. Keep the two side by side.
3. **`main.tf`**, which calls Atlantic’s Azure module, pinned to infrastructure release `v0.7.0`, with the telemetry relay and the content reader turned on. Commit it to your own infrastructure repository; your pipeline plans and applies it from `main`, as a reviewed merge request.

There is no portal button: the portal’s custom deployment takes ARM templates, not Bicep. The bootstrap’s first lines give the command, run by a person with rights to assign roles on the subscription:

```sh
az deployment sub create --location <your region> \
  --template-file lighthouse-bootstrap.bicep \
  --parameters gitlabProjectPath=<your-group/your-infra>
```

Its outputs are `deployClientId` (your pipeline’s `ARM_CLIENT_ID`, with `ARM_USE_OIDC=true`), `stateResourceGroup` and `stateStorageAccount` (`terraform init -backend-config="storage_account_name=<stateStorageAccount>"`).

### What to have ready

- A subscription, and the Azure OpenAI model deployments you are allowed to create in your region.

- A gitlab.com project whose CI can request an ID token.

- A module access token from Atlantic: a per-tenant, read-only deploy token whose scope is the package registry read only, revocable per client. Your Terraform job reads the modules with it through a netrc file, stored as a masked, file-type CI/CD variable, with `NETRC` set to that variable. The file holds one line, and Atlantic’s stack files say the same in a comment:

  ```text
  machine gitlab.com login <the token's username> password <the token>
  ```

- A runner inside your network, or your runners’ address ranges for `deployer_cidrs`: the Key Vault’s data plane is private, and the apply must reach it.

- For `main.tf`’s variables: the subscription ID; the product’s and the gateway’s images by digest; an image carrying the engine (the gateway image will do) for the relay and the reader; your registry, if it is private (a person grants the runtime identity AcrPull on it: the pipeline cannot); the model deployments; the gateway policy; the address ranges allowed in; the monthly budget, its start date and the addresses for alerts.

### After the first apply

Terraform creates the Key Vault’s slots empty; a person fills them. The `fill_after_apply` output of `main.tf` lists the secrets to fill, by what goes in each.

## What it creates

**Your Azure subscription**: one region you choose, in its own resource group and virtual network

Way in

- **Container Apps ingress**, HTTPS: open to your address ranges only

your people and systems, from your address ranges

Engine

- **Gateway**, Container Apps, warm or scaled to zero: the only path to a model: policy, caps, kill switch
- **Your product and agents**, Container Apps: runs your agents through the gateway
- **Telemetry relay**, Container Apps, internal ingress: signs content-free records
- **Content reader**, Container Apps · a job every minute: no ingress; answers reads signed by Atlantic
- **Command channel**, Container Apps · a job every minute: applies signed commands your policy allows
- **Connector-schedule tick**, a Container Apps job: every 15 minutes, syncs your sources

model calls, from the gateway's identity alone, over a private endpoint

Models

- **Azure OpenAI**, in your subscription, no public access: a content filter on every deployment

Kept in your subscription

- **Secrets and keys**, Key Vault (premium, private endpoint): the deployment key, tokens, connector credentials
- **Database and index**, PostgreSQL Flexible Server: on a private address
- **Logs**, Log Analytics: activity, vault and database; every content read

One outbound path, through your NAT gateway, over HTTPS

- **Operational telemetry** (downward): counts, costs and timings from the relay, signed by your deployment. Never content
- **Content, read in place** (both ways): a read signed by Atlantic, answered by your reader on the connection it opened
- **Signed commands** (upward): pause, approve, set a cap: checked by your command channel against your policy

**LightHouse**: your tenant, in Atlantic's account: intake, API, MCP and portal

The stack your pipeline applies on Azure. Every component runs in your subscription; Azure OpenAI has no public access and answers the gateway's identity alone; the relay, the content reader and the command channel each dial out to LightHouse, and nothing listens for Atlantic. Where two forms are named, the second is the ephemeral profile's.

- Azure Container Apps
- Azure Database for PostgreSQL
- Azure Key Vault
- Azure Monitor
- Azure Blob Storage
- Azure OpenAI

The bootstrap, in a resource group of its own, `lighthouse-<tenant id>-bootstrap`:

| Resource                        | What it is                                                                                                                                                                                                                                                                        |
| ------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `lighthouse-deploy-<tenant id>` | A user-assigned identity, with one federated credential that only your GitLab project’s `main` branch can use. No secret is created                                                                                                                                               |
| The state account               | A zone-redundant storage account for the Terraform state: Entra ID sign-in only (shared keys off), TLS 1.2, no public blob access, versioned, with 30 days’ soft delete of blobs and containers. The identity holds Storage Blob Data Contributor on its `tfstate` container only |
| A read-only lock                | On the bootstrap’s group, so the pipeline cannot add a credential for another branch. Contributor cannot lift it; a person changes the bootstrap                                                                                                                                  |

The engine, from `main.tf`, in its own resource group `aal-<client>`:

| Area                | Resources                                                                                                                                                                                                  |
| ------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| Network             | A virtual network with subnets for the apps (delegated to Container Apps), private endpoints and the database, with default outbound access off; network security groups; a NAT gateway; private DNS zones |
| Keys and secrets    | A premium Key Vault (RBAC, purge protection, private endpoint); the data key; the gateway’s token, policy and the product’s key as secrets                                                                 |
| Logs                | A Log Analytics workspace, with diagnostics for the subscription’s activity log, the vault and the database                                                                                                |
| Database            | Azure Database for PostgreSQL Flexible Server on a private address                                                                                                                                         |
| Budget              | A subscription budget alerting at 80% forecast and 100% actual                                                                                                                                             |
| Compute             | A Container Apps environment with the `gateway` and `app` container apps                                                                                                                                   |
| Models              | An Azure OpenAI account with no public access and no keys, a content filter on every deployment, and your model deployments                                                                                |
| Telemetry and reads | The relay (internal ingress only) and the content reader (no ingress; it dials out to LightHouse and answers only reads signed with Atlantic’s reader key)                                                 |

**The command channel, the connector-schedule tick and the sealing key are in the generated stack**: the command channel with every command type off, connector credentials kept in your own Key Vault, a slot for the sealing key, and the tick every 15 minutes, on both profiles.

## Permissions

| Identity                                          | Holds                                                                         | Why                                                                                                                                                                                                                                                                           |
| ------------------------------------------------- | ----------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `lighthouse-deploy-<tenant id>` (your pipeline)   | Contributor on the subscription                                               | The module creates its own resource group, a subscription budget and the activity log’s diagnostic setting                                                                                                                                                                    |
|                                                   | Role Based Access Control Administrator on the subscription, with a condition | It may create or delete an assignment of only the module’s five roles: Cognitive Services OpenAI User, Key Vault Crypto Officer, Key Vault Secrets Officer, Key Vault Secrets User and Key Vault Crypto Service Encryption User. Never Owner, Contributor, or more for itself |
|                                                   | Storage Blob Data Contributor on the state container                          | The Terraform state                                                                                                                                                                                                                                                           |
| Gateway (the only identity that may call a model) | Cognitive Services OpenAI User on the model account                           |                                                                                                                                                                                                                                                                               |
| Product                                           | No role                                                                       |                                                                                                                                                                                                                                                                               |
| Runtime                                           | Key Vault Secrets User                                                        | Its own secrets                                                                                                                                                                                                                                                               |
| Keys                                              | Key Vault Crypto Service Encryption User                                      | Encryption with your key                                                                                                                                                                                                                                                      |

The bootstrap grants Atlantic no access to your subscription.

Turning `models_enabled` off removes the gateway’s model role: a second kill switch, which Azure applies within minutes rather than instantly. See [Suspension](/operations/suspension/).

## Regions

LightHouse offers westeurope (the default), northeurope, uksouth, eastus and westus2. Every resource is in the location you choose; geography-wide names (`europe`, `uk`, `global`) are refused. Model deployments may be only `Standard` or `ProvisionedManaged`: Global and DataZone deployments, which can process in other regions, are refused. See [Regions](/data-sovereignty/regions/).

## Deployment profiles

The module defaults to `always_on`; LightHouse proposes `ephemeral`, and writes the profile you chose into `main.tf`.

|                                                        | Always-on                              | Ephemeral                                                            |
| ------------------------------------------------------ | -------------------------------------- | -------------------------------------------------------------------- |
| Gateway                                                | Two warm replicas                      | Scales to zero; the first request wakes a replica and waits for it   |
| Relay                                                  | One replica                            | Zero, woken by the first post                                        |
| Content reader                                         | A container app holding its connection | A Container Apps job every minute; a read waits up to about a minute |
| Product                                                | One replica                            | One replica                                                          |
| Database                                               | General Purpose, with a standby        | Burstable (`B_Standard_B1ms`), no standby                            |
| Estimated saving on the lines that differ (westeurope) | —                                      | around 72%                                                           |

The estimated saving on those lines is around 72%, from the module’s cost model at list prices before free grants and discounts. Most of it comes from the database: for an ephemeral deployment, the generated `main.tf` sets a burstable server (`db_sku_name = "B_Standard_B1ms"`, no standby) instead of the module’s general-purpose default. The `deployment_profile` variable itself does not resize the database, and Azure’s PostgreSQL Flexible Server cannot pause when idle, which is why the saving is the lowest of the three clouds. It is given as a proportion because the amount depends on your region, your currency, any committed-use or reserved pricing and the size you run. Your own figures appear in LightHouse once your deployment reports its infrastructure cost. The lines both profiles share (the product, Key Vault, Log Analytics, private endpoints, the Container Apps environment) are left out of both. Wake times on Azure are estimates, not yet measured in a client subscription.

To switch, change `deployment_profile`, plan and apply: nothing holding data is replaced. Resizing the database is a separate change. See [Deployment profiles](/concepts/deployment-profiles/).

Scheduled (`scheduled`, with `wake_schedule`) is built as ephemeral, and inside its [wake window](/concepts/deployment-profiles/#the-wake-window) a cron scale rule per window keeps warm gateway replicas running; the HTTP rule still adds replicas under load.

## Upgrading and removing the stack

- **Upgrade**: change the release version in the module package’s address (`https://gitlab.com/api/v4/projects/<atlantic-project>/packages/generic/lighthouse-modules/<version>/lighthouse-modules.tar.gz`), changed by getting the stack again for the new release, in a reviewed merge request. See [Upgrades](/operations/upgrades/).
- **Remove**: see Remove my stack, below.

### Remove my stack

As a client administrator, open **Setup and admin → Run → Remove my stack**. LightHouse generates a step-by-step guide (`lighthouse-removal.md`) and a pipeline job file (`lighthouse-removal.gitlab-ci.yml`) for this stack. It changes nothing itself, and nothing runs automatically: the jobs are manual, run on your main branch only, and refuse to run until the CI/CD variable `LIGHTHOUSE_REMOVE` names the deployment.

1. **Destroy** the stack with `terraform destroy`. The Key Vault has purge protection, so its name is held for its soft-delete period.
2. **Delete the bootstrap**, a person’s step: lift its read-only lock, remove the identity’s two role assignments on the subscription, and delete the bootstrap’s resource group, with the state in it.
3. **Deregister in LightHouse**, a person’s step.

Deregistering is the last step. You sign in as a person with a second factor (a machine key or a delegated token is refused), type the deployment’s name again and give a reason. LightHouse then refuses the deployment’s signatures from that moment and records it in the audit log. Only Atlantic can reinstate it, within 30 days.

Source: https://docs.atlanticagenticlabs.com/where-it-runs/azure/
