quinzee.cloud

Development edition · 16 November 2026. Commands using repository paths, Make targets or sample projects require access to the Quinzee source checkout. No public installer is available. Examples use disposable local environments.

Developer’s guide

27. Provision databases and a cache with real engines

Run the infrastructure workshop first. Each file below is complete and deploys at resource-group scope. Use a separate deployment name for each lesson so its operation history is easy to find.

Provision PostgreSQL and an application database

Run make engine-images once, then leave make engines-run running against the same cloud data directory and Docker network. Supply password using the private parameter-file procedure. The provider owns lifecycle; SQL clients connect to a separate real PostgreSQL process.

Step 1: save the Bicep

The repository copy is examples/book-iac/postgresql.bicep. To experiment, save this complete sample to .local/book-iac/postgresql.bicep:

targetScope = 'resourceGroup'
param prefix string = 'booklab'
param location string = resourceGroup().location

param administrator string = 'appadmin'
@secure()
param password string
resource server 'Microsoft.DBforPostgreSQL/flexibleServers@2024-08-01' = {
  name: '${prefix}-postgresql'
  location: location
  properties: {
    administratorLogin: administrator
    administratorLoginPassword: password
    version: '18'
  }
}
resource database 'Microsoft.DBforPostgreSQL/flexibleServers/databases@2024-08-01' = {
  parent: server
  name: 'application'
  properties: {}
}
output hostname string = server.properties.fullyQualifiedDomainName

Step 2: inspect the ARM equivalent

The compiler emits these resource objects. The surrounding template also contains the parameters and outputs declared above. Expressions in square brackets are evaluated by the deployment engine, not by your shell.

[
  {
    "type": "Microsoft.DBforPostgreSQL/flexibleServers",
    "apiVersion": "2024-08-01",
    "name": "[format('{0}-postgresql', parameters('prefix'))]",
    "location": "[parameters('location')]",
    "properties": {
      "administratorLogin": "[parameters('administrator')]",
      "administratorLoginPassword": "[parameters('password')]",
      "version": "18"
    }
  },
  {
    "type": "Microsoft.DBforPostgreSQL/flexibleServers/databases",
    "apiVersion": "2024-08-01",
    "name": "[format('{0}/{1}', format('{0}-postgresql', parameters('prefix')), 'application')]",
    "properties": {},
    "dependsOn": [
      "[resourceId('Microsoft.DBforPostgreSQL/flexibleServers', format('{0}-postgresql', parameters('prefix')))]"
    ]
  }
]

Step 3: compile, deploy and check

python3 scripts/deps/bicep.py build .local/book-iac/postgresql.bicep \
  --outfile .local/book-iac/postgresql.json

Supply these required parameters: password. Run the deployment command from the workshop with --name postgresql, --template .local/book-iac/postgresql.json and a distinct outputs filename. Add --parameters when supplying inputs. Select the same deployment in QHQ and wait for Succeeded.

Wait for the deployment to succeed and server readiness before connecting on TLS port 5432. The database should be named application. Create a table with Npgsql, stop/start the server, and verify the row survives. Deleting the server removes its managed data volume.

Use the same lifecycle with MySQL

Use a distinct server name and the MySQL 8.4 version accepted by this provider. The administrator account is local database authentication, not an Entra user. Supply a private password parameter and keep the engine supervisor running.

Step 1: save the Bicep

The repository copy is examples/book-iac/mysql.bicep. To experiment, save this complete sample to .local/book-iac/mysql.bicep:

targetScope = 'resourceGroup'
param prefix string = 'booklab'
param location string = resourceGroup().location

param administrator string = 'appadmin'
@secure()
param password string
resource server 'Microsoft.DBforMySQL/flexibleServers@2023-12-30' = {
  name: '${prefix}-mysql'
  location: location
  properties: {
    administratorLogin: administrator
    administratorLoginPassword: password
    version: '8.4'
  }
}
resource database 'Microsoft.DBforMySQL/flexibleServers/databases@2023-12-30' = {
  parent: server
  name: 'application'
  properties: {}
}
output hostname string = server.properties.fullyQualifiedDomainName

Step 2: inspect the ARM equivalent

The compiler emits these resource objects. The surrounding template also contains the parameters and outputs declared above. Expressions in square brackets are evaluated by the deployment engine, not by your shell.

[
  {
    "type": "Microsoft.DBforMySQL/flexibleServers",
    "apiVersion": "2023-12-30",
    "name": "[format('{0}-mysql', parameters('prefix'))]",
    "location": "[parameters('location')]",
    "properties": {
      "administratorLogin": "[parameters('administrator')]",
      "administratorLoginPassword": "[parameters('password')]",
      "version": "8.4"
    }
  },
  {
    "type": "Microsoft.DBforMySQL/flexibleServers/databases",
    "apiVersion": "2023-12-30",
    "name": "[format('{0}/{1}', format('{0}-mysql', parameters('prefix')), 'application')]",
    "properties": {},
    "dependsOn": [
      "[resourceId('Microsoft.DBforMySQL/flexibleServers', format('{0}-mysql', parameters('prefix')))]"
    ]
  }
]

Step 3: compile, deploy and check

python3 scripts/deps/bicep.py build .local/book-iac/mysql.bicep \
  --outfile .local/book-iac/mysql.json

Supply these required parameters: password. Run the deployment command from the workshop with --name mysql, --template .local/book-iac/mysql.json and a distinct outputs filename. Add --parameters when supplying inputs. Select the same deployment in QHQ and wait for Succeeded.

Connect with MySqlConnector on verified TLS port 3306 and select application. A created ARM record is not proof that the engine is ready. A missing helper leaves provisioning pending until it fails; repair the helper before redeploying.

Provision an encrypted disposable cache

The ARM shape is Managed Redis; the local process is Valkey. This lesson creates one default database with encrypted clients, no clustering and no eviction. It requires the engine supervisor just like SQL. Its access key is obtained through an authenticated operation, not an ARM output.

Step 1: save the Bicep

The repository copy is examples/book-iac/redis.bicep. To experiment, save this complete sample to .local/book-iac/redis.bicep:

targetScope = 'resourceGroup'
param prefix string = 'booklab'
param location string = resourceGroup().location

resource cache 'Microsoft.Cache/redisEnterprise@2025-04-01' = {
  name: '${prefix}-cache'
  location: location
  sku: { name: 'Balanced_B0' }
  properties: { minimumTlsVersion: '1.2' }
}
resource database 'Microsoft.Cache/redisEnterprise/databases@2025-04-01' = {
  parent: cache
  name: 'default'
  properties: {
    clientProtocol: 'Encrypted'
    clusteringPolicy: 'NoCluster'
    evictionPolicy: 'NoEviction'
  }
}
output hostname string = cache.properties.hostName

Step 2: inspect the ARM equivalent

The compiler emits these resource objects. The surrounding template also contains the parameters and outputs declared above. Expressions in square brackets are evaluated by the deployment engine, not by your shell.

[
  {
    "type": "Microsoft.Cache/redisEnterprise",
    "apiVersion": "2025-04-01",
    "name": "[format('{0}-cache', parameters('prefix'))]",
    "location": "[parameters('location')]",
    "sku": {
      "name": "Balanced_B0"
    },
    "properties": {
      "minimumTlsVersion": "1.2"
    }
  },
  {
    "type": "Microsoft.Cache/redisEnterprise/databases",
    "apiVersion": "2025-04-01",
    "name": "[format('{0}/{1}', format('{0}-cache', parameters('prefix')), 'default')]",
    "properties": {
      "clientProtocol": "Encrypted",
      "clusteringPolicy": "NoCluster",
      "evictionPolicy": "NoEviction"
    },
    "dependsOn": [
      "[resourceId('Microsoft.Cache/redisEnterprise', format('{0}-cache', parameters('prefix')))]"
    ]
  }
]

Step 3: compile, deploy and check

python3 scripts/deps/bicep.py build .local/book-iac/redis.bicep \
  --outfile .local/book-iac/redis.json

This file has defaults for every parameter. Run the deployment command from the workshop with --name redis, --template .local/book-iac/redis.json and a distinct outputs filename. Add --parameters when supplying inputs. Select the same deployment in QHQ and wait for Succeeded.

Use the Redis chapter to retrieve the key privately and connect on TLS port 10000. Write and read a value, then decide whether the application can reconstruct it. The fixed container limits do not simulate the performance promised by an Azure SKU.