I could use the below to add a vnet rule in Azure MariaDB connection security page.
az mariadb server vnet-rule create \
--resource-group xxx \
--server-name xxx-mariaDB \
--name db-to-aks \
--subnet $SUBNET_ID \
--ignore-missing-endpoint
but how do I enable the 'allow access to Azure Services' option below with AZ CLI? thanks!
We have tested this in our local environment, it is working fine.
You can use the below cmdlet which will create a new firewall rule on MariaDB Server & it will enable Allow access to Azure services.
az mariadb server firewall-rule create --resource-group '<RgName>' --server '<MariaDBServerName>' --name "AllowAllWindowsAzureIps" --start-ip-address 0.0.0.0 --end-ip-address 0.0.0.0
Here is the Sample output for reference:
For more information, You can refer to this Azure documentation about the creation of firewall rules in the Azure Maria DB Server.