> For the complete documentation index, see [llms.txt](https://docs.uibakery.io/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.uibakery.io/on-premise/install-and-update/installing-on-premise-version/azure-container-instance.md).

# Azure container instance

To deploy UI Bakery to an Azure container instance, follow these steps:

1. Login docker to Azure.

```bash
docker login azure
```

2. Create a docker context.

```bash
docker context create aci uibakery
```

3. Use new context.

```bash
docker context use uibakery
```

4. Clone ui bakery self-hosted repository.

```bash
git clone https://github.com/uibakery/self-hosted.git && cd self-hosted
```

5. UI Bakery requires db to persist its data. So it's necessary to create one. We suggest you use [**Azure Database for MySQL**](https://azure.microsoft.com/en-us/services/mysql/#overview).
6. Set `UI_BAKERY_LICENSE_KEY` variable in *docker-compose-azure-container-instances.yml* for `bakery-back` service.

```bash
UI_BAKERY_LICENSE_KEY=${UI_BAKERY_LICENSE_KEY:-eyJhbGciOiJIUz}
```

7. Set `UI_BAKERY_DB_*` variables in *docker-compose-azure-container-instances.yml* for `bakery-back` service.

```bash
UI_BAKERY_DB_HOST=${UI_BAKERY_DB_HOST:-azure-container-instance-test-db.mysql.database.azure.com}
UI_BAKERY_DB_PORT=${UI_BAKERY_DB_PORT:-3306}
UI_BAKERY_DB_DATABASE=${UI_BAKERY_DB_DATABASE:-bakery}
UI_BAKERY_DB_USERNAME=${UI_BAKERY_DB_USERNAME:-uibakeryuser@azure-container-instance-db}
UI_BAKERY_DB_PASSWORD=${UI_BAKERY_DB_PASSWORD:-uibakerypassword}
```

8. Up the Azure container instance.

```bash
docker compose -f docker-compose-azure-container-instances.yml up
```

9. Find the assigned IP address. Run `docker ps` and in column *PORTS* you'll find the assigned IP address.
10. Replace all occurrences of `UI_BAKERY_APP_SERVER_NAME` with the IP address retrieved in the previous step.

```bash
UI_BAKERY_APP_SERVER_NAME=https://123.123.123.123
```

11. Restart the instance to apply the new configuration.

```bash
docker compose -f docker-compose-azure-container-instances.yml up
```


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://docs.uibakery.io/on-premise/install-and-update/installing-on-premise-version/azure-container-instance.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
