Azure / azure-cli

Azure Command-Line Interface
MIT License
4.03k stars 3k forks source link

az functionapp config - cannot set http20-enabled #28988

Open andygjp opened 6 months ago

andygjp commented 6 months ago

Describe the bug

Calling az functionapp config set with --http20-enabled options returns: "The Tls Version false is invalid. Valid values are: 1.0, 1.1, 1.2, 1.3."

Related command

az functionapp config set --name my-test-function --resource-group my-test-function --http20-enabled true

Errors

The Tls Version false is invalid. Valid values are: 1.0, 1.1, 1.2, 1.3.

Issue script & Debug output

I've only included the bad request:

cli.azure.cli.core.sdk.policies: Request URL: 'https://management.azure.com/subscriptions/*****/resourceGroups/*****/providers/Microsoft.Web/sites/*****/config/web?api-version=2023-01-01' cli.azure.cli.core.sdk.policies: Request method: 'PATCH' cli.azure.cli.core.sdk.policies: Request headers: cli.azure.cli.core.sdk.policies: 'Content-Type': 'application/json' cli.azure.cli.core.sdk.policies: 'Content-Length': '1527' cli.azure.cli.core.sdk.policies: 'Accept': 'application/json' cli.azure.cli.core.sdk.policies: 'x-ms-client-request-id': '35e08bca-15bf-11ef-81f5-3ecf59fd32d7' cli.azure.cli.core.sdk.policies: 'CommandName': 'functionapp config set' cli.azure.cli.core.sdk.policies: 'ParameterSetName': '--name --resource-group --http20-enabled --debug' cli.azure.cli.core.sdk.policies: 'User-Agent': 'AZURECLI/2.60.0 (HOMEBREW) azsdk-python-core/1.28.0 Python/3.11.9 (macOS-14.4.1-arm64-arm-64bit)' cli.azure.cli.core.sdk.policies: 'Authorization': '' cli.azure.cli.core.sdk.policies: Request body: cli.azure.cli.core.sdk.policies: {"properties": {"numberOfWorkers": 1, "defaultDocuments": ["Default.htm", "Default.html", "Default.asp", "index.htm", "index.html", "iisstart.htm", "default.aspx", "index.php"], "netFrameworkVersion": "v4.0", "phpVersion": "", "pythonVersion": "", "nodeVersion": "", "powerShellVersion": "", "linuxFxVersion": "DOTNET-ISOLATED|8.0", "requestTracingEnabled": false, "remoteDebuggingEnabled": false, "remoteDebuggingVersion": "VS2019", "httpLoggingEnabled": false, "acrUseManagedIdentityCreds": false, "logsDirectorySizeLimit": 35, "detailedErrorLoggingEnabled": false, "publishingUsername": "", "scmType": "None", "use32BitWorkerProcess": false, "webSocketsEnabled": true, "alwaysOn": true, "appCommandLine": "Disabled", "managedPipelineMode": "Integrated", "virtualApplications": [{"virtualPath": "/", "physicalPath": "site\wwwroot", "preloadEnabled": true}], "loadBalancing": "LeastRequests", "experiments": {"rampUpRules": []}, "autoHealEnabled": false, "vnetName": "", "vnetRouteAllEnabled": false, "vnetPrivatePortsCount": 0, "localMySqlEnabled": false, "managedServiceIdentityId": 16996, "ipSecurityRestrictionsDefaultAction": "Deny", "scmIpSecurityRestrictionsDefaultAction": "Allow", "scmIpSecurityRestrictionsUseMain": true, "http20Enabled": true, "minTlsVersion": "true", "scmMinTlsVersion": "1.2", "ftpsState": "Disabled", "preWarmedInstanceCount": 0, "functionAppScaleLimit": 0, "functionsRuntimeScaleMonitoringEnabled": false, "minimumElasticInstanceCount": 1, "azureStorageAccounts": {}}}

Expected behavior

I should be able use http20-enabled option without any error

Environment Summary

azure-cli 2.60.0

core 2.60.0 telemetry 1.1.0

Extensions: authV2 0.1.2

Dependencies: msal 1.28.0 azure-mgmt-resource 23.1.0b2

Python location '/opt/homebrew/Cellar/azure-cli/2.60.0/libexec/bin/python' Extensions directory '/Users/andrewpattison/.azure/cliextensions'

Python (Darwin) 3.11.9 (main, Apr 2 2024, 08:25:04) [Clang 15.0.0 (clang-1500.3.9.4)]

Legal docs and information: aka.ms/AzureCliLegal

Your CLI is up-to-date.

Additional context

Example request without --http20-enabled option:

cli.azure.cli.core.sdk.policies: Request URL: 'https://management.azure.com/subscriptions/*****/resourceGroups/*****/providers/Microsoft.Web/sites/*****/config/web?api-version=2023-01-01' cli.azure.cli.core.sdk.policies: Request method: 'PATCH' cli.azure.cli.core.sdk.policies: Request headers: cli.azure.cli.core.sdk.policies: 'Content-Type': 'application/json' cli.azure.cli.core.sdk.policies: 'Content-Length': '1526' cli.azure.cli.core.sdk.policies: 'Accept': 'application/json' cli.azure.cli.core.sdk.policies: 'x-ms-client-request-id': 'ef6f9176-15bf-11ef-8cae-3ecf59fd32d7' cli.azure.cli.core.sdk.policies: 'CommandName': 'functionapp config set' cli.azure.cli.core.sdk.policies: 'ParameterSetName': '--name --resource-group --min-tls-version --ftps-state --always-on --use-32bit-worker-process --debug' cli.azure.cli.core.sdk.policies: 'User-Agent': 'AZURECLI/2.60.0 (HOMEBREW) azsdk-python-core/1.28.0 Python/3.11.9 (macOS-14.4.1-arm64-arm-64bit)' cli.azure.cli.core.sdk.policies: 'Authorization': '' cli.azure.cli.core.sdk.policies: Request body: cli.azure.cli.core.sdk.policies: {"properties": {"numberOfWorkers": 1, "defaultDocuments": ["Default.htm", "Default.html", "Default.asp", "index.htm", "index.html", "iisstart.htm", "default.aspx", "index.php"], "netFrameworkVersion": "v4.0", "phpVersion": "", "pythonVersion": "", "nodeVersion": "", "powerShellVersion": "", "linuxFxVersion": "DOTNET-ISOLATED|8.0", "requestTracingEnabled": false, "remoteDebuggingEnabled": false, "remoteDebuggingVersion": "VS2019", "httpLoggingEnabled": false, "acrUseManagedIdentityCreds": false, "logsDirectorySizeLimit": 35, "detailedErrorLoggingEnabled": false, "publishingUsername": "", "scmType": "None", "use32BitWorkerProcess": false, "webSocketsEnabled": true, "alwaysOn": true, "appCommandLine": "Disabled", "managedPipelineMode": "Integrated", "virtualApplications": [{"virtualPath": "/", "physicalPath": "site\wwwroot", "preloadEnabled": true}], "loadBalancing": "LeastRequests", "experiments": {"rampUpRules": []}, "autoHealEnabled": false, "vnetName": "", "vnetRouteAllEnabled": false, "vnetPrivatePortsCount": 0, "localMySqlEnabled": false, "managedServiceIdentityId": 16996, "ipSecurityRestrictionsDefaultAction": "Deny", "scmIpSecurityRestrictionsDefaultAction": "Allow", "scmIpSecurityRestrictionsUseMain": true, "http20Enabled": true, "minTlsVersion": "1.2", "scmMinTlsVersion": "1.2", "ftpsState": "Disabled", "preWarmedInstanceCount": 0, "functionAppScaleLimit": 0, "functionsRuntimeScaleMonitoringEnabled": false, "minimumElasticInstanceCount": 1, "azureStorageAccounts": {}}}

yonzhan commented 6 months ago

Thank you for opening this issue, we will look into it.

microsoft-github-policy-service[bot] commented 6 months ago

Thanks for the feedback! We are routing this to the appropriate team for follow-up. cc @AnatoliB, @Francisco-Gamino, @shreyabatra4.

pmeems commented 5 months ago

We're facing the same issue. Any progress on this?

zf-rb commented 3 months ago

Also experiencing the same issue running inside of Azure Pipelines. Command: az functionapp config set --http20-enabled true -n $FUNCTIONAPP_NAME -g $RESOURCE_GROUP

The Tls Version true is invalid. Valid values are: 1.0, 1.1, 1.2, 1.3.