Azure function code changed in the portal is still sometimes doing what the old code did

Filip Noga 0 Reputation points
2024-11-09T11:51:02.04+00:00

I have made an queue trigger function that sends email adress to users using sendgrid, It has been running for almost a year and when I made any changes to it, it would run as expected. I am always using the azure portal editor because I found it the easiest to use. The function runs on node.js and I dont use any deployment platforms to push code to it. The problem started happening a few days ago when I made some changes to the code, and the portal would say that the code was successfully saved, even when I used the inbuild Run/Test it would run the new code but if I made queue using my website, even thought the queue had the new information it would still run the old code. I tried stopping and starting, restarting and even making another function with the same code but still nothing changed.

Azure Functions
Azure Functions
An Azure service that provides an event-driven serverless compute platform.
5,179 questions
Azure Queue Storage
Azure Queue Storage
An Azure service that provides messaging queues in the cloud.
109 questions
0 comments No comments
{count} votes

3 answers

Sort by: Most helpful
  1. Pinaki Ghatak 5,230 Reputation points Microsoft Employee
    2024-11-11T10:14:35.78+00:00

    Hello @Filip Noga

    Based on the information you provided, it seems like the issue might be related to the fact that you're making changes to your function code directly in the Azure portal editor.

    Sometimes, the portal editor can cache the old version of your code, which can cause issues like the one you're experiencing.

    To resolve this issue, I recommend that you try publishing your updated code to your function app using a deployment platform like Visual Studio Code or Azure DevOps.

    This will ensure that the latest version of your code is deployed to your function app and that the old version is not cached.

    If you prefer to continue using the Azure portal editor, you can try clearing your browser cache and cookies, or using a different browser to access the portal.

    This can sometimes help to clear any cached data that might be causing the issue.

    I hope this helps

    1 person found this answer helpful.
    0 comments No comments

  2. Shanmugam s 10 Reputation points
    2024-11-11T12:26:03.98+00:00

    Hi @Filip Noga

    As Pinaki Ghatak said, it is good to go with deployment platform like devops. If you don't have such setup as of now, I would say you can sign-in into azure from VS Code then publish your code from there.

    Below is the reference to publish code from VS Code. Focus from the section called "Sign in to Azure" in the below site.

    https://learn.microsoft.com/en-us/azure/azure-functions/functions-develop-vs-code?tabs=node-v4%2Cpython-v2%2Cisolated-process%2Cquick-create&pivots=programming-language-csharp

    1 person found this answer helpful.
    0 comments No comments

  3. Filip Noga 0 Reputation points
    2024-11-16T13:06:49.57+00:00

    Alright the fault was on my side I forgot and did not notice there was another function app in my azure portal that had the old code and when I looked at its invocations it was mostly the first one to run and then the new one did not because of it.

    Moral of this story, please check all of your function apps to make sure that there is not some old dusted version of it that will make you problems like to me.

    0 comments No comments

Your answer

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