Zip deploy of Kafka Azure function is successful but Functions in Azure is empty
Asked Answered
I

1

0

I have 3 azure functions:

  1. IotHub trigger
  2. Timer trigger
  3. Kafka trigger

I upload them via CI/CD of the bitbucket pipeline

But after uploading I only have IotHub trigger and Timer trigger working The wwwroot folder of Kafka trigger is empty. Bitbucket pipeline calls

az functionapp deployment source config-zip

under the hood. I tried to call it locally for a created zip from the powershell - same result, empty folder, and no errors in the output.

Iodate answered 20/7, 2022 at 12:57 Comment(16)
Hello @amplifier, I'm not aware of bitbucket pipeline deployment, but tried over the Azure CLI command prompt using the command and got all the 3 triggers created locally as you can see here - i.imgur.com/lkninjE.png, i.imgur.com/uHUpf2R.png - all trigger folders contains function.json files.Parfait
@harikrishnarajoli-mt Could you attach your kafka project please? And a zip file as wellIodate
@harikrishnarajoli-mt How do you create zip file?Iodate
Hello @amplifier, In 2 ways I have zipped the Azure functions project and tried to deploying using the az functionapp deployment command after enabling the scm_do_build_during_deployment to true. Zipping is 1) through right click menu on project folder > Compress to Zip file 2) through powershell command as shown here - i.imgur.com/C6uwNGE.pngParfait
Hi harikrishnarajoli-mt SCM_DO_BUILD_DURING_DEPLOYMENT resets to false after deployment. How to prevent it?Iodate
@harikrishnarajoli-mt do you publish the trigger before compression? I caompress the publish folder, so in my zip file I have folders: .azurefunctions, runtimes and dll's like Azure.Core etcIodate
No @amplifier, I have published after compressing to zip format!Parfait
and you can get my local Azure Functions Project with triple triggers (IotHub, Kafka and Timer) in the Zip format as you asked - github.com/HariKrishnaRajoli-MT/…Parfait
Hello @amplifier, any update on the issue?Parfait
@harikrishnarajoli-mt Hello, yes, it works locally and on the bitbucket (switched to the atlassian pipline), thank you!Iodate
Hello @amplifier, could you please post the answer how you resolved the issue on the bitbucket cloud so that, it would help to other community membersParfait
@hari-krishna sureIodate
@harikrishnarajoli-mt Hi, just added one more answer in case you're interested in.Iodate
Where you have added it!Parfait
@HariKrishna moderator deleted itIodate
I guess As Per SO Rules, you should not add more than 1 answer. If you want to add, you can update the existing answer with more information!Parfait
I
0

In yml file replace

- pipe: microsoft/azure-web-apps-deploy:1.0.3

with

- pipe: atlassian/azure-functions-deploy:2.0.0

Update (it fails again)

It started to fail again. Now not only can't I deploy kafka triggers, bit ordinary iothub and timer one.

It neither work with atlassian nor microsoft pipeline (microsoft/azure-functions-deploy:1.0.2)

It seems to me that it is something relating to deploy of triggers itself. Even deploying from VS2022 fails sometimes:

Publish has encountered an error. The Publish URL https://mytriggerdevtimeraf.scm.azurewebsites.net/ is unreachable. The application may be stopped, restarting or unavailable. Try again once the publish target is available.

A diagnostic log has been written to the following location: "C:\Users\USERNAMR\AppData\Local\Temp\tmpA81B.tmp"

go to log:

8/31/2022 1:13:39 PM Microsoft.WebTools.Shared.Exceptions.WebToolsException: The Publish URL https://mytriggerdevtimeraf.scm.azurewebsites.net/ is unreachable. The application may be stopped, restarting or unavailable. Try again once the publish target is available. at Microsoft.WebTools.Azure.Functions.Publish.ZipDeployPublishProfileConfiguration.d__10.MoveNext() --- End of stack trace from previous location where exception was thrown --- at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) at Microsoft.Publish.Framework.Nexus.PublishProfilesServiceImpl.ServerProjectProfilesManager.d__62.MoveNext()

===================

Stopping triggers before deployment doesn't help

I have 4 trigger and only one is deployed. To detect error I go to the portal click trigger and see the error:

System.Private.CoreLib: Could not load file or assembly 'D:\home\site\wwwroot./.azurefunctions/Microsoft.Azure.WebJobs.Extensions.FunctionMetadataLoader.dll'. Format of the executable (.exe) or library (.dll) is invalid

Iodate answered 15/8, 2022 at 6:45 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.