简体   繁体   English

Azure Devops Release Pipeline - 将单个文件部署到Azure App Service

[英]Azure Devops Release Pipeline - Deploy single file to Azure App Service

I have a single file that I need to deploy to an existing App Service (that already contains an application, deployed previously through another pipeline).我有一个文件需要部署到现有的应用程序服务(已经包含一个应用程序,之前通过另一个管道部署)。

I would like to avoid using the FTP task for that.我想避免为此使用 FTP 任务。

Is there a way to deploy a single file to a specific folder in an App Service via a DevOps Pipeline?有没有办法通过 DevOps 管道将单个文件部署到应用服务中的特定文件夹?

Actually FTP seems to be the easiest way to deploy single file.实际上 FTP 似乎是部署单个文件的最简单方法。 However if you don't want to use it you can use KUDU API .但是,如果您不想使用它,可以使用KUDU API What you need is to wrap it in powershell script:您需要的是将其包装在 powershell 脚本中:

$username = '$(username)'
$password = '$(password)'
$base64AuthInfo = [Convert]::ToBase64String([Text.Encoding]::ASCII.GetBytes(("{0}:{1}" -f $username,$password)))

$apiUrl = "https://$(siteName).scm.azurewebsites.net/api/vfs/site/your-file"
$filePath = "$(System.DefaultWorkingDirectory)/your-file"
$headers = New-Object "System.Collections.Generic.Dictionary[[String],[String]]"
$headers.Add("Authorization", ("Basic {0}" -f $base64AuthInfo))
$headers.Add("If-Match", "*")

Invoke-RestMethod -Uri $apiUrl -Headers $headers -Method PUT -InFile $filePath -ContentType "multipart/form-data"

Here you find info how to get credentials .在这里您可以找到有关如何获取凭据的信息。

But if this is one time task you may use drag & drop from KUDU panel as it is mentioned here但是,如果这是一次性任务,您可以使用 KUDU 面板中的拖放操作,如此所述

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 Azure Devops发布管道-未更新Azure App Service文件 - Azure Devops Release Pipeline - Azure App Service files not updated 在 azure devops 上创建管道以在 azure 应用服务上部署 docker 容器? - Create a pipeline on azure devops to deploy a docker container on azure app service? 如何使用Azure DevOps发布管道将Java应用程序部署到Tomcat 8 App Service? - How to deploy Java application to Tomcat 8 App Service using Azure DevOps release pipeline? Azure Devops 发布管道无法将 Web 包部署到应用服务。 禁止IP 403 - Azure Devops release pipeline Failed to deploy web package to App Service. Ip Forbidden 403 等待新部署的应用服务在 Azure Devops 发布管道中重新启动 - Waiting for a freshly deployed app service to be restarted in Azure Devops Release pipeline Azure DevOps 发布管道消除了应用服务部署槽 - Azure DevOps Release Pipeline wipes out App Service Deployment Slot 作为 Azure DevOps 发布管道的一部分,从应用服务中删除文件 - Delete files from app service as part of Azure DevOps release pipeline Azure DevOps 发布管道 - Azure Devops Release Pipeline 从逻辑应用在 Azure Devops 中部署发布 - Deploy Release in Azure Devops from a logic app 更新 web.config,为 Azure 应用服务的 Azure DevOps 发布管道中的特定环境添加重写规则 - Update web.config to add rewrite rules for specific environments in Azure DevOps release pipeline for an Azure App Service
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM