[[["わかりやすい","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 UTC。"],[[["\u003cp\u003eCloud Run functions can use packages from npm or Python repositories as dependencies.\u003c/p\u003e\n"],["\u003cp\u003eThe Cloud Build service account is used to build and deploy Cloud Run functions, requiring specific permissions.\u003c/p\u003e\n"],["\u003cp\u003eIf Cloud Run functions and Artifact Registry are in the same project, the service account automatically has the necessary download permissions.\u003c/p\u003e\n"],["\u003cp\u003eIf in separate projects, you must grant the Cloud Build service account either the Artifact Registry Reader role for downloading dependencies or the Artifact Registry Writer role for uploading and downloading.\u003c/p\u003e\n"],["\u003cp\u003eDetailed configuration instructions for npm and Python dependencies can be found in the Cloud Run functions documentation.\u003c/p\u003e\n"]]],[],null,["# Using private dependencies with Cloud Run functions\n\nYou can use a package in an npm or Python repository as a dependency for\na Cloud Run function.\n\nRequired permissions\n--------------------\n\nCloud Run functions uses the [Cloud Build service account](/build/docs/cloud-build-service-account) in the\nsame Google Cloud project to build and deploy your function.\n\n- If Cloud Run functions and Artifact Registry are in the same Google Cloud project, the service account has the necessary permissions to download from repositories.\n- If Cloud Run functions and Artifact Registry are in different projects, you must grant repository access to the Cloud Build service account.\n - To provide read-only access for downloading dependencies, [grant](/artifact-registry/docs/access-control#grant) the Artifact Registry Reader role.\n - If you also use Cloud Build to upload artifacts to repositories, [grant](/artifact-registry/docs/access-control#grant) the Artifact Registry Writer role.\n\nConfiguring access to dependencies\n----------------------------------\n\nSee the Cloud Run functions documentation for [npm](/functions/docs/writing/specifying-dependencies-nodejs#using_private_modules) and [Python](/functions/docs/writing/specifying-dependencies-python#using_private_dependencies)\nconfiguration instructions."]]