[[["わかりやすい","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\u003eYou can deploy app versions using the Admin API by defining configuration details in a JSON file named \u003ccode\u003eapp.json\u003c/code\u003e, which can be created manually or by converting an existing \u003ccode\u003eapp.yaml\u003c/code\u003e file.\u003c/p\u003e\n"],["\u003cp\u003eBefore creating the \u003ccode\u003eapp.json\u003c/code\u003e file, all app files and resources must be uploaded to a Cloud Storage bucket.\u003c/p\u003e\n"],["\u003cp\u003eThe \u003ccode\u003eapp.json\u003c/code\u003e file contains configuration information for the version you want to deploy and a \u003ccode\u003edeployment\u003c/code\u003e section specifying the app's files and resources from the Cloud Storage bucket.\u003c/p\u003e\n"],["\u003cp\u003eThe \u003ccode\u003econvert_yaml.py\u003c/code\u003e tool can be used to convert an existing \u003ccode\u003eapp.yaml\u003c/code\u003e file into the \u003ccode\u003eapp.json\u003c/code\u003e format, but this tool is incompatible with python3 and does not support newer runtimes.\u003c/p\u003e\n"],["\u003cp\u003eIf manually creating \u003ccode\u003eapp.json\u003c/code\u003e, you can use the provided template and example, including defining the version ID and specifying file locations within your Cloud Storage bucket in the \u003ccode\u003edeployment\u003c/code\u003e section.\u003c/p\u003e\n"]]],[],null,["# Creating JSON Configuration Files for Your Deployments\n\nTo deploy a version of your app with the Admin API, you define the\nconfiguration details of your version using a JSON formatted file. You can\neither manually create the configuration file or convert an existing `app.yaml`\nfile.\n\nThere are two parts to creating a JSON formatted configuration file:\n\n1. Define the configuration information for the version that you want to deploy.\n2. Define a `deployment` section to specify all your app's files and resources that you want to deploy.\n\n| **Tip:** Consider programmatically generating the `app.json` configuration file.\n\nBefore you begin\n----------------\n\nYou must first [upload all the files and resources of your app to a\nCloud Storage bucket](/appengine/docs/admin-api/uploading-resources)\nbefore you can create the `app.json` configuration file.\n\nManually creating the JSON configuration file\n---------------------------------------------\n\nUse the following steps if you need to manually create the configuration file,\nfor example, when your app excludes an `app.yaml` or your existing Java app\nuses an `appengine-web.xml` file.\n\nTo manually create the `app.json` configuration file for deploying your app with\nthe Admin API:\n\n1. Create a file name `app.json`.\n2. Use the configuration information that is provided in the [apps.services.versions collection](/appengine/docs/admin-api/reference/rest/v1/apps.services.versions) to define and configure the version that you want to deploy.\n3. Use the template in the [Defining the `deployment`\n section](#deployment_section) to specify all the files and resources that you want to deploy from your Cloud Storage bucket.\n\nAlso see the [Example](#json_example) section below to assist you with\ncreating your `app.json` configuration file.\n\nConverting an `app.yaml` file into the JSON format\n--------------------------------------------------\n\n| **Note:** The `convert_yaml.py` tool requires Python 2.7 and is incompatible with Python 3. Additionally, this tool doesn't support newer runtimes in the App Engine flexible environment that require the `runtime_config` element to be specified in the `app.yaml` file.\n|\n| \u003cbr /\u003e\n|\nYou can use the `convert_yaml.py` tool to convert and generate an `app.json`\nversion from an existing [`app.yaml`](/appengine/docs/standard/reference/app-yaml)\nfile.\n\nIf an `app.yaml` file exists, which you normally use to [manually deploy\nversions of your app](/appengine/docs/standard/testing-and-deploying-your-app), you can\nretain that information by converting those configuration settings into the JSON\nformat.\n\n### Prerequisite\n\nDownload and install the\n[`convert_yaml.py` tool](https://github.com/GoogleCloudPlatform/appengine-config-transformer/blob/master/README.md), including the specified requirements.\n\n### Converting YAML files with the `convert_yaml.py` tool\n\nTo convert your `app.yaml` file with the `convert_yaml.py` tool:\n\n1. Locate and note the directory path to your `app.yaml`.\n\n Example: \n\n cd root/apps-container/my-application/\n\n Where the `app.yaml` of the `example-python-app.py` application might look like: \n\n service: default\n version: v1\n runtime: python27\n threadsafe: true\n\n handlers:\n - url: /.*\n script: example-python-app.py\n\n2. Navigate to the local directory where you downloaded the\n `convert_yaml.py` tool, for example:\n\n cd root/tools/appengine-config-transformer\n\n3. Create the `app.json` file from the `app.yaml` file by running the\n `convert_yaml.py` tool:\n\n python ./convert_yaml.py [DIRECTORY_PATH]/app.yaml \u003e [DIRECTORY_PATH]/app.json\n\n Where `[DIRECTORY_PATH]` is the directory path to your `app.yaml` file.\n\n A JSON version (`app.json`) of your `app.yaml` file is created in the\n `[DIRECTORY_PATH]` directory.\n4. Ensure that the ID of your version is defined in the `app.json`\n configuration file.\n\n If your `app.yaml` file excludes the `version: [VERSION_NAME]` element,\n then the `\"id\": [VERSION_NAME]` element is not included in your\n `app.json` file after the conversion. For example, if you want to set your\n version ID to `v1`, you must manually add the following line to your\n `app.json` file: \n\n \"id\": \"v1\",\n\n5. Use the template in the [Defining the `deployment`\n section](#deployment_section) to specify all the files and resources of\n your app that you want to deploy.\n\nAlso see the [Example](#json_example) section below to assist you with\ncreating your `app.json` configuration file.\n\nDefining the `deployment` section\n---------------------------------\n\nTo create a `deployment` section in the `app.json` configuration file and\nmanually define all of the resources that are located in your Cloud Storage\nbucket, you use the reference information in the [`deployment`\nsection](/appengine/docs/admin-api/reference/rest/v1/apps.services.versions#deployment)\nof the `apps.services.versions` collection. If you are defining individual\nfiles, you can use the following template: \n\n \"deployment\": {\n \"files\": {\n \"my-resource-file1\": {\n \"sourceUrl\": \"https://storage.googleapis.com/[MY_BUCKET_ID]/my-application/my-resource-file1\"\n },\n }\n },\n\nWhere `my-resource-file1` defines the file name and relative directory\npath of where you want to deploy that file in App Engine.\n\nExample `app.json` file\n-----------------------\n\nUse the following example `app.json` to help you create your configuration file.\n\nIn the following `app.json` example, the `v1` version ID is defined along with a\n[`deployment`](/appengine/docs/admin-api/reference/rest/v1/apps.services.versions#deployment)\nsection that includes two example source files from the `[MY_BUCKET_ID]`\nCloud Storage bucket. \n\n {\n \"deployment\": {\n \"files\": {\n \"example-resource-file1\": {\n \"sourceUrl\": \"https://storage.googleapis.com/[MY_BUCKET_ID]/example-application/example-resource-file1\"\n },\n \"images/example-resource-file2\": {\n \"sourceUrl\": \"https://storage.googleapis.com/[MY_BUCKET_ID]/example-application/images/example-resource-file2\"\n },\n }\n },\n \"id\": \"v1\",\n \"handlers\": [\n {\n \"urlRegex\": \"/.*\",\n \"script\": {\n \"scriptPath\": \"example-python-app.py\"\n }\n },\n ],\n \"runtime\": \"python27\",\n \"threadsafe\": true,\n }\n\n| **Tip:** Not all of the runtimes that are supported by App Engine include support for a [`ScriptHandler`](/appengine/docs/admin-api/reference/rest/v1/apps.services.versions#scripthandler). For more information, see the corresponding `app.yaml` or `appengine-web.xml` reference of your [language's runtime](/appengine/docs).\n\nWhat's next\n-----------\n\n- [Deploying Versions to Your App](/appengine/docs/admin-api/deploying-apps)"]]