Hi Team,
We have created Azure CICD pipeline and we are able to deploy the code in different Apigee Hybrid environments with using apigee maven plugin. while deploying we found that we need to updated target end points based on environment,
By default when we develop the proxy in dev environment and export the proxy bundle from apigee portal dev env, we will get target xml file with dev environment endpoints but when we push same bundle from CICD pipeline to different env(Dev,test,Prod) we need to update the target point manually after deployment.
Example:
Dev Env target connection
<HTTPTargetConnection>
<URL>https://dev-httpbin.org/get</URL>
</HTTPTargetConnection>
https://dev-httpbin.org/get--this backed url will be get change for every env like(https://tes-httpbin.org/get, https://qa-httpbin.org/get).
is there any way configure some place and will call backed target urls dynamically
Solved! Go to Solution.
Nothing. The "thing to update" is defined by the xpath as defined in the config.json . You can have anything you like between the URL tags. You need to specify the values you want, in the config.json. Replace qa-mocktarget.apigee.net (and so on) with your chosen values.
is there any way configure some place and will call backed target urls dynamically
Yes, there are options.
Hi @dchiesa1
Thanks for quick response. I would like to go with option 1.
example this is my config.json file.
{
"configurations": [
{
"name": "test",
"targets": [
{
"name": "default.xml",
"tokens": [
{
"xpath": "/TargetEndpoint/HTTPTargetConnection/URL",
"value": "https://dev-mocktarget.apigee.net"
}
]
}
]
},
{
"name": "qa",
"targets": [
{
"name": "default.xml",
"tokens": [
{
"xpath": "/TargetEndpoint/HTTPTargetConnection/URL",
"value": "https://qa-mocktarget.apigee.net"
}
]
}
]
}
]
}.
what value do i need to update between <URL>https://replaced_by_config_json</URL>
<HTTPTargetConnection>
<Properties/>
<URL>https://replaced_by_config_json</URL>
</HTTPTargetConnection>
Nothing. The "thing to update" is defined by the xpath as defined in the config.json . You can have anything you like between the URL tags. You need to specify the values you want, in the config.json. Replace qa-mocktarget.apigee.net (and so on) with your chosen values.