How can I access the name of the current aptible app within my container?
I see from Container Environment that aptible injects an env var called $APTIBLE_APP_HREF, but inside the container I’m not sure how to get an app name from that.
How can I access the name of the current aptible app within my container?
I see from Container Environment that aptible injects an env var called $APTIBLE_APP_HREF, but inside the container I’m not sure how to get an app name from that.
The App handle is not exposed natively to the Container Environment. The variable you found is the best way to uniquely identify the App, using the App ID. For example:
APTIBLE_APP_HREF=https://api.aptible.com/apps/16683
The App ID (16683) is unique to the App, whereas Apps in other Environments in your organization could have the same handle.
In the past, that URL (https://api.aptible.com/apps/$APP_ID
) would have been usable to query metadata about your App including the handle. However, for security reasons we had to restrict access to the Aptible API such that those URLs are no longer usable.
If you do need access to the App handle, the best way is to create the environment variable yourself or set it using aptible config:set
for each App.
Thanks,
-Bayley