> Portal Navigation: > > - Append `.md` to any URL under `https://dev.wix.com/docs/` to get its markdown version. > - Pages are either content pages (article or reference text) or menu pages (a list of links to child pages). > - To get a menu page, truncate any URL to a parent path and append `.md` (e.g. `https://dev.wix.com/docs/sdk.md`, `https://dev.wix.com/docs/sdk/core-modules.md`). > - Top-level index of all portals: https://dev.wix.com/docs/llms.txt > - Full concatenated docs: https://dev.wix.com/docs/llms-full.txt ## Resource: Integrate your Microsoft Azure Database with your Wix Site ## Article: Integrate your Microsoft Azure Database with your Wix Site ## Article Link: https://dev.wix.com/docs/develop-websites-sdk/code-your-site/work-with-data/external-databases/microsoft-azure/integrate-your-microsoft-azure-database-with-your-wix-site.md ## Article Content: # Integrate Your Microsoft Azure Database with Your Wix Site > **Note:** This feature is only available for sites with certain premium plans. If you need to use this feature, you can [upgrade your site](https://www.wix.com/upgrade/website). Learn more about [premium plans](https://dev.wix.com/docs/develop-websites-sdk/maintain-your-site/scale-your-site/about-premium-plans.md). Wix allows users to connect an external database to Wix sites using an [external database adaptor](https://dev.wix.com/docs/develop-websites-sdk/code-your-site/work-with-data/external-databases/overview/about-integrating-external-databases-with-your-wix-site.md#external-database-adaptors). Once the connection is set up, users can interact with these databases and use them to populate site elements as though they were Wix CMS collections. With an external database adaptor, you can use your MySQL database hosted on Azure and fully integrate it into your Wix site. This means your Azure data can be managed via the [Wix Data APIs](https://dev.wix.com/docs/rest/business-solutions/cms/introduction.md), and used (with or without [datasets](https://dev.wix.com/docs/velo/velo-only-apis/$w/dataset/introduction.md)) to populate Wix UI elements like [repeaters](https://dev.wix.com/docs/develop-websites-sdk/get-started/tutorials/data/tutorial-display-database-collection-content-in-a-repeater.md) and [tables](https://support.wix.com/en/article/cms-formerly-content-manager-displaying-collection-content-in-a-table). ## Overview This article walks you through the following: 1. Creating a web app. 2. Setting up a key vault and secrets. 3. Testing your adaptor. 4. Connecting your Wix site. This tutorial assumes you already have your own Azure database server for MySQL with a table containing some data. If you don't have this set up, refer to the [Azure Database for MySQL documentation](https://learn.microsoft.com/en-us/azure/mysql/) for instructions. This tutorial uses a container image with all the functionality needed to interface between your database and your Wix site. If you want to look under the hood, you can have a look at the [service plugin specifications](https://www.wix.com/velo/reference/spis/external-database-collections) for external database collections, and an overview of what's involved in [building your own adaptor](https://support.wix.com/en/article/velo-working-with-external-database-collections).
**Prerequisites for Read-Write Access to Your Database Tables:**> **Note:** We don't provide specific instructions for any configuration in Azure, as Azure's UI and flows may change. For further details on any of the instructions below, see the [Azure Database for MySQL documentation](https://learn.microsoft.com/en-us/azure/mysql/). ## Step 1 | Create a Web App A web app service is needed to run the adaptor and make it accessible to your Wix site. To deploy the adaptor as a web app: 1. Create a web app service to run the container. 2. Use the following **Container Image URL**: ```bash veloex/velo-external-db:latest ``` 3. Add the virtual network to the web app. ## Step 2 | Set up a Key Vault and secrets The external database adaptor uses environment variables to configure database credentials and connection details. Some of these variables are sensitive and shouldn't be visible. Use the Key Vault to store and access these variables securely. 1. Create a new Key Vault. 2. Define and then create the following 5 secrets: * **HOST**: The host name of your database instance. It can be found on your instance's overview page as the **Server name**. * **USER**: The username used to connect to your database instance. It can be found on your instance's overview page as the **Server admin login name** as shown below. * **PASSWORD**: The server admin login password used to connect to your SQL instance. * **DB**: The database name. When you created your database in the previous steps, you called the database **mysqlTutorial.** You can find this in the MySQL database server overview - under **Available Resources** at the bottom of the page. * **SECRETKEY**: A secret key that's used when connecting your Wix site to the adaptor. To create a level of authentication between your site and the adaptor, each request your site sends to the adaptor contains this value in the payload. For the tutorial, use **myBigSecret** as the SECRETKEY value. * **PERMISSIONS** (optional) A stringified JSON object that defines the read and write permissions for the tables in your database. When setting up permissions, note a couple of important things: - If you don't set permissions, they default to admin. With admin permissions, only site admins can read or write to the external database from a Wix site. API calls or CMS connections to the database don't work for anyone who isn't a site admin. This means site code that communicates with the external database might not work for site visitors. - When setting up permissions, make sure you use the ID of the table you want to read and write to, and not the database ID. > **Note:** > Customizing permissions for external databases is currently a developer preview feature, and may change. > Changes to permission settings are not reflected in the editor.
If you want your table to be read-write on your Wix site, it must contain the following columns: - `_id` - `_createdDate` - `_updatedDate` - `_owner` Tables without these columns will be read-only in your Wix site.