Azure / Azure/azure-functions-core-tools
azure function core tools ignoring env variable "AZURE_CLI_DISABLE_CONNECTION_VERIFICATION"
- Dominant language
- C#
- Stars
- 1.5k
- Forks
- 498
- Avg merge
- 3d 13h
- Merged PRs (30d)
- 13
Description
Hello,
if the environment variable "AZURE_CLI_DISABLE_CONNECTION_VERIFICATION" is set to any value, the azure CLI tools are ignoring SSL errors.
E.G.:
AZURE_CLI_DISABLE_CONNECTION_VERIFICATION=TRUE
The azure function core tools do not take care of this setting (ignoring it).
It is impossible to establish a connection to a host with untrusted/broken certificate -> no deployment possible i.e..
I see this as a bug, because other "az extensions" are interpreting this setting correctly.
Please correct this.
I helped myself, by modifing the source code and adding the following check and callback into the PublishFunctionAppAction.cs:
```
string value = Environment.GetEnvironmentVariable("AZURE_CLI_DISABLE_CONNECTION_VERIFICATION");
if (value != null)
{
Console.WriteLine("SSL validation check disabled!");
httpClientHandler.ClientCertificateOptions = ClientCertificateOption.Manual;
httpClientHandler.ServerCertificateCustomValidationCallback =
(httpRequestMessage, cert, cetChain, policyErrors) =>
{
return true;
};
}
```
And yes, maybe this not a good solution...
Kind Regards
Clemens
Contributor guide
Research direction
Start in PublishFunctionAppAction.cs and trace how the HTTP client handles the AZURE_CLI_DISABLE_CONNECTION_VERIFICATION environment variable during deployment. Compare that behavior with the Azure CLI handling described in the issue, then verify that deployments to hosts with untrusted or broken certificates work when the variable is set.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- azure, csharp
- Domain
- cli, cloud
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 42/100