Azure / azure-functions-core-tools

Command line tools for Azure Functions
MIT License
1.32k stars 433 forks source link

SIGINT (ctrl+c) during functionapp publish broke syncing triggers #3423

Open gabrieljoelc opened 1 year ago

gabrieljoelc commented 1 year ago

I have been using func functionapp publish to deploy to a Linux Consumption Function App:

func azure functionapp publish my-linux-consumpmtion-func-app

which normally outputs all the triggers when the deployment is complete:

Getting site publishing info...
Uploading package...
Uploading 29.16 MB [##############################################################################]
Upload completed successfully.
Deployment completed successfully.
Syncing triggers...
Functions in my-linux-consumpmtion-func-app:
    trigger1 - [httpTrigger]

    trigger2 - [serviceBusTrigger]

One of the times I was running it, I Ctrl+C'd during the "Sync triggers..." output:

Getting site publishing info...
Uploading package...
Uploading 29.16 MB [##############################################################################]
Upload completed successfully.
Deployment completed successfully.
Syncing triggers...
^C # <======================= RIGHT HERE

Now when I run the same command, I doesn't output the triggers and show this:

Getting site publishing info...
Uploading package...
Uploading 29.16 MB [##############################################################################]
Upload completed successfully.
Deployment completed successfully.
Syncing triggers...
Functions in my-linux-consumpmtion-func-app:

The triggers fail to sync and the portal shows I have no triggers.

Things I've tried:

Update 1

I checked the WEBSITE_RUN_FROM_PACKAGE setting in the function app and it does have the correct URL of the latest release. I curl the URL, downloaded the file as a zip, and verified that it contains the built application code. šŸ¤·

Is it something related to the SIGINT breaking the CLI so it can't bump the azure-webjobs-hosts/synctriggers/my-linux-consumption-func-app/last blob anymore or something?

danrimbault commented 9 months ago

@gabrieljoelc I don't know specifically about crtl c'ing when the sync is underway. But I think there are issues with azure-functions-core-tools. Our application was deploying and syncing fine from local scripts on windows machines. But on the pipelines (linux image) the tool would report successful sync but then there would be no functions in the app. Upgrading azure-functions-core-tools to v4 (which seems to introduce dependency on dotnet sdk) seems to have solved the problem. TLDR be suspicious of azure-functions-core-tools v3 output when publishing