Azure / Azure/azure-functions-host
Move away from depending on CONTAINER_NAME to determine linux environment
- Dominant language
- C#
- Stars
- 2k
- Forks
- 482
- Avg merge
- 2d 12h
- Merged PRs (30d)
- 38
Description
Today, the host depends on the environment variable `CONTAINER_NAME` to determine if we are running in a linux environment. This measn customers cannot use this app setting or the host will crash for them.
https://github.com/Azure/azure-functions-host/blob/c62778b79e53786dce2852a39b9c1c73690be651/src/WebJobs.Script/Environment/EnvironmentExtensions.cs#L323-L341
The above is just one example, but this is likely sprinkled all over the host. This issue will also require working with the platform team as there is now a contract established.
### Goal
Remove dependency on `CONTAINER_NAME` environment variable for determining linux environments and Skus.
### Workaround
The only workaround today is to not use `CONTAINER_NAME`, and for customers to consider this a protected app setting.
### Related Issues
- https://github.com/Azure/azure-functions-host/issues/9454
- https://github.com/Azure/azure-functions-host/issues/9867
- https://github.com/Azure/azure-functions-core-tools/issues/4227
Contributor guide
Research direction
Start with src/WebJobs.Script/Environment/EnvironmentExtensions.cs at the linked lines, then search the host for other CONTAINER_NAME checks and review the related issues. Coordinate with the platform team on the established contract; the work is done when Linux environment and SKU detection no longer depends on CONTAINER_NAME.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- csharp
- Domain
- backend, cloud
- Issue type
- Refactor
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100