After you complete local development and testing with Apigee in VS Code, you are ready to deploy your API as an archive to an Apigee environment. In this step, you'll create an Apigee environment that supports archive deployment and deploy an archive of your API proxy configuration to the Apigee environment.
For example:
This command triggers a long-running operation. Ensure that the environment has been attached to the runtime before continuing.
Ensure that the environment group has been created before continuing. You can check the status of your new group using a request like the following:
curl -i -H "$AUTH" -H "Content-Type:application/json" \ "https://apigee.googleapis.com/v1/organizations/$PROJECT_ID/environments/ENVIRONMENT_NAME"
Attaching an environment to the group makes the proxies in that environment routable via the hostnames in the group. This triggers a long-running operation that can take several minutes to complete. We recommend that you wait a minute or two before continuing to the next step. In the meantime you can check the status of the operation as before.
cd myapigeeworkspace
When you run ls
the directory should contain the src
folder.
gcloud beta apigee archives deploy --environment=dev --labels=release=052021
The following provides an example of the response:
Using Apigee organization dev Waiting for operation [b64c2665-b5ac-43cc-9e2d-232e8895c2ed] to complete...done
curl https://INTERNAL_LOAD_BALANCER_IP/helloworld / -H "Host: ENV_GROUP_HOSTNAME"
For more information about the variables in this example and how to set up API access, see Deploy a sample proxy.
The following error message is displayed:
{"fault":{"faultstring":"Failed to resolve API Key variable request.queryparam.apikey", "detail":{"errorcode":"steps.oauth.v2.FailedToResolveAPIKey"}}}
You need to create an API product that includes the helloworld
API, then create and register a developer with the API product in order to obtain an API key.
Field | Setting |
---|---|
Name: | myproduct |
Display name: | myproduct |
Environment: | dev |
Access: | Public |
Quota: | Leave blank |
Allowed OAuth scope: | Leave blank |
/
. Leave other fields set to their defaults.
Field | Setting |
---|---|
First Name: | Alex |
Last Name: | Hamilton |
Username: | ahamilton |
Email: | ahamilton@example.com |
Field | Setting |
---|---|
Name: | myapp |
Display name: | myapp |
Developer: | ahamilton@example.com |
Callback URL: | Leave blank |
Notes: | Leave blank |
Expiry: | Never |
Product: |
|
Custom attributes: | Leave blank |
apikey
query parameter, as follows: curl -v https://$PUBLIC_FACING_IP/helloworld?apikey=ZQA5euYtNeJ7ZCGCJMpvd6F2BZOmxOzY
The following response is returned:
{ "root": { "city": "San Jose", "firstName": "John", "lastName": "Doe", "state": "CA" } }
Congratulations! You've successfully deployed your API archive to an Apigee environment!
In the next step, you'll promote your API archive to an Apigee production environment.
1234567(NEXT) Step 8: Promote an archive to production
Except as otherwise noted, the content of this page is licensed under the Creative Commons Attribution 4.0 License, and code samples are licensed under the Apache 2.0 License. For details, see the Google Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates.
Last updated 2025-04-24 UTC.