GCP SQL Server App Engine连接:基于令牌的服务器访问验证失败,发生基础结构错误

问题描述

当我尝试通过App Engine连接我的Google Cloud sql实例时,出现以下sql服务器错误

Login Failed for user '\9b73cfe90ee8d1d$'. Reason: Token-based server access validation Failed with an infrastructure error. Login lacks connect endpoint permission.

我已经以管理员身份将App Engine用户添加sql项目中,但这不能解决问题。

可以通过Cloud Proxy在本地进行连接,但是使用相同的连接字符串。

Dotnet在尝试连接时给我以下异常:

A network-related or instance-specific error occurred while establishing a connection to sql Server. The server was not found or was not accessible. Verify that the instance name is correct and that sql Server is configured to allow remote connections. (provider: TCP Provider,error: 40 - Could not open a connection to sql Server

我的应用Yaml

runtime: aspnetcore
env: flex
service: platform
manual_scaling:
  instances: 1
resources:
  cpu: 2
  memory_gb: 1.5
  disk_size_gb: 10
beta_settings:
  cloud_sql_instances: shared-resources-291914:europe-west2:sqlserver-edutec

连接字符串:

"ConnectionStrings": {
    "default": "Server=127.0.0.1;Database=cliche;User Id=sqlserver;Password=password;"
  },

解决方法

这是Google Cloud方面的已知限制。

SQL Server error logs: "Login failed for user. Reason: Token-based server access validation failed with an infrastructure error

Google Cloud Sql工程团队正在努力解决该问题。

“加星标”线程以确保您收到有关它的更新是非常值得的。