1
votes

I have followed every step in this tutorial to create a Python function app in Azure, but when I run func azure functionapp publish myApp, it returns:

Response status code does not indicate success: 400 (Bad Request).

This didn't give me much info. What does this mean? How can I debug this error? Anyone else experiencing this?

EDIT:

Found out I can see some console with CLI_DEBUG=1 flag. This gave me this:

GET https://management.azure.com/subscriptions?api-version=2014-04-01 GET https://management.azure.com/subscriptions?api-version=2014-04-01 GET https://management.azure.com/subscriptions?api-version=2014-04-01 GET https://management.azure.com/subscriptions?api-version=2014-04-01 System.Net.Http.HttpRequestException: Response status code does not indicate success: 400 (Bad Request). at System.Net.Http.HttpResponseMessage.EnsureSuccessStatusCode() at Azure.Functions.Cli.Helpers.AzureHelper.ArmHttpAsync[T](HttpMethod method, Uri uri, String accessToken, Object payload) at Azure.Functions.Cli.Helpers.AzureHelper.GetFunctionApp(String name, String accessToken) at Azure.Functions.Cli.Actions.AzureActions.PublishFunctionAppAction.RunAsync() at Azure.Functions.Cli.ConsoleApp.RunAsync[T](String[] args, IContainer container)

EDIT 2:

I tried another method of getting this up in Azure. When I run az functionapp deployment source config-zip -g myRG -n myApp --src myFiles.zip, I get:

Failed to retrieve Scm Uri Traceback (most recent call last): File "/usr/local/Cellar/azure-cli/2.0.44/libexec/lib/python3.7/site-packages/knack/cli.py", line 197, in invoke cmd_result = self.invocation.execute(args) File "/usr/local/Cellar/azure-cli/2.0.44/libexec/lib/python3.7/site-packages/azure/cli/core/commands/init.py", line 369, in execute six.reraise(*sys.exc_info()) File "/usr/local/Cellar/azure-cli/2.0.44/libexec/lib/python3.7/site-packages/six.py", line 693, in reraise raise value File "/usr/local/Cellar/azure-cli/2.0.44/libexec/lib/python3.7/site-packages/azure/cli/core/commands/init.py", line 343, in execute result = cmd(params) File "/usr/local/Cellar/azure-cli/2.0.44/libexec/lib/python3.7/site-packages/azure/cli/core/commands/init.py", line 182, in call return self.handler(*args, **kwargs) File "/usr/local/Cellar/azure-cli/2.0.44/libexec/lib/python3.7/site-packages/azure/cli/core/init.py", line 436, in default_command_handler result = op(**command_args) File "/usr/local/Cellar/azure-cli/2.0.44/libexec/lib/python3.7/site-packages/azure/cli/command_modules/appservice/custom.py", line 170, in enable_zip_deploy scm_url = _get_scm_url(cmd, resource_group_name, name, slot) File "/usr/local/Cellar/azure-cli/2.0.44/libexec/lib/python3.7/site-packages/azure/cli/command_modules/appservice/custom.py", line 1153, in _get_scm_url raise ValueError('Failed to retrieve Scm Uri') ValueError: Failed to retrieve Scm Uri

So I can't reach kudu / scm, neither here or with Portal ...

1
Can you try to stop the Function before publishing it (e.g. through the Azure Portal)? - silent
Thanks, I tried stopping it now, did not matter. Same error: _Response status code does not indicate success: 400. _ I actually tried pushing an app I know does not exist, and the exact same thing happens... Could this indicate an error with the "connection" with Azure? - NorwegianClassic
It is possible your subscription does not allow creating python functions. Please open an issue here: github.com/Azure/azure-functions-python-worker/issues - Pragna Gopa

1 Answers

0
votes

I got same error. Did not find any answer online, but ultimately resolved by preceding with az login command to login form Azure CLI (https://docs.microsoft.com/en-us/cli/azure/reference-index?view=azure-cli-latest#az-login). Hope this helps.