Adding a database deployed in a private DNS zone

You can configure an existing Azure private DNS zone for your MySQL Flexi Server-based database to use in your CDE service. Alternatively, if you do not have an existing private DNS zone configured, the system can create a new private DNS zone for the database.

If all the following statements are true, the system uses the private DNS zone that you specify in the azure.database.privateDNSZoneId parameter and provisions a private database:

  • The privateNetwork.enabled parameter is set to true or false
  • The azure.database.privateDNSZoneId parameter is set

If all the following statements are true, the system creates and enables a new private DNS zone and provisions a private database in it:

  • The privateNetwork.enabled parameter is set to true or false
  • The azure.database.privateDNSZoneId parameter is not set

For the database, you can configure a private DNS zone regardless of whether the privateNetwork.enabled parameter is set to true or false. This is because the MySQL Flexi server implementation requires a private DNS zone.

For information on how to add a database deployed in a private DNS zone using the API, see Adding a database and a Storage Account File Share deployed in private DNS zones using the API.

To provision the database in a private DNS zone, you need the full resource ID of the private DNS zone. To obtain the full resource ID, use the JSON view option in Azure > Private DNS Zones. Example for the full resource ID of a private DNS zone for a database:

/subscriptions/[***SUBSCRIPTIONID***]/resourceGroups/[***RESOURCEGROUP***]/providers/Microsoft.Network/privateDnsZones/privatelink.mysql.database.azure.cm
To provision the database in a private DNS zone, specify the full resource ID of the private DNS zone.
To define the Azure private DNS zone ID of the database, use the enable-cluster CDP command with the --azure-database-private-dns-zone-id flag.
cdp de enable-service 
 --name "[***SERVICE NAME***]"
 --env "[***ENVIRONMENT NAME***]"
 --instance-type Standard_D8s_v4
 --minimum-instances 0
 --maximum-instances 50
 --enable-private-network
 --azure-database-private-dns-zone-id "[***AZURE DATABASE PRIVATE DNS ZONE RESOURCE ID***]"
 --azure-fileshare-private-dns-zone-id "[***AZURE DATABASE FILE SHARE DNS ZONE RESOURCE ID***]"