如何设置 Azure SQL Server 的连接策略
我正在寻找一种将 Azure SQL 服务器的连接策略设置为重定向的方法。
这是我当前在 Pulumi 中对 SQL Server 的定义,但我在任何地方都找不到连接策略。
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,
});
当我导出服务器资源时,我看到它被定义为名为 Microsoft.Sql/servers/connectionPolicies
的独立资源类型,但在 Pulumi 类型中找不到它
{
"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"
}
},
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"
}
},
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
目前,按照 @Mikhail Shilkov 的建议,它在 Pulumi 中缺失,您可以打开一个GitHub 中的问题。
但是您可以尝试更新 azure sql server 中的连接策略,直到其未添加到 pulumi 中。
为此,我们可以通过多种方式配置它,例如使用 Azure Cli 和 python 等。
例如,我们尝试使用 CLI,如下所示:-
< a href="https://i.sstatic.net/5vup3.png" rel="nofollow noreferrer">
要以其他方式实现它,请参考此:Pulumi 文档| 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:-
To achieve it in other way please refer this : Pulumi Docs| SQL SERVER