Azure Database for MySQL
Azure Database for MySQL Flexible Server is the persistence and visibility store for the self-hosted Temporal cluster (ADR-0019). This page covers the data-protection configuration of the server, the bounded password exception that Temporal needs, and the Temporal connection settings.
Data the resource handles
- Temporal workflow history, mutable state, task queues, and timers. History includes workflow and activity inputs and outputs, which can contain customer data.
- Temporal visibility records: search attributes and memos used to list and filter workflows.
The Temporal store is a customer-data store. Workflow and activity payloads
SHOULD carry identifiers and references rather than bulk customer data.
Search attributes and memos MUST NOT contain secrets or tokens, and
SHOULD NOT contain personal data beyond identifiers such as
customerShort.
Encryption at rest
- Storage, backups, and logs are encrypted at rest by the service.
- Microsoft-managed keys are the default. Customer-managed keys MUST NOT be used without a documented compliance driver, key lifecycle, outage impact, and recovery design. Customer-managed keys can only be chosen when the server is created.
Encryption in transit
-
require_secure_transportMUST beON. -
tls_versionMUST allow onlyTLSv1.2or higher.TLSv1.3SHOULD be included where the server version supports it. -
Temporal MUST connect with TLS and host verification for both the persistence and the visibility datastores:
Temporal setting Value SQL_TLS_ENABLEDtrueSQL_HOST_VERIFICATIONtrueSQL_HOST_NAMEThe server FQDN that matches the certificate SQL_CAPath to the CA bundle Microsoft publishes for Azure Database for MySQL The CA bundle MUST include the current and announced replacement root certificates so a certificate rotation does not break connections.
Identity and access
Temporal’s SQL plugin does not support Entra access tokens. Temporal therefore uses a MySQL password. This is the only password exception for ION data stores, and it is bounded by these rules:
- Temporal MUST use a dedicated non-admin runtime user with DML
privileges (
SELECT,INSERT,UPDATE,DELETE) on the Temporal persistence and visibility databases only. - Schema setup and upgrades with Temporal’s SQL tool (for example from the admin-tools container) MAY use a separate migration user with DDL on the same databases. It MUST NOT be used by the Temporal server at runtime.
- The server administrator login is break-glass only. Its password MUST be held in Key Vault and MUST NOT be passed to Temporal, admin tools, or any other workload.
- An Entra administrator group MUST be configured. Human operators MUST use Entra authentication, not the runtime, migration, or administrator passwords.
aad_auth_onlystaysOFFonly because of this exception. If Temporal gains Entra token support, the exception ends and the server MUST move to Entra-only authentication.
Other workloads MUST NOT use this server. A new MySQL store for another purpose MUST use Entra-only authentication.
Secrets
- The runtime and migration passwords MUST be generated, stored in Key Vault, and never written to source, pipeline logs, or plain Terraform variables.
- Container Apps MUST inject them as Key Vault references
(
secrets[].keyVaultUrlwithidentity), not as plain secret values. Plain values are stored in the Container App resource and in Terraform state. See Azure Container Apps. - Rotation MUST support overlap so Temporal keeps working while the new
password rolls out. MySQL dual passwords (
ALTER USER ... RETAIN CURRENT PASSWORD) or two alternating runtime users SHOULD be used. The old password is discarded only after every Temporal replica uses the new one.
Backup and recovery
- Backup retention MUST be at least 7 days and SHOULD be 35 days in
prd. - Geo-redundant backup SHOULD be enabled in
prd, so a backup copy is held in Switzerland West. This is a backup copy, not a DR capability. It can only be enabled when the server is created. - Multi-region Temporal is part of the planned warm spare (ADR-0017, ADR-0019) and MUST NOT be described as available until it is deployed and tested.
- High availability MUST be zone redundant in
gmaandprd.apaandbtaMAY run without HA, including on Burstable compute. prdservers MUST have aCanNotDeleteresource lock or Terraformprevent_destroy.- Restores MUST be tested together with Temporal, with drills in
gma. A restored persistence store and visibility store MUST come from a consistent point in time.
Logging and redaction
- Diagnostic settings MUST send
MySqlAuditLogsto the Switzerland North Log Analytics workspace. - Audit logging MUST be enabled for connections and DDL:
audit_log_enabledset toONandaudit_log_eventsset toCONNECTION,DDL. DML andGENERALevents MUST NOT be audited by default. - The slow query log SHOULD be
OFFbecause it records statement literals. Query analysis SHOULD use normalized statement digests. - Full statement or slow-query capture MAY be enabled for a bounded period when analysis needs it, for example for high-volume Temporal queries. Record it as an exception and turn it off when the analysis is done.
- Temporal server logs MUST NOT include the SQL password or connection strings with credentials.
Network exposure
- VNet integration (a delegated subnet with private DNS) SHOULD be used. Temporal is internal, so the server has no public client. It can only be chosen when the server is created.
- If public access is used, the ZPA configuration in
ADR-0025 applies:
- Firewall rules allow only ZPA connector IPs and platform IPs.
0.0.0.0/0MUST NOT be allowed.- The Azure-services rule SHOULD NOT be created without a recorded exception.
- Private endpoints are the Phase 2 target (ADR-0016).
Configuration reference
Properties are on Microsoft.DBforMySQL/flexibleServers and its
configurations child resources. Map them to
azurerm_mysql_flexible_server* resources or azapi equivalents.
| Setting | Required value | Basis |
|---|---|---|
require_secure_transport | ON | TLS on every hop |
tls_version | TLSv1.2 or higher | TLS on every hop |
aad_auth_only | OFF only for the Temporal exception | This page |
administrators | Entra group configured | ADR-0013 |
backup.backupRetentionDays | At least 7; 35 in prd (SHOULD) (backup_retention_days in azurerm) | Residency and recovery |
backup.geoRedundantBackup | Enabled in prd (SHOULD; creation only) (geo_redundant_backup_enabled in azurerm) | Residency and recovery |
highAvailability.mode | ZoneRedundant in gma and prd | ADR-0017 |
network.delegatedSubnetResourceId | Delegated subnet (SHOULD; creation only) | ADR-0025 |
audit_log_enabled / audit_log_events | ON / CONNECTION,DDL | ADR-0021 |
slow_query_log | OFF by default (SHOULD) | ADR-0021 |
Temporal SQL_TLS_ENABLED / SQL_HOST_VERIFICATION | true / true | TLS on every hop |
| Resource lock | CanNotDelete in prd | Residency and recovery |