There is a known limitation of the .Net Framework where the length of an environment block is limited to 65535 bytes.
As to a resolution or workaround, here we have a few options,
- Reduce the number of AppSettings in the application
- Save some settings in another store such as Redis, SQL, NoSQL, etc.
- Separate the variables into multiple app services
- Store the environment variables into a .txt file in a storage account and access them from the file in storage
Regarding why this would happen suddenly, the error occurs during code compilation.
If say an environment variable is added during the build process and you are already near the threshold due to a high number of configured app settings, then any system generated flag can cause the error to throw.
The .Net source code showing where this error throws can be referenced here: Process.cs (microsoft.com)
Since this is being implemented by the .Net framework, it would not be possible to increase the limit.