1

I'm using the Azure App Service Deploy task, which generates the following YAML (anonymized):

steps:
- task: AzureRmWebAppDeployment@4
  displayName: 'Azure App Service Deploy: app-service-name'
  inputs:
    azureSubscription: SubscriptionName
    appType: functionApp
    WebAppName: 'app-service-name'
    packageForLinux: '$(System.DefaultWorkingDirectory)/artifact_name/drop/$(Build.BuildId).zip'
    enableCustomDeployment: true
    DeploymentType: runFromZip

The zip file for the build is pulled in successfully, the deploy task runs, and everything appears to succeed. However, azure portal shows that there are no functions in the function app. I tried hitting one of the endpoints that should be created (there are multiple functions in the build), and indeed it doesn't respond.

This is a TypeScript project, so the similar-sounding .Net questions didn't help me.

granmoe
  • 312
  • 1
  • 11
  • 1
    can you check from the function kudo ? any files/error there? – Jayendran Oct 31 '19 at 06:30
  • Does this answer your question? [Azure Functions not showing up in Function app in portal](https://stackoverflow.com/questions/56105855/azure-functions-not-showing-up-in-function-app-in-portal) – Mengdi Liang Nov 01 '19 at 03:48
  • @MerlinLiang-MSFT, Unfortunately, that answer doesn't help since my function app is written in TypeScript – granmoe Nov 01 '19 at 17:05
  • 1
    @Jayendran, thanks for the suggestion to use kudu. I wasn't familiar with that tool. Using kudu, I was able to see that /site/wwwroot was not what I expected it to be, and I made a change to the archive step of my pipeline, which resolved the issue. Thanks! – granmoe Nov 01 '19 at 17:08
  • By the way, the issue was that everything was wrapped with an extra folder (due to having the "Prepend root folder name to archive paths" option checked in the archive step. Unchecking this option fixed the issue – granmoe Nov 01 '19 at 17:09
  • 1
    @granmoe Soory could not give you the actual help. Still glad to know you solve the issue now! Do you mind convert your solution in the answer then accept it? I think there must has someone would facing the same issue with you. Hope your answer can give them help:-) – Mengdi Liang Nov 01 '19 at 17:11
  • 1
    @granmoe: Glad that it helped, I also extended my comment as the answer. Please do upvote /accept – Jayendran Nov 02 '19 at 04:53

1 Answers1

1

Whenever you are getting these kinds of errors during the deployment. The easy thing to troubleshoot is using Kudu.

Here some references on how to use this Kudu to troubleshoot the error

https://david-obrien.net/2016/07/azure-functions-kudu/

https://www.serverlessnotes.com/docs/azure-functions-analyse-and-troubleshooting-with-kudu

Hope this helps someone.

Jayendran
  • 9,638
  • 8
  • 60
  • 103
  • 1
    Just in case someone sees this answer but not the specific problem and solution from the comments on the question, I’ll summarize them here: Using kudu, I was able to see that /site/wwwroot was not what I expected it to be, and I made a change to the archive step of my pipeline, which resolved the issue. The problem was that everything was wrapped with an extra folder (due to having the "Prepend root folder name to archive paths" option checked in the archive step. Unchecking this option gave me the expected output in /site/wwwroot/, which fixed my issue. – granmoe Nov 02 '19 at 18:09