Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Azure SQL server set Allow access to Azure services in an ARM template or PowerShell

I need to set this setting using an ARM template or in Powershell.

enter image description here

Can anyone point me in the right direction?

like image 473
RuSs Avatar asked Dec 24 '22 14:12

RuSs


1 Answers

For Power Shell, you could use New-AzureSqlDatabaseServerFirewallRule to set this.

New-AzureSqlDatabaseServerFirewallRule -ServerName "lpqd0zbr8y" -AllowAllAzureServices

For template, you could template like below:

   {

            "type": "Microsoft.Sql/servers/firewallRules",
            "kind": "v12.0",
            "name": "[concat(parameters('servers_shui_name'), '/', parameters('firewallRules_AllowAllAzureServices_name'))]",
            "apiVersion": "2014-04-01-preview",
            "location": "South Central US",
            "scale": null,
            "properties": {
                "startIpAddress": "0.0.0.0",
                "endIpAddress": "0.0.0.0"
            },
            "dependsOn": [
                "[resourceId('Microsoft.Sql/servers', parameters('servers_shui_name'))]"
            ]
        }
like image 101
Shui shengbao Avatar answered Dec 27 '22 05:12

Shui shengbao