代码之家  ›  专栏  ›  技术社区  ›  Lanceomagnifico

azure devops-如何在应用服务部署后运行powershell脚本?

  •  1
  • Lanceomagnifico  · 技术社区  · 7 年前

    在使用Azure Devops部署之后,我很难理解如何在应用服务上运行powershell脚本(它只运行一个exe)。

    仅供参考-exe只是读取web.config中的一些配置信息,并执行一些数据库更新。因此,它需要访问转换后的web.config和应用程序服务拥有的SQL Server数据库。

    我尝试过使用发布管道部署任务添加powershell步骤,但它似乎只在代理上运行,代理没有exe所需的上下文。

    我可以使用kudu命令行窗口工具手动运行脚本,但我需要自动化这件事。

    我看过几篇这样的文章: How to add a custom post deployment script to azure websites? 或 Kudu post-deployment commands not running 但我认为,只有在使用应用服务的内置部署机制时,这种方法才有效。ie-我无法让它在azure devops的后期部署中触发脚本。

    Deploy Azure App Service task

    0 回复  |  直到 7 年前
        1
  •  -1
  •   Nitin Jain    7 年前
    powershell -Command "your powershell code"
    
    推荐文章