Enabling Allow access to Azure service by Terraform

When you provision SQL server on Azure, you might want to enable "Allow access to Azure service".  However, there is no attribute on Terraform AzureRm provider. Even we can't find on the REST API spec on Azure.

However, I notice that we have a PowerShell Commandlet for this.  I read a code of it.

        /// <summary>
        /// The special IP for the beginning and ending of the firewall rule that will
        /// allow all azure services to connect to the server.
        /// </summary>
        private const string AllowAzureServicesRuleAddress = "";


It is quite easy, we should just add the firewall rule with "". 🙂 I tried.

resource "azurerm_sql_firewall_rule" "test" {

 name = "Allow All Azure Service"

 resource_group_name = "${azurerm_resource_group.test.name}" 

 server_name = "${azurerm_sql_server.test.name}"

 start_ip_address = ""

 end_ip_address = ""


Then terraform plan/apply it.

















Comments (0)

Skip to main content