如何从 azure devops 发布管道连接到在另一个订阅中创建的 Web 应用程序?

How to connect from azure devops release pipeline to web app created in another subscription?

我正在我的一个 Azure DevOps 帐户上创建一个发布管道。我想发布到我在另一个帐户 MYACCOUN@hotmail.com 下的订阅中创建的应用服务。在 Azure 订阅下拉列表上方,我单击管理,然后创建连接。我选择 Azure Classic,然后: 1) 如果我选择身份验证方法:凭据,我可以看到以下消息:

"Specify a work or school account (for example @fabrikam.com). Microsoft accounts (for example @live or @hotmail) are not supported. Not recommended if Multi-Factored Authentication is enabled."

所以我相信它不会起作用(而且它不会)

2) 如果我选择身份验证方法:基于证书,我会提供所有详细信息,如订阅 ID、订阅名称和管理证书,然后单击验证,然后消息显示验证成功。但是,当我保存更改时,我无法在 Azure 订阅下拉列表中选择此连接。

我做错了什么?也许我遗漏了什么?

要将您的应用程序部署到 Azure 资源(应用程序服务或虚拟机),您需要 Azure 资源管理器服务连接,如 Daniel 所述。

您可以按照以下步骤创建 Azure 资源管理器服务连接。

项目设置-->管道--> 服务连接-->新服务连接-->Azure Resource Manager-->服务主体(手动)。

您需要输入服务主体 ID服务主体密钥 进行身份验证。您可以按照以下教程创建 Azure 服务主体

Use the portal to create an Azure AD application and service principal that can access resources

Use Azure PowerShell to create an Azure service principal with a certificate

查看文档 Connect to Microsoft Azure 了解更多信息。