如何设置 Azure SQL Server 的连接策略

发布于 2025-01-13 21:49:29 字数 1131 浏览 0 评论 0原文

我正在寻找一种将 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.

enter image description here

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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

粉红×色少女 2025-01-20 21:49:29

我正在寻找一种将连接策略设置为重定向的方法
Azure SQL 服务器。

目前,按照 @Mikhail Shilkov 的建议,它在 Pulumi 中缺失,您可以打开一个GitHub 中的问题。

但是您可以尝试更新 azure sql server 中的连接策略,直到其未添加到 pulumi 中。

为此,我们可以通过多种方式配置它,例如使用 Azure Cli 和 python 等。

例如,我们尝试使用 CLI,如下所示:-

az sql server conn-policy show --resource-group RGNAME --server SERVERNAME

< a href="https://i.sstatic.net/5vup3.png" rel="nofollow noreferrer">输入图像描述这里

az sql server conn-policy update --connection-type Redirect--resource-group RGNAME --server SERVERNAME

在此处输入图像描述

在此处输入图像描述

要以其他方式实现它,请参考此:Pulumi 文档| SQL Server

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

enter image description here

az sql server conn-policy update --connection-type Redirect--resource-group RGNAME --server SERVERNAME

enter image description here

enter image description here

To achieve it in other way please refer this : Pulumi Docs| SQL SERVER

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文