[英]How do I add an SQL connection in VSCode's "Run/Debug on Cloud Run Emulator" Build Settings
I am writing my first python 3.10 application in Visual Studio Code and aim to deploy that application to Cloud Run soon.我正在 Visual Studio Code 中编写我的第一个 python 3.10 应用程序,目标是尽快将该应用程序部署到 Cloud Run。 I have a Cloud SQL database that stores my data for the application.我有一个 Cloud SQL 数据库,用于存储我的应用程序数据。
Before deploying I want to debug my application with the Cloud Code plugin for VSCode.在部署之前,我想使用适用于 VSCode 的 Cloud Code 插件调试我的应用程序。 The Cloud Code plugin has a convenient "Debug on Cloud Emulator" command that I can use for that purpose, but I am struggling to figure out how to add SQL connections in my Build Settings before running the Cloud Emulator. Cloud Code 插件有一个方便的“在 Cloud Emulator 上调试”命令,我可以将其用于该目的,但我正在努力弄清楚如何在运行 Cloud Emulator 之前在我的构建设置中添加 SQL 连接。
Can somebody help me figure out the syntax for adding a Cloud SQL connection under the Advanced Service Settings?有人可以帮我弄清楚在高级服务设置下添加 Cloud SQL 连接的语法吗?
Any examples / resources would be incredibly useful.任何示例/资源都将非常有用。
Thanks so much for your help up front!非常感谢您的帮助!
In the Cloud SQL - Overview screen, you can find the connection name of your instance in this format:在 Cloud SQL - Overview 屏幕中,您可以找到您的实例的连接名称,格式如下:
PROJECT-ID:REGION:INSTANCE-ID
Additionally, see this article on the connection options for Cloud SQL .此外,请参阅有关 Cloud SQL 连接选项的文章。 You may also need to setup a Cloud SQL Auth proxy to provide secure access to your Cloud SQL instance.您可能还需要设置Cloud SQL Auth 代理以提供对 Cloud SQL 实例的安全访问。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.