Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Zipdeploy for function app deploys wrong function app? #3333

Closed
razzemans opened this issue Sep 17, 2021 · 5 comments
Closed

Zipdeploy for function app deploys wrong function app? #3333

razzemans opened this issue Sep 17, 2021 · 5 comments

Comments

@razzemans
Copy link

We have two Azure functions, let's call them A and B, that we deploy using Azure Devops. Looking at the deployment logs, first the right package is deployed followed by a deploy where the contents of Function App A are deployed to Function app B. How this happens is a mystery.

The strange things is, looking at the logs and what is inside Kudu, they don't match up. For example, the latest deploy log, which deploys the incorrect version, will say this:

[
  {
    "log_time": "2021-09-17T10:57:17.3180234Z",
    "id": "",
    "message": "Command: \"D:\\home\\site\\deployments\\tools\\deploy.cmd\"",
    "type": 0,
    "details_url": null
  },
  {
    "log_time": "2021-09-17T10:57:18.5999063Z",
    "id": "",
    "message": "Handling Basic Web Site deployment.",
    "type": 0,
    "details_url": null
  },
  {
    "log_time": "2021-09-17T10:57:24.8723981Z",
    "id": "",
    "message": "Creating app_offline.htm",
    "type": 0,
    "details_url": null
  },
  {
    "log_time": "2021-09-17T10:57:24.9036384Z",
    "id": "",
    "message": "KuduSync.NET from: 'D:\\local\\Temp\\zipdeploy\\extracted' to: 'D:\\home\\site\\wwwroot'",
    "type": 0,
    "details_url": null
  },
  {
    "log_time": "2021-09-17T10:57:25.0941627Z",
    "id": "",
    "message": "Deleting file: 'OurCompany.Api.B.dll'",
    "type": 0,
    "details_url": null
  },
    "log_time": "2021-09-17T10:57:25.1557977Z",
    "id": "",
    "message": "Copying file: 'extensions.json'",
    "type": 0,
    "details_url": null
  },
  {
    "log_time": "2021-09-17T10:57:25.1718472Z",
    "id": "",
    "message": "Copying file: 'OurCompany.Api.A.dll'",
    "type": 0,
    "details_url": null
  },
  {
    "log_time": "2021-09-17T10:57:27.4441118Z",
    "id": "",
    "message": "Deleting app_offline.htm",
    "type": 0,
    "details_url": null
  },
  {
    "log_time": "2021-09-17T10:57:27.5223301Z",
    "id": "",
    "message": "Finished successfully.",
    "type": 0,
    "details_url": null
  }
]

But when I go to Kudu on the server of the OurCompany.Api.B function app and I look at the actual contents in D:\\local\\Temp\\zipdeploy\\extracted I see no OurCompany.Api.A.dll at all - only OurCompany.Api.B.dll. Note that the timestamp of the files in the extracted folder predate the second deployment, so they are from the first and CORRECT deploy.

If I look at the contents inside D:\\home\\site\\wwwroot I DO see the incorrect OurCompany.Api.A.dll but where this is coming from I have no idea.

So... how can the deploy logs mention the copying of incorrect dll files while they are not in the folder on the server, and never were there because the timestamps don't add up? We've been working on this issue for days now without succes.

@suwatch
Copy link
Member

suwatch commented Sep 18, 2021

See if both function apps happen to use the same Azure Files Share.

@razzemans
Copy link
Author

Appreciate the reply. They were hosted on the same App Service Plan so that is the case I assume. I actually hosted them on separate app service plans after my initial post and the issue has gone away. So what is happening here? Can we not host more than one Azure function on the same App Service plan? Or only when using zip deploys?

@suwatch
Copy link
Member

suwatch commented Sep 20, 2021

App Service Plan (same or different) should not matter. Each App Service will have its own file system - one deployment should not affect the other. Often times - users setup Azure Files for each App Services; however, many point to the same file share overriding the content.

@razzemans
Copy link
Author

razzemans commented Sep 21, 2021

I can only say that after migrating to a different App Service Plan the issue went away 100%. I'm fairly sure it is not an issue with our deployment pipeline since the logs / kudu clearly show that somehow files are overwritten. We did not setup Azure File Share for these function apps.
I'm happy that the issue resolved using a different App Service Plan, but on the other hand something clearly goes wrong here which might affect other users in the future.

@jvano
Copy link
Member

jvano commented Apr 29, 2024

Hi

If the problem persists and is related to running it on Azure App Service, please open a support incident in Azure:
https://learn.microsoft.com/en-us/azure/azure-portal/supportability/how-to-create-azure-support-request

This way we can better track and assist you on this case

Thanks,

Joaquin Vano
Azure App Service

@jvano jvano closed this as completed Apr 29, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants