如何部署Azure Devops Web应用程序

问题描述 投票:2回答:2

我正在设置Azure Devops以将.Net Core Web应用程序部署到Azure。在Visual Studio中,我创建了一个发布配置文件,并使用此配置文件正常发布。我使用门户网站的用户名和密码。

现在我试图让它在Azure Devops管道中工作。有一些步骤可以获得Nuget包,获取关键的保险库秘密和构建。我已经验证了zip文件包是否正确创建。

我正在使用“Azure App Service Deploy”步骤进行部署。它指向pubxml配置文件和zip包,密码与我用于从Visual Studio发布的密码相同。运行时,我收到以下错误:

Error Code: ERROR_USER_NOT_AUTHORIZED_FOR_CREATEAPP
More Information: Could not complete an operation with the specified provider ("createApp") when connecting using the Web Management Service. This can occur if the server administrator has not authorized the user for this operation. createApp http://go.microsoft.com/fwlink/?LinkId=178034  Learn more at: http://go.microsoft.com/fwlink/?LinkId=221672#ERROR_USER_NOT_AUTHORIZED_FOR_CREATEAPP.
Error count: 1.

查看日志,它发出以下命令:

 "C:\Program Files\IIS\Microsoft Web Deploy V3\msdeploy.exe" -source:package='D:\a\1\a\CallService.zip' -dest:auto,computerName="https://xxxxx.scm.azurewebsites.net:443/msdeploy.axd?site=xxxxx",userName="xxxx",password="xxxxx",authtype="basic",includeAcls="False" -verb:sync -disableLink:AppPoolExtension -disableLink:ContentExtension -disableLink:CertificateExtension -setParamFile:"D:\a\1\a\CallService.SetParameters.xml"  -enableRule:DoNotDeleteRule -retryAttempts:6 -retryInterval:10000

用户名和密码已在此处进行了编辑,但它们与门户中的部署凭据和我使用的Visual Studio的内容相匹配。

我希望这可以工作,因为Visual Studio部署使用相同的配置文件和信誉。我想知道是否有人知道如何从Azure DevOps进行部署工作。

azure deployment devops azure-web-app-service
2个回答
0
投票

我还使用Azure Devops部署Web应用程序。 以我的方式,我首先创建Azure Active Directory应用程序。 我将Web应用程序的Access控件授予Azure Active Directory应用程序。 然后,我将Azure Active Directory应用程序添加到Azure devops作为Azure资源管理器服务连接。 在“Azure App Service Deploy”步骤中,我使用此Azure Resource Manager服务连接进行部署。 我希望它会对你有所帮助。


0
投票

对我来说这个错误ERROR_USER_NOT_AUTHORIZED_FOR_CREATEAPP出现了,因为我在传递的参数-Xml文件中没有{project name}_IisWebApplication paremter。它的值应该是the same,如site= URL参数(此处为xxxxx)中所示。

因此,如果您的URL包含此site参数和site参数值:

-dest:auto,computerName="https://xxxxx.scm.azurewebsites.net:443/msdeploy.axd?site=xxxxx"

您的参数文件D:\a\1\a\CallService.SetParameters.xml应如下所示:

<parameters>
  <setParameter name="ProjectX_IisWebApplication" value="xxxxx"/>
</parameters>

(将“ProjectX”替换为您的项目名称,我在Visual Studio的构建过程生成的名为generated.parameters.xml的文件中查找正确的IisWebApplication参数名称。

如果您的文件D:\a\1\a\CallService.SetParameters.xml或其他构建参数也包含名为IIS Web Application Name的参数,则其值也应设置为xxxx

© www.soinside.com 2019 - 2024. All rights reserved.