Azure / azure-cli

Azure Command-Line Interface
MIT License
3.91k stars 2.88k forks source link

functionapp deployment github-actions add: "Unable to retrieve workflow template." #29253

Open fretje opened 1 week ago

fretje commented 1 week ago

Describe the bug

When executing the github-actions add command for a FunctionApp that runs on linux in dotnet-isolated (8.0) mode, I get the following output:

> az functionapp deployment github-actions add --repo my/repo -g $group -n $name --token $pat 
Verified GitHub repo and branch
Getting workflow template using runtime: dotnet-isolated
Unable to retrieve workflow template.

When inspecting the code, it looks like the constants table to look up the workflow template doesn't contain an entry for "dotnet-isolated":

https://github.com/Azure/azure-cli/blob/a83263c3dea477cd343d5cb3f4d5ebd3eaeb1de3/src/azure-cli/azure/cli/command_modules/appservice/_constants.py#L87-L93

This seems to be the case for the windows one as well:

https://github.com/Azure/azure-cli/blob/a83263c3dea477cd343d5cb3f4d5ebd3eaeb1de3/src/azure-cli/azure/cli/command_modules/appservice/_constants.py#L95-L100

Related command

az functionapp deployment github-actions add --repo my/repo -g $group -n $name --token $pat

Errors

Unable to retrieve workflow template.

Issue script & Debug output

... cli.azure.cli.command_modules.appservice.custom: Getting workflow template using runtime: dotnet-isolated cli.azure.cli.core.azclierror: Traceback (most recent call last): File "D:\a_work\1\s\build_scripts\windows\artifacts\cli\Lib\site-packages\knack/cli.py", line 233, in invoke File "D:\a_work\1\s\build_scripts\windows\artifacts\cli\Lib\site-packages\azure/cli/core/commands/init.py", line 664, in execute File "D:\a_work\1\s\build_scripts\windows\artifacts\cli\Lib\site-packages\azure/cli/core/commands/init.py", line 731, in _run_jobs_serially File "D:\a_work\1\s\build_scripts\windows\artifacts\cli\Lib\site-packages\azure/cli/core/commands/init.py", line 701, in _run_job File "D:\a_work\1\s\build_scripts\windows\artifacts\cli\Lib\site-packages\azure/cli/core/commands/init.py", line 334, in call File "D:\a_work\1\s\build_scripts\windows\artifacts\cli\Lib\site-packages\azure/cli/core/commands/command_operation.py", line 121, in handler File "D:\a_work\1\s\build_scripts\windows\artifacts\cli\Lib\site-packages\azure/cli/command_modules/appservice/custom.py", line 7596, in add_functionapp_github_actions File "D:\a_work\1\s\build_scripts\windows\artifacts\cli\Lib\site-packages\azure/cli/command_modules/appservice/custom.py", line 7867, in _get_functionapp_workflow_template File "D:\a_work\1\s\build_scripts\windows\artifacts\cli\Lib\site-packages\azure/cli/command_modules/appservice/custom.py", line 7986, in _get_functionapp_template_file_path azure.cli.core.azclierror.ResourceNotFoundError: Unable to retrieve workflow template.

cli.azure.cli.core.azclierror: Unable to retrieve workflow template. az_command_data_logger: Unable to retrieve workflow template. cli.knack.cli: Event: Cli.PostExecute [<function AzCliLogging.deinit_cmd_metadata_logging at 0x000002868697E5C0>] az_command_data_logger: exit code: 3 cli.main: Command ran in 12.687 seconds (init: 0.295, invoke: 12.393) telemetry.main: Begin splitting cli events and extra events, total events: 1 telemetry.client: Accumulated 0 events. Flush the clients. telemetry.main: Finish splitting cli events and extra events, cli events: 1 telemetry.save: Save telemetry record of length 3835 in cache telemetry.main: Begin creating telemetry upload process. telemetry.process: Creating upload process: "C:\Program Files\Microsoft SDKs\Azure\CLI2\python.exe C:\Program Files\Microsoft SDKs\Azure\CLI2\Lib\site-packages\azure\cli\telemetry__init__.pyc C:\Users\fretje.azure" telemetry.process: Return from creating process telemetry.main: Finish creating telemetry upload process.

Expected behavior

The command should succeed without an error.

Environment Summary

azure-cli 2.61.0

core 2.61.0 telemetry 1.1.0

Dependencies: msal 1.28.0 azure-mgmt-resource 23.1.1

Python location 'C:\Program Files\Microsoft SDKs\Azure\CLI2\python.exe' Extensions directory 'C:\Users\fretje.azure\cliextensions'

Python (Windows) 3.11.8 (tags/v3.11.8:db85d51, Feb 6 2024, 22:03:32) [MSC v.1937 64 bit (AMD64)]

Additional context

No response

yonzhan commented 1 week ago

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

microsoft-github-policy-service[bot] commented 1 week ago

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

fretje commented 1 week ago

FYI: in this is the code that references that constants table:

https://github.com/Azure/azure-cli/blob/a83263c3dea477cd343d5cb3f4d5ebd3eaeb1de3/src/azure-cli/azure/cli/command_modules/appservice/custom.py#L7978-L7990

Maybe here the "-isolated" should be stripped off of runtime_stack?