'How to set Connection Policy for Azure SQL Server
I'm looking for a way to set Connection Policy to Redirect for my Azure SQL server.
This is my current definition of SQL Server in Pulumi, but I can't find connection policy anywhere.
var sqlServer = new Pulumi.AzureNative.Sql.Server(sqlServerName, new ServerArgs
{
ServerName = sqlServerName,
ResourceGroupName = resourceGroup.Name,
Location = resourceGroup.Location,
Version = "12.0",
MinimalTlsVersion = "1.2",
AdministratorLogin = dbLogin,
AdministratorLoginPassword = dbPassword,
PublicNetworkAccess = ServerPublicNetworkAccess.Disabled,
});
When I export server resource I see it's defined as a separated resource type called Microsoft.Sql/servers/connectionPolicies but can't find it within Pulumi types
{
"type": "Microsoft.Sql/servers/connectionPolicies",
"apiVersion": "2021-08-01-preview",
"name": "[concat(parameters('..'), '/default')]",
"location": "uksouth",
"dependsOn": [
"[resourceId('Microsoft.Sql/servers', parameters('..'))]"
],
"properties": {
"connectionType": "Redirect"
}
},
Solution 1:[1]
I'm looking for a way to set Connection Policy to Redirect for my Azure SQL server.
As currently, its missing in Pulumi as suggested by @Mikhail Shilkov you can open an Issue in GitHub.
But you can try to update the connection policy in azure sql server till its not added in pulumi
To do that we can configure it in multiple ways for example using Azure Cli and python etc.
For example using CLI we have tried as below:-
az sql server conn-policy show --resource-group RGNAME --server SERVERNAME
az sql server conn-policy update --connection-type Redirect--resource-group RGNAME --server SERVERNAME
To achieve it in other way please refer this : Pulumi Docs| SQL SERVER
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|---|
| Solution 1 | AjayKumarGhose-MT |




