ProxyEnd point configuration file with Environment variable

with in ProxyEndpoint.xml configuration. Can I used environment variable.

but following code is not able to deployed.

Note: I have same environment name as vistualHost. i.e. qa,dev,int etc....

    <HTTPProxyConnection>
        <BasePath>/v0/hello</BasePath>
        <Properties/>
        <VirtualHost>default</VirtualHost>
        <VirtualHost>secure</VirtualHost>
        <VirtualHost>qa</VirtualHost>
    </HTTPProxyConnection>


Need to replace with 

    <HTTPProxyConnection>
        <BasePath>/v0/hello</BasePath>
        <Properties/>
        <VirtualHost>default</VirtualHost>
        <VirtualHost>secure</VirtualHost>
        <VirtualHost>$environment.name</VirtualHost>
    </HTTPProxyConnection>

0 4 122
4 REPLIES 4

Error MEssage:

Invalid virtual host reference $enviroment.name. Context Revision:2;APIProxy:helloworld;Organization:pinkaldpatel-9834f1ae-eval;Environment:test

Hi @Pinkal Patel

You may only use message templates in certain places, this is not one of them.

https://docs.apigee.com/api-platform/reference/message-template-intro#where-can-you-use-message-temp...

The best practice for virtualhosts is to use the same naming conventions across environments. I.e. default, secure, massl, etc. I don't know what you are trying to achieve with having a virtualhost with same name as the environment. So could you elaborate on that?

How do we expose proxies in different apigee org environments if Virtual names remain environment neutral

What is the usecase which is not getting covered by virtualhosts standards? If you are tryying to connect qa environment from dev environment which is not the good practice. Once you proxy gets deployed to qa it will automatically have the url there.