I am looking for the most relevant/robust way to resolve the current webjob name. I need it at both function execution time and host startup for registration purpose in my internal logic.
Webjob name is defined in Properties\webjob-publish-settings.json
but this file is not deployed. I can't use it at runtime anymore.
Webjob binaries are all stored in a dedicated folder named according to the webjob name. It looked like the best way to resolve my issue.
But after having a look at the SDK and this issue, I am unsure this solution could be broken by a future update.
Currently the SDK is retrieving the webjob name through an internal environment variable WEBJOBS_NAME
defined in WebSitesKnownKeyNames
class. Why does the SDK is relying on this instead of the folder name if it is a secure solution?
Also the linked issue state that renaming a webjob folder in order to rename th webjob itself is not supported and a proper solution is on its way.
Does any of you have already faced this issue and successfully solved it?