Hello everyone welcome to Apigee Four Minute Videos for Developers. In this video, we are going to learn about API environment in Apigee Edge. I am Anil Sagar. I work at Google on the Apigee platform. Prerequisites for this video — You need an Apigee Edge account. You can register at apigee.com/edge. You also need to know the basics of Apigee Edge proxies. For that you can refer to earlier Four Minute Videos. Let’s talk about the development environment. I’m sure everybody writes code when it comes to development. And first they write their code in a development environment. Once they test, they move it to the UAT where integration tests will happen. Once everything works fine, people move their code to the production environment. Similar to code development, Apigee also has environments where you can deploy API proxies to different environments while doing API development. Apigee Edge free account out of the box comes with two environments — test and prod. But, if you buy the Apigee Edge enterprise license, then you will get multiple environments. When you write an API proxy you can deploy the API proxy to one of the environments. Like let’s say the test environment. Once you make sure everything is working fine then, then you can can move the code to the production environment. Let’s see how this works in Apigee Edge. Log in to your Apigee Edge account and choose an org. Once you are in your Apigee Edge account, create an API proxy to see how an environment works. Let’s create a new proxy. Choose the Reverse Proxy type and I’m gonna say the proxy name as envdemo and I’m gonna use the mocktarget.apigee.net endpoint to create the proxy. Click on Next. Choose the authorization as Pass Through. Choose the default virtual hosts. As you can see in this screen — the build screen — the Apigee Edge API wizard asks you which environment to deploy to. Let’s choose the test environment for now and click on Build and Deploy. When you deploy the API proxy to the test environment, your API proxy will run in the test environment and the API URL will be Something like your_org_name-your_environment.apigee.net. As you can see since you’d deployed to the test environment you can see only the URL that is related to the test environment. Let’s make a call to the test environment. As you can see, you can see the response “Hello, Guest”. Let’s switch to production environment and see what happens. When you change to production, we get an error because our API proxy is not deployed to the production environment. Let’s deploy the API proxy to the production environment. You can use the UI to deploy the API proxy to the production environment. Click on Deployment. Click on prod. Click Deploy. Once the API proxy is deployed to the production environment, you will get the API call related to the production environment. As you can See the new url will be apigee4mv40-prod.apigee.net. Let’s make a call now. When we do an API call to the production environment we see the response. So we can do the development in one of our environments and test everything, and later deploy the same API proxy to the production environment that will be exposed to the end-users. Let’s do a small change to understand how the environment concept works and how we can test out the changes in one environment before moving the changes to the production environment. Click on the Develop tab. I’m going to make this proxy secure by attaching a Verify API Key policy. Click on the plus sign next to the request. Select the PreFlow. Click on “+Step” and choose the Verify API Key policy. Let’s say this proxy is a new revision. Once you save it as a new revision, let’s deploy the proxy only to the test environment. Now when we make a call to the test environment, we won’t see the 200 response, we will see 403 Unauthorized with a message “Failed to resolve the API key”. But if you made the same call to the production environment we see the 200 response because the latest changes are not applied to the production environment. Let’s go back to the Overview screen and apply the changes to the production environment. Now when we make call to the production environment, we should see an error because it expects an API key. There you go. That’s how the API environment concept works in Apigee Edge. If you have any questions please feel free to post your questions in community.apigee.com. Thank you.