[[["容易理解","easyToUnderstand","thumb-up"],["確實解決了我的問題","solvedMyProblem","thumb-up"],["其他","otherUp","thumb-up"]],[["難以理解","hardToUnderstand","thumb-down"],["資訊或程式碼範例有誤","incorrectInformationOrSampleCode","thumb-down"],["缺少我需要的資訊/範例","missingTheInformationSamplesINeed","thumb-down"],["翻譯問題","translationIssue","thumb-down"],["其他","otherDown","thumb-down"]],["上次更新時間:2025-09-04 (世界標準時間)。"],[[["\u003cp\u003eCloud Code enables local development of Cloud Run services in a simulated environment, with real-time updates reflecting code changes.\u003c/p\u003e\n"],["\u003cp\u003eBefore running a service, users must define a run configuration in the "Edit Configurations" section, specifying options like the builder type and watch mode preference.\u003c/p\u003e\n"],["\u003cp\u003eDuring local development, users can customize configurations by adding settings such as service accounts, environment variables, and SQL connections.\u003c/p\u003e\n"],["\u003cp\u003eCloud Code automatically adds environment variables like PORT, K_SERVICE, K_REVISION, and K_CONFIGURATION to running containers.\u003c/p\u003e\n"],["\u003cp\u003eSecrets, such as API keys and passwords, can be securely stored in Secret Manager and accessed programmatically using Cloud Code.\u003c/p\u003e\n"]]],[],null,["# Develop a service locally in Cloud Code for IntelliJ\n\nWith Cloud Code, you can develop your Cloud Run services\nlocally in a Cloud Run-like environment. Cloud Code watches\nfor changes in your source and quickly updates the running service to\nreflect these changes.\n\nDefining your run configuration\n-------------------------------\n\nBefore you run your service, you must create your run configuration:\n\n1. Navigate to Run/Debug configurations selector in the Navigation bar and click **Edit Configurations**.\n2. Under Cloud Code: Cloud Run, choose **Cloud Run: Run Locally**.\n3. If you want Cloud Code to redeploy your application automatically after your changes are saved, under **Watch mode - rebuild and\n redeploy** , select **On file save** . New Cloud Run services have **On demand** selected by default. For more information about watch modes, see [Watch modes](/code/docs/intellij/watch-modes).\n4. Specify your builder option and its relevant settings.\n\n Cloud Code supports Docker, Jib, and Buildpacks\n [artifact types](https://skaffold.dev/docs/builders/).\n5. Click **OK**.\n\n### Optional: Customizing your configuration\n\nWhen developing locally, you can specify additional settings like a service\naccount, environment variables, and SQL connections (when using\nCloud Run (fully managed)), using the Advanced revision settings section when\nyou choose **Edit Configurations**.\n\n#### Environment variables\n\nThe following environment variables are automatically added to the\nrunning containers:\n\nStoring secrets\n---------------\n\nIf your code includes potentially sensitive data like API keys, passwords, and\ncertificates, it is recommended you store them as secrets. With\nCloud Code, you can securely store these secrets in Secret Manager\nand programmatically fetch them when you need them. For a detailed look at\nhow you can create and manage secrets with Cloud Code, refer to\nthe [Secret Manager guide](/code/docs/intellij/secret-manager).\n\nRunning your service\n--------------------\n\nTo run your service, follow these steps:\n\n1. Choose the **Cloud Run: Run Locally** run target from the Run/Debug configurations selector in the Navigation bar.\n2. Click **Cloud Run: Run Locally**.\n3. View the logs from your running service, streamed directly to the **output window**.\n4. Once deployment is complete, you can view your running service by following the\n URL displayed in your Event Log panel. In the example below, this URL is\n http://localhost:8080.\n\nGet support\n-----------\n\nTo submit feedback or report an issue in your IntelliJ IDE, go to **Tools** \\\u003e **Cloud Code** \\\u003e **Help / About** \\\u003e **Submit\nfeedback or report an issue** to report an issue on [GitHub](https://github.com/GoogleCloudPlatform/cloud-code-intellij/issues)."]]