Environment variable WEBSITE_OWNER_NAME changed in Azure Functions on Consumption Flex plan
Is your question related to a specific version? If so, please specify:
Tested on Node.js 20x on Consumpltion Flex plan
What language does your question apply to? (e.g. C#, JavaScript, Java, All)
Node.js, but most likely other languages too
Question
It seems that WEBSITE_OWNER_NAME environment variable format changed on the new Consumption Flex plan. The new format is something like this:
<subscription-id>+flex-99ddf98v18fee2c3d86cb4d0f37573099297d5124520437bfa4ee00d9fc8ff8e-webspace
comparing to the format on the old Consumption plan:
<subscription-id>+<resource-group>-<region>webspace-Linux
Since the variable is not publicly documented it's expected to change, but still it was the only way to get resource group from within the function (without fetching it from other sources).
The question is: should we expect to have the new format also in the old Consumption plan (not Flex)? If yes, will users have some other way to obtain resource group within the function as also the WEBSITE_RESOURCE_GROUP is missing in both Consumption and Consumption Flex plans?
Hello @Bataran thank you for reporting will check and let you know further steps.
Hello could you pl. check now on the same issue if its still existing as i didnt encouter this kind of issue when i tried to reproduce the same thing on my end.
/bot not-stale
Thank you Bataran. This issue will not be automatically closed and a member of the team will review it soon.
I'll check when I'm back from vacation.
Hi, I tried this again with a newly created function in the "North Europe" region. The WEBSITE_OWNER_NAME variable structure is still different from the variable in the old Consumption plan. You can simply console.log(process.env.WEBSITE_OWNER_NAME) and compare it in the functions with the two different Consumption plans.
On checking further, WEBSITE_OWNER_NAME is a publicly documented environment variable - Link. Which seems that in Flex consumption, we are changing this appsetting behavior. This can also break customers who are migrating from old consumption to Flex consumption plan.
cc @nzthiago
@mathewc or @balag0 do you have any notes on this one? It would be good to have WEBSITE_OWNER_NAME and WEBSITE_RESOURCE_GROUP populated for Flex Consumption as documented here.