gpt4 book ai didi

Azure应用服务: WEBSITE_RUN_FROM_PACKAGE - does old zip files gets deleted?

转载 作者:行者123 更新时间:2023-12-04 12:17:04 26 4
gpt4 key购买 nike

当我使用 Azure DevOps 将 zip 文件部署到 d:\home\data\SitePackages 时,它还会在 packagename.txt 中设置该文件的名称并将 WEBSITE_RUN_FROM_PACKAGE 设置为 1,但是删除旧的 zip 文件怎么样? Azure 或 DevOps 可以处理这个问题吗?还是需要我自己做?

最佳答案

Azure App Service: WEBSITE_RUN_FROM_PACKAGE - does old zip files gets deleted?

根据您的描述,您似乎想在新部署之前清空旧的 zip 文件。

如果是,当使用Azure App Service Deploy任务时,并且您正在使用使用 Web 部署发布选项,则有删除目标位置的其他文件的附加选项。

enter image description here

如果选中此选项,部署过程将删除目标位置上正在部署的包中没有相应文件的所有文件。

换句话说,它将删除先前部署中不再需要的所有剩余文件。

引用Removing Deleted Files during Visual Studio Team Services Azure App Service Deploy Task了解详情。

更新:

But when running from package the zip files is located in another folder, and the wwwroot folder is mounted to this zip, as read-only, so there will only be the files that should be there in wwwroot. I am asking if the zip files gets deleted when deploying a new, and using WEBSITE_RUN_FROM_PACKAGE.

您似乎正在使用 Run From Package 来部署 zip 文件,如果是,azure devops 不会删除旧的 zip 文件,我们只需要更新指向它的文本文件,这使我们能够如果需要,可以轻松切换回来。查看文档Deploy Web and Function Apps with Run from PackageRun From Package: a new way to deploy your Azure Web Apps and Function Apps了解更多详细信息。

What i am looking for is, if Kudu, DevOps or some other entity in Azure, clean up the zip files in the deployment folder, or if the deployment folder just grows and grows.

您可以尝试扩展Azure WebApp Virtual File System任务,它可以通过 KUDU 虚拟文件系统 Rest API 从 Azure Web Apps 删除文件(Put & Get 即将推出)。检查this thread了解一些详细信息。

希望这有帮助。

关于Azure应用服务: WEBSITE_RUN_FROM_PACKAGE - does old zip files gets deleted?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/58766693/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com