RuSs
RuSs

Reputation: 1812

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?

Upvotes: 5

Views: 5005

Answers (1)

Shui shengbao
Shui shengbao

Reputation: 19195

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'))]"
            ]
        }

Upvotes: 12

Related Questions