Issue deploying Azure Function ##[error]Error: Error: Failed to deploy web package to App Service. Not Found (CODE: 404)

Harvey Marshall 0 Reputation points
2025-10-24T12:02:07.7233333+00:00

I am trying to create a azure-pipeline to deploy a function app. Everything seems corect but I always encounter this set of errors:

##[error]Failed to deploy web package to App Service.

##[warning]Can't find loc string for key: KuduStackTraceURL

##[error]KuduStackTraceURL https://:@ratepilotapi-hbg5fvbtdhafgtcd.scm.uksouth-01.azurewebsites.net/api/vfs/LogFiles/kudu/trace

##[error]Error: Error: Failed to deploy web package to App Service. Not Found (CODE: 404)

##[warning]Error: Failed to update deployment history. Error: Method Not Allowed (CODE: 405)

the deploy section of my pipeline looks like this

  - task: AzureFunctionApp@1
   inputs:
    azureSubscription: 'RatePilotAzureServiceConnection'
    appType: 'functionApp'
    appName: 'ratepilotapi'
    resourceGroupName: 'stargazer'
    package: '$(System.D
      -name "API_URL" -value "<example>"
      -name "COSMOS_URI" -value "<example>"
      -name "DATABASE_NAME" -value "<example>"
  
Azure Functions
Azure Functions
An Azure service that provides an event-driven serverless compute platform.
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. Pravallika KV 165 Reputation points Microsoft External Staff Moderator
    2025-10-24T12:13:31.17+00:00

    Hi Harvey Marshall,

    Thanks for reaching out to Microsoft Q&A.

    The 404 Not Found and 405 Method Not Allowed errors usually point to one of a few deployment misconfigurations in Azure Pipelines.

    • 404 error occurs when the pipeline is unable to reach the Function App’s Kudu endpoint.
    • This usually happens if the appName is incorrect or the Function App doesn’t exist in the specified resourceGroup.

    I can see there is a mismatch between the appType and the actual app e.g., trying to deploy a Linux function app with appType: functionApp but not specifying linux.

    • Make sure the Function App ratepilotapi exists in the stargazer resource group in the UK South region.
    package: '$(System.D
      -name "API_URL" ...
    

    The package input must point to the zip or folder containing your Function App artifacts package: '$(System.DefaultWorkingDirectory)/drop/functionapp.zip'. Make sure the path exists in the build artifacts.

    • Change the version of task to AzureFunctionApp@2
    task: AzureFunctionApp@2
    

    Example:

            deploy:
              steps:
              - task: AzureFunctionApp@2
                inputs:
                  connectedServiceNameARM: '$(azureSubscription)'
                  appType: 'functionAppLinux'
                  appName: $(functionAppName)
                  deployToSlotOrASE: true
                  package: '$(Pipeline.Workspace)/drop/$(Build.BuildId).zip'
                  runtimeStack: 'NODE|20'
                  deploymentMethod: 'auto'
    

    Hope it helps!


    Please do not forget to click "Accept the answer” and Yes, this can be beneficial to other community members.

    User's image

    If you have any other questions, let me know in the "comments" and I would be happy to help you.

    0 comments No comments

Your answer

Answers can be marked as 'Accepted' by the question author and 'Recommended' by moderators, which helps users know the answer solved the author's problem.