Bring your own cloud: Connect your Azure subscription
Once a subscription is connected and verified, it appears under Where it runs when you create an Azure database in one of its regions. See Create a database…
Once a subscription is connected and verified, it appears under Where it runs when you create an Azure database in one of its regions. See Create a database in your account.
Connecting a subscription takes about ten minutes. You must be the owner of the KiviDB organization. In Azure, you need to be an Owner of the subscription (or Contributor plus User Access Administrator), and an Entra role that may add an application to your tenant, such as Application Administrator. If you don't have the Entra role, an administrator can do that one step for you with a link; see Give consent.
Before you start, have ready:
- the tenant ID (Microsoft Entra ID, Overview) and the subscription ID
- a name for the resource group KiviDB will work in. Everything KiviDB
creates goes in it. The default is
kividb; the setup creates it if it doesn't exist. - the regions you want databases in
- an existing storage account in that subscription, and a container in it, for backups. The setup creates the container if it doesn't exist.
- for each region, the subnet to put databases in, as its full resource ID. The subnet must be in the same subscription. Subnets in another subscription are not supported yet.
Open Settings → Cloud accounts and click Connect a cloud account. Your progress is saved after each step, so you can close the dialog and come back. An unfinished connection shows as Pending, and Continue setup picks up where you left off.
1. Choose the cloud
Choose Azure.
2. Enter the subscription details

- Name: what this connection is called in KiviDB, for example Production Azure.
- Tenant ID and Subscription ID: both GUIDs, such as
00000000-0000-0000-0000-000000000000. - Resource group: where KiviDB creates everything. KiviDB's management role applies to this resource group and nowhere else, so keep anything KiviDB should not manage out of it.
- Regions: every region KiviDB may create databases in.
- Backup storage account and Container: backups are written under
kividb/in the container. KiviDB cannot read anything else in the account, and cannot read its keys. - Allow public endpoints: databases get an internet address that only the IPs on their allowlist can reach. Leave it on for now: databases can be created only in a connection that allows public endpoints. Without public endpoints, each subnet needs a NAT gateway (or a firewall that reaches the internet).
Click Create connection. These details are fixed from here on. To change them, you disconnect the subscription and connect it again. Each resource group can be connected to an organization once.
3. Choose the network

For each region, paste the subnet's resource ID. In the Azure portal it is on the subnet's Properties page, and looks like:
/subscriptions/SUBSCRIPTION_ID/resourceGroups/network/providers/Microsoft.Network/virtualNetworks/prod-vnet/subnets/databases
An Azure subnet spans every availability zone in its region, so one subnet per region is enough. You can name more than one, as long as they are in the same virtual network.
The network comes before access on Azure because KiviDB is only allowed to place machines in the subnets you name here: the setup command grants exactly those. KiviDB does not change your network. It adds a network security group to each database's network interfaces, and nothing else. That group lets in the database's allowlist, KiviDB's control plane, the database's own nodes (to replicate to each other), and your virtual network's address ranges on the database's private endpoint. See Connect from inside your VPC.
4. Give consent

KiviDB works in your subscription as its own Azure app, called KiviDB. KiviDB signs in as the app with its own secret, which never leaves KiviDB: no credential of yours is created or shared. First the app is added to your Microsoft Entra tenant:
- Click Open the consent page, signed in as an administrator of the tenant (Global, Application or Cloud Application Administrator).
- Review the request and click Accept. You are returned to KiviDB, on the next step.
Consent gives KiviDB no access by itself. It only lets the next step assign KiviDB's roles.
If whoever runs the next step's command is an Entra administrator, the command adds the app itself, so you can skip this step and click Next.
5. Grant access

Now give KiviDB's app its roles. Do it one of two ways. Both create exactly the same things.
Option 1: Cloud Shell
- Click Open Cloud Shell and choose Bash, signed in as an Owner of the subscription.
- Copy the Command shown in KiviDB, paste it into Cloud Shell and press Enter. Your subscription, resource group, storage, subnets and KiviDB's app are already filled in.
The command downloads KiviDB's setup script and runs it. To read the script first, click Download the script to read it. It is safe to run more than once. It:
- registers the Microsoft.Compute, Microsoft.Network and Microsoft.Storage resource providers
- creates the resource group, if it doesn't exist
- adds KiviDB's app to your tenant
- creates three custom roles, named for your subscription: KiviDB management, KiviDB subscription reads and KiviDB subnet join
- assigns them to KiviDB's app: management on the resource group only, reads on the subscription, subnet join on each subnet you chose
- assigns Storage Blob Data Contributor on your backup container and Storage Blob Delegator on its storage account
- adds one CORS rule to the storage account's Blob service so the KiviDB
console can upload
.kdbfiles into it, merged with the rules already there (see Browser uploads (CORS))
Option 2: Terraform
- Click Download Terraform module and unzip it next to your configuration.
- Copy the Module block shown in KiviDB into your configuration.
- Run
terraform applywith theazurermandazureadproviders signed in to your tenant and subscription.
Adding KiviDB's app to your tenant needs an Entra role such as Application Administrator. If whoever runs the command doesn't have one, an administrator gives consent first (step 4); the command then finds the app and assigns its roles.
Then click I've granted access. Role assignments in Azure can take a few minutes to apply.
For exactly what each role allows, see Permissions and security.
6. Verify

Click Verify. KiviDB checks the whole setup and lists every check that
failed, each with what to fix. Nothing is created except one test file under
kividb/ in your backup container, which is deleted again.
| Check | What it confirms |
|---|---|
| KiviDB can sign in to your tenant | KiviDB's app is in your tenant. |
| Subscription is reachable and enabled | The subscription is in that tenant, KiviDB can read it, and it is active. |
| Resource providers are registered | Microsoft.Compute, Microsoft.Network and Microsoft.Storage. |
| Resource group exists | The resource group is there and KiviDB can see it. |
| KiviDB has every action it needs in the resource group | Each action in the management role, named one by one if any is missing. |
| KiviDB can read what it needs in the subscription | Each action in the subscription reads role. |
| Azure Policy | That no policy on the resource group excludes your regions, forbids public IP addresses (when public endpoints are on), or forbids a resource type KiviDB creates. |
| Network in region | Each subnet exists, its virtual network is in that region, KiviDB may join it, it is not delegated to a service, and it has a way to the internet. |
| vCPU quota in region | Whether the subscription has enough free vCPU quota for a database there. |
| Backup storage account is reachable | KiviDB can sign backup links for the storage account. |
| KiviDB can write, list and delete under kividb/ | The container grant works for real. |
A check marked with a warning passed but needs your attention. For example, a custom policy may deny something by location that KiviDB cannot evaluate, a subnet may send internet traffic through a firewall, or the quota may be low. Read the detail and check it yourself.
When every check passes, the connection is Verified. If a check fails, see Troubleshooting.
Browser uploads (CORS)
When you import a .kdb file from the KiviDB console and store it in this
subscription, your browser uploads it straight into your backup container,
through a short-lived link signed by KiviDB. Azure Storage only accepts that
from a browser when the storage account's CORS settings allow the KiviDB
console's site, so the setup adds one rule to the account's Blob service:
origin https://kividb.io (the console), method PUT, allowed headers
Content-Type and x-ms-blob-type, exposed header ETag, max age 3600
seconds.
Blob CORS belongs to the storage account, not a container, so the rule applies to every container in the account. It is merged into the account's existing CORS rules: rules you already have are kept, no other Blob service setting changes, and nothing is added when a rule already allows these uploads. The rule only lets a browser on the KiviDB site send a request; the request still needs a link signed by KiviDB. KiviDB gets no permission to change it.
The Terraform module cannot add it, because the storage account is not the
module's. Run the module's cors_command output once in Azure Cloud Shell,
from the module's directory:
bash setup.sh --subscription YOUR_SUBSCRIPTION_ID --storage-account YOURACCOUNT --console-origin https://kividb.io --cors-only
Nothing else needs it. Verify shows Browser uploads allowed with a warning when the rule is missing.
Manage a connection
An Azure connection has the same actions as the others: Check again, Edit network and Disconnect. Its Access setup section always shows the current command and module. After you edit the network, or when KiviDB needs a new permission, run the command again (or apply the latest module), then click Check again.
To revoke KiviDB's access, delete the KiviDB application from your tenant (Microsoft Entra ID, Enterprise applications), or remove its role assignments. See Permissions and security.