Error: Deployment 'latest' not found, While Deploying the Azure Function app
Asked Answered
S

4

5

I have created an Azure function app, from my VS Code. This function is being deployed to Azure from VScode.

While Deployment Many times it returns "Error: Deployment 'latest' not found, While Deploying the Azure Function app" or "Error: The Operation was aborted", Even I haven't aborted the Deployment. The latest version is always available to Azure there is no modification done via Azure Portal.

Are retrying few times the deployment is successful without returning any error. I have added some snapshot for better understanding.

Image

Error Image

Error Image

Skippet answered 8/11, 2023 at 6:24 Comment(2)
Can you try deploying the function with command `func azure functionapp publish <function_app_name>(if you have azure function core tools installed).Greenback
Sure, I have azure function core tools installed in my local machine, I will try deploying with command.Skippet
G
7

VSCode gives such errors while deploying the function app using Command palette azure functions: deploy to function app or Deploy to function app due to various reasons.

enter image description here

In such cases, you can deploy the function to Azure Function App using the publish command func azure functionapp publish <functionapp_name> --build remote.

  • Also, add AzureWebJobsStorage application setting in local.settings.json(if it is missing).
{
  "IsEncrypted": false,
  "Values": {
    "FUNCTIONS_WORKER_RUNTIME": "python",
    "AzureWebJobsFeatureFlags": "EnableWorkerIndexing",
    "AzureWebJobsStorage": "UseDevelopmentStorage=true"
  }
}

To run the publish command, you must have Azure function core tools installed.

If you haven't installed, open Terminal and run the command to install Core Tools:

npm i -g azure-functions-core-tools@2 --unsafe-perm true
  • Navigate to Root directory of your function project in VScode=>Terminal and run func azure functionapp publish <functionapp_name>.

enter image description here

enter image description here

Portal:

enter image description here

Greenback answered 8/11, 2023 at 15:36 Comment(4)
Thanks, I have used the azure function core, and used command to deploy it worked as charm.Skippet
Quick question - "Also, add AzureWebJobsStorage application setting in local.settings.json(if it is missing).", does this mean local settings should have - "AzureWebJobsStorage": "UseDevelopmentStorage=true", ?Neisse
Yes, you are right.Greenback
Any idea what those various reasons are? I'm getting sporadic failures. Most of the time I get 'Deploy to App "app-name" Succeeded', but every so often (twice in the last ten deployments whilst developing/debugging my functions) I get 'Deploy to App "app-name" Failed' and "Deployment 'latest' not found." It just seems a bit flaky.Communicant
L
5

Make sure to check that the function app in the portal is running. I had kept it disabled, and hence I got the error. Once, I enabled it again, waited for 10 minutes, and it ran perfectly.

Also, in one of similar situations, the function app in the region was not active and it was not deploying. Tried again after 30 mins and it did successfully.

Lucarne answered 23/1 at 19:7 Comment(2)
This worked for me - I had stopped the app in the portal, and this was causing the issue.Cleat
Ditto. Didn't even have to wait 10min.Vannoy
W
2

I can confirm this happened to me while deploying with Azure Function Core Tools.

In my case, I managed to get past this issue by manually deleting the function (deactivating) the function inside the function_app.

Sometimes, I even tried to repeatedly to deploy it and it worked after some times (4th/5th attempt).

Pravallika KV's answer is a good alternative indeed, in my case I didn't have to resort to it.

Windstorm answered 8/11, 2023 at 15:50 Comment(1)
I usually resolve it by repeatedly deploying it. In my case it usually works on the second attempt, and pretty much always by the third attempt.Scalp
E
0

I often run into this when deploying from the VSC code tools. There isn't a lot of information given back on the issue.

9 times out of 10, restarting the function app in the portal fixes the issue.

Eck answered 13/10 at 20:13 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.