Skip to content

Use valid server names#

Operational Excellence · Azure Database for MariaDB · Rule · 2022_12 · Awareness

Azure Database for MariaDB servers should meet naming requirements.

Description#

When naming Azure resources, resource names must meet service requirements. The requirements for Azure Database for MariaDB server names are:

  • Between 3 and 63 characters long.
  • Lowercase letters, numbers, and hyphens.
  • Can't start or end with a hyphen.
  • MariaDB server names must be globally unique.

Recommendation#

Consider using names that meet Azure Database for MariaDB server naming requirements. Additionally consider naming resources with a standard naming convention.

Examples#

Configure with Azure template#

To deploy servers that pass this rule:

  • Set the name property to align to resource naming requirements.

For example:

Azure Template snippet
{
  "type": "Microsoft.DBforMariaDB/servers",
  "apiVersion": "2018-06-01",
  "name": "[parameters('name')]",
  "location": "[parameters('location')]",
  "sku": {
    "name": "[parameters('sku')]",
    "tier": "GeneralPurpose",
    "capacity": "[parameters('skuCapacity')]",
    "size": "[format('{0}', parameters('skuSizeMB'))]",
    "family": "Gen5"
  },
  "properties": {
    "sslEnforcement": "Enabled",
    "minimalTlsVersion": "TLS1_2",
    "createMode": "Default",
    "version": "10.3",
    "administratorLogin": "[parameters('administratorLogin')]",
    "administratorLoginPassword": "[parameters('administratorLoginPassword')]",
    "publicNetworkAccess": "Disabled",
    "storageProfile": {
      "storageMB": "[parameters('skuSizeMB')]",
      "backupRetentionDays": 7,
      "geoRedundantBackup": "Enabled"
    }
  }
}

Configure with Bicep#

To deploy servers that pass this rule:

  • Set the name property to align to resource naming requirements.

For example:

Azure Bicep snippet
resource server 'Microsoft.DBforMariaDB/servers@2018-06-01' = {
  name: name
  location: location
  sku: {
    name: sku
    tier: 'GeneralPurpose'
    capacity: skuCapacity
    size: '${skuSizeMB}'
    family: 'Gen5'
  }
  properties: {
    sslEnforcement: 'Enabled'
    minimalTlsVersion: 'TLS1_2'
    createMode: 'Default'
    version: '10.3'
    administratorLogin: administratorLogin
    administratorLoginPassword: administratorLoginPassword
    publicNetworkAccess: 'Disabled'
    storageProfile: {
      storageMB: skuSizeMB
      backupRetentionDays: 7
      geoRedundantBackup: 'Enabled'
    }
  }
}

Notes#

This rule does not check if Azure Database for MariaDB server names are unique.

Comments