You need to enable JavaScript to run this app.
最新活动
大模型
产品
解决方案
定价
生态与合作
支持与服务
开发者
了解我们

关联Azure VNET的Power Platform环境中使用SQL连接器连接本地SQL Server失败求助

关联Azure VNET的Power Platform环境中使用SQL连接器连接本地SQL Server失败求助

问题描述

我目前在关联了Azure VNET的Power Platform环境里,尝试用Power Automate的SQL Server连接器连接本地的SQL Server实例:

  • 已经配置好VNET连通性,能正常安全访问Azure内的资源(存储账户、Key Vault、Azure SQL等)
  • 使用了本地数据网关,测试连接时能正常看到服务器、数据库和表的列表
  • 但保存流的时候直接报错,错误信息如下:
{
  "error": {
    "code": 500,
    "source": "e4ab17db-*********.14.common.australia.azure-apihub.net",
    "clientRequestId": "00000000-0000-0000-0000-000000000000",
    "message": "BadGateway",
    "innerError": {
      "status": 500,
      "message": "System.ArgumentException: Format of the initialization string does not conform to specification starting at index 0.\n at Microsoft.Azure.Connectors.Sql.NativeExecutor.SqlNativeExecutor.ExecuteAndReadResultSetsInnerAsync(ISqlConnectionCredentials credentials, IReadOnlyDictionary`2 formalParameters, IReadOnlyDictionary`2 actualParameters, String query, Int32 maxResultSets, CancellationToken cancellationToken)\n at Microsoft.Azure.Connectors.Sql.PlexExtension.Operations.NativeExecutorOperations.ExecuteAndReadResultSetsAsync(RequestWrapper`1 wrapper, CancellationToken cancellationToken) in C:\\__w\\1\\s\\src\\Connectors\\FirstParty\\sql\\PlexExtension\\Operations\\NativeExecutorOperations.cs:line 84\n at Microsoft.Azure.Connectors.Common.SubnetDelegation.PlexExtension.PlexExtension.ExecuteAsync(ExtensionRequest extensionRequest, IExtensionServiceProvider serviceProvider, CancellationToken cancellationToken)",
      "error": {
        "message": "System.ArgumentException: Format of the initialization string does not conform to specification starting at index 0.\n at Microsoft.Azure.Connectors.Sql.NativeExecutor.SqlNativeExecutor.ExecuteAndReadResultSetsInnerAsync(ISqlConnectionCredentials credentials, IReadOnlyDictionary`2 formalParameters, IReadOnlyDictionary`2 actualParameters, String query, Int32 maxResultSets, CancellationToken cancellationToken)\n at Microsoft.Azure.Connectors.Sql.PlexExtension.Operations.NativeExecutorOperations.ExecuteAndReadResultSetsAsync(RequestWrapper`1 wrapper, CancellationToken cancellationToken) in C:\\__w\\1\\s\\src\\Connectors\\FirstParty\\sql\\PlexExtension\\Operations\\NativeExecutorOperations.cs:line 84\n at Microsoft.Azure.Connectors.Common.SubnetDelegation.PlexExtension.PlexExtension.ExecuteAsync(ExtensionRequest extensionRequest, IExtensionServiceProvider serviceProvider, CancellationToken cancellationToken)"
      },
      "source": "sql-ae.azconn-ae-001.p.azurewebsites.net"
    }
  }
}

另外我了解到官方说明里提到SQL连接器在这种场景下不支持本地数据网关,现在卡在这里了,求帮忙!


我的解答

兄弟,我之前帮同事排查过几乎一模一样的问题,你遇到的核心矛盾是绑定了Azure VNET的Power Platform环境,对SQL连接器的使用有特殊限制,咱们一步步拆解解决:

1. 先搞懂为什么会报错

你测试时能看到服务器/库/表,是因为网关的临时校验只做了基础连通,但保存流后,VNET绑定环境下的SQL连接器会强制走VNET内的访问逻辑,这时候你选了本地网关,系统会把网关的参数错误地塞进给Azure SQL用的连接字符串里,直接导致“初始化字符串格式错误”——说白了就是场景不兼容,不是你填的信息有问题。

而且官方确实明确了:VNET绑定的Power Platform环境中,SQL连接器不支持通过本地数据网关访问本地SQL Server,这是硬限制。

2. 两个可行的解决方向

方向一:把本地SQL Server接入Azure VNET(推荐)

如果你的架构允许,把本地SQL Server通过Azure VPN网关或者ExpressRoute接入到你的Azure VNET里,让Power Platform的VNET能直接路由到本地SQL Server的1433端口(默认)。

  • 这时候不需要本地数据网关,直接用SQL连接器的“SQL Server身份验证”或者Windows身份验证(要确保VNET能打通本地AD),连接字符串会自动适配VNET内的访问逻辑,不会再报错。
  • 先在VNET里找个Azure VM,测试能不能telnet通本地SQL的1433端口,能通就说明网络链路没问题,直接配置连接器就行。
方向二:取消Power Platform环境的VNET关联

如果暂时没办法把本地SQL接入VNET,那可以考虑把这个Power Platform环境的VNET关联取消,回到普通环境。

  • 普通环境下的SQL连接器是完全支持本地数据网关的,你之前的配置(网关+Windows身份验证)就能正常工作。
  • 注意:取消VNET关联后,Power Platform访问Azure资源就需要走公网或者其他方式,你要权衡安全性需求。

3. 临时排查小技巧

如果你不确定VNET到本地的网络能不能通,先在VNET里部署一个Windows VM,安装SSMS,尝试连接本地SQL Server:

  • 如果能连上,说明网络没问题,直接用方向一的方案;
  • 如果连不上,先把VNET到本地的VPN/ExpressRoute配置调通,再搞连接器的事。

按这个思路走,应该能解决你的问题,有其他细节咱们再聊!

火山引擎 最新活动