Best way to identify the environment in cloud

Hello, our customer is Kinetic SaaS, and we need to do some calls to an external software through a scheduled function.

From our customer’s Production environment, we need to call the Production environment of the external software, and from the Pilot environment, we need to call the Test environment of the external software.

What would be the best method to achieve the identification of the Kinetic environment without needing some sort of custom value update when Pilot gets refreshed from Prod?

I honestly don’t understand why we don’t have access to a string session variable identifying the environment, as there could be more than Prod and Pilot…

Thanks

You can get the app server URL, and that should be enough for you to be able to differentiate what system you are in.

image

3 Likes

Brandon is right on the money. It’s the most reliable and consistent way I’ve found.

I just test for known text in that field.

1 Like

Had mine open earlier, great minds you know…

image

2 Likes

I would have liked an universal way to identify Prod clearly and avoid working in an “else” manner, as adding another environment in the future could cause this new environment to behave as if it was Prod.

Currently we need to be very specific on the customer URL content, as Dedicated Tenancy URLs have really nothing to identify Prod other than the “/SaaS999/” string vs. “/SaaS999Pilot/” string, while for Single Tenants we can find the “-live.” string vs. “-pilot.” string.

It’s not clean in the way to get the right answer, and i definitely hate to rely on a URL structure that could change over time…

Well actually, it’s not widely known, but you probably (not certain it’s fully rolled out),
have another url to use.

You probably have something like this:

https://yourcompany-live.epicorsaas.com/server/Apps/Erp/Home/
https://yourcompany-pilot.epicorsaas.com/server/Apps/Erp/Home/

You do have fields for “IsLive” available, that will tell you whether or not you are in a live environment or not. But for knowing the specific instance, the URL is going to actually be the most reliable way to know which instance you are connecting to. “Pilot” “Train” “Education” “PurpleMonkeyInstance” are all arbitrary names that could also change at any time.

1 Like

That needs to be maintained however. You can’t rely on that to be accurate, but it would be nice if it was.

1 Like

What about a startup Task that runs a function that checks the AppServerURL and then calls REST to set the Production/IsLive settings?

:thinking:

1 Like

I think I did that at some point, but if I did, I don’t think it’s in production.

Might be a good idea. I wonder what an appropriate trigger would be? :thinking:

image

:person_shrugging:

1 Like

Damn, you are good for something.

1 Like