gpt4 book ai didi

azure - 从命令提示符使用 msbuild 时出现错误 ERROR_COULD_NOT_CONNECT_TO_REMOTESVC

转载 作者:行者123 更新时间:2023-12-03 21:37:25 36 4
gpt4 key购买 nike

我正在尝试在命令行中使用 msbuild 工具部署我的 web 项目,如下所示 -

msbuild MyWebProject.vbproj /p:DeployOnBuild=true /p:PublishProfile="MyWebProject - Web Deploy - Test" /p:Configuration=Debug

但是我收到以下错误 -

msdeploy error ERROR_COULD_NOT_CONNECT_TO_REMOTESVC: Web deployment task failed. (Could not connect to the remote computer ("MyWebProject.scm.azurewebsites.net") using the specified process ("Web Management Service") because the server did not respond. Make sure that the process ("Web Management Service") is started on the remote computer. Learn more at: http://go.microsoft.com/fwlink/?LinkId=221672#ERROR_COULD_NOT_CONNECT_TO_REMOTESVC.) [C:\XXXX\XXXX\MyWebProjectSolution\MyWebProject\MyWebProject.Web.vbproj]

这是我正在使用的发布配置文件 -

<?xml version="1.0" encoding="utf-8"?>
<!--
This file is used by the publish/package process of your Web project. You can customize the behavior of this process
by editing this MSBuild file. In order to learn more about this please visit http://go.microsoft.com/fwlink/?LinkID=208121.
-->
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<WebPublishMethod>MSDeploy</WebPublishMethod>
<ADUsesOwinOrOpenIdConnect>False</ADUsesOwinOrOpenIdConnect>
<LastUsedBuildConfiguration>Debug</LastUsedBuildConfiguration>
<LastUsedPlatform>Any CPU</LastUsedPlatform>
<SiteUrlToLaunchAfterPublish>http://MyWebProject.azurewebsites.net/tMyApp</SiteUrlToLaunchAfterPublish>
<LaunchSiteAfterPublish>True</LaunchSiteAfterPublish>
<ExcludeApp_Data>False</ExcludeApp_Data>
<MSDeployServiceURL>MyWebProject.scm.azurewebsites.net:443</MSDeployServiceURL>
<DeployIisAppPath>MyWebProject/tMyApp</DeployIisAppPath>
<RemoteSitePhysicalPath />
<SkipExtraFilesOnServer>False</SkipExtraFilesOnServer>
<MSDeployPublishMethod>WMSVC</MSDeployPublishMethod>
<EnableMSDeployBackup>True</EnableMSDeployBackup>
<UserName>$MyWebProject</UserName>
<_SavePWD>True</_SavePWD>
<_DestinationType>AzureWebSite</_DestinationType>
<PublishDatabaseSettings>
......
</PublishDatabaseSettings>
</PropertyGroup>
<ItemGroup>
<MSDeployParameterValue Include="$(DeployParameterPrefix)MyWebProjectDB-Web.config Connection String">
<UpdateDestWebConfig>False</UpdateDestWebConfig>
</MSDeployParameterValue>
</ItemGroup>
</Project>

当我使用相同的发布配置文件手动发布我的网络应用程序时,它工作得很好。

这是 msbuild 发出的请求和响应(使用 fiddler 捕获)-

------- Raw Request -----
CONNECT MyWebProject.scm.azurewebsites.net:443 HTTP/1.1
Host: MyWebProject.scm.azurewebsites.net
Proxy-Connection: Keep-Alive
------- Auth -----
No Proxy-Authorization Header is present.
No Authorization Header is present.

------- Raw Response -----
HTTP/1.1 0 Connection passed to Gateway - Result unknown
EndTime: 10:26:35.164

fiddler请求的详细信息请参见下图。 enter image description here

知道我的 msbuild 命令可能出了什么问题吗?

最佳答案

我遇到了这个问题,对我来说,解决方法是将我的 IP 添加到 SCM 站点限制中:

Azure portal -> Your app service -> Networking -> Configure Access Restrictions -> scm tab -> Add rule

https://learn.microsoft.com/en-us/azure/app-service/app-service-ip-restrictions#restrict-access-to-an-scm-site

关于azure - 从命令提示符使用 msbuild 时出现错误 ERROR_COULD_NOT_CONNECT_TO_REMOTESVC,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/33658947/

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