Home > Software engineering >  Cant sync triggers when deploying Azure Function via VS code
Cant sync triggers when deploying Azure Function via VS code

Time:02-02

I used terraform to create my function app, and then in VS code I create the sample app that they generate for you. When I try to deploy to vs code using the azure functions plugin I get the following output.

6:04:05 PM test-trigger: Starting deployment...
6:04:26 PM test-trigger: Creating zip package...
6:04:26 PM test-trigger: Zip package size: 297 kB
6:04:28 PM test-trigger: Fetching changes.
6:04:44 PM test-trigger: Updating submodules.
6:04:45 PM test-trigger: Preparing deployment for commit id 'b4a19304-f'.
6:04:45 PM test-trigger: Skipping build. Project type: Run-From-Zip
6:04:46 PM test-trigger: Skipping post build. Project type: Run-From-Zip
6:04:46 PM test-trigger: Triggering recycle (preview mode disabled).
6:04:46 PM test-trigger: Updating /home/data/SitePackages/packagename.txt with deployment 20220428010427.zip
6:04:46 PM test-trigger: Deployment successful.
6:05:07 PM test-trigger: Syncing triggers...
6:05:52 PM test-trigger: Syncing triggers (Attempt 2/6)...
6:06:03 PM test-trigger: Syncing triggers (Attempt 3/6)...
6:06:24 PM test-trigger: Syncing triggers (Attempt 4/6)...
6:07:05 PM test-trigger: Syncing triggers (Attempt 5/6)...
6:08:27 PM test-trigger: Syncing triggers (Attempt 6/6)...
6:08:29 PM: Error: Encountered an error (InternalServerError) from host runtime.

How can I get more info on what causes this in vs code?

CodePudding user response:

Hard to say for sure, the deployment went through, but the synctriggers is a different story. I'd recommend a few things to help isolate to make sure it isn't just vs code causing synctriggers to fail.

  1. You should be able to see the synctriggers in your activity log in the portal
  2. The management rest apis are used for mostly everything you see or do with resource management: https://learn.microsoft.com/en-us/rest/api/appservice/web-apps/sync-function-triggers I'd try running this command from the try it button in the above documentation and see what it returns.
  3. Finally you should be able to try a har trace in the browser by refreshing the portal under the functions blade for your function app to see what is returned in the batch request under the network tab for the synctriggers command as well.

You can try any combination of these and it should give you an idea of the synctriggers issue, however it could be networking restrictions on the app, config issue. Hard to say for sure without more context of the app.

CodePudding user response:

In my case I solved it by reverting to python programming model v1 (as opposed to v2 - only available via API/CLI or VS Code extension) Tried clearing associated storage/cache, restarted the app service, created a new instance using paid plan, new functions etc... Certainly server side as the activity logs track the error, though no details.

  • Related