Azure App Service部署无法获取资源类型'Microsoft.Web/Sites'的资源ID [英] Azure App Service deploy Failed to get resource ID for resource type 'Microsoft.Web/Sites'

本文介绍了Azure App Service部署无法获取资源类型'Microsoft.Web/Sites'的资源ID的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在过去的6个月中,我一直使用Azure DevOps中的管道进行发布,但是今天我收到以下错误:

In the last 6 months I have been releasing with a pipeline in Azure DevOps, but today I receive the following error:

2019-09-25T14:24:38.4296875Z ##[section]Starting: Azure App Service Deploy: AS-ServiciosNegocio-API-UAT
2019-09-25T14:24:38.4419797Z ==============================================================================
2019-09-25T14:24:38.4419900Z Task         : Azure App Service deploy
2019-09-25T14:24:38.4419986Z Description  : Deploy to Azure App Service a web, mobile, or API app using Docker, Java, .NET, .NET Core, Node.js, PHP, Python, or Ruby
2019-09-25T14:24:38.4420053Z Version      : 3.4.31
2019-09-25T14:24:38.4420117Z Author       : Microsoft Corporation
2019-09-25T14:24:38.4420182Z Help         : https://docs.microsoft.com/azure/devops/pipelines/tasks/deploy/azure-rm-web-app-deployment
2019-09-25T14:24:38.4420291Z ==============================================================================
2019-09-25T14:24:39.1630446Z Got connection details for Azure App Service:'AS-ServiciosNegocio-API-UAT'
2019-09-25T14:24:39.3091141Z ##[error]Error: Failed to get resource ID for resource type 'Microsoft.Web/Sites' and resource name 'AS-ServiciosNegocio-API-UAT'. Error: Could not fetch access token for Azure. Verify if the Service Principal used is valid and not expired.
2019-09-25T14:24:39.3140156Z ##[section]Finishing: Azure App Service Deploy: AS-ServiciosNegocio-API-UAT

推荐答案

如果您查看错误消息:验证所使用的服务主体是否有效且未过期"

If you look at the error message: "Verify if the Service Principal used is valid and not expired"

虽然我希望有更多信息,但仅基于上述情况,可能的情况是用于服务连接的密钥已过期.

While I would have preferred more information, purely based on the above the likely scenario is the Key Used for the Service Connection has expired.

  • 访问您的Azure DevOps组织.并打开相关的项目,然后单击项目 设置"在屏幕的左下方.

  • Visit you Azure DevOps org. and open the related Project and click on "Project Settings" at the bottom left of the screen.

在Azure DevOps中单击服务连接上的编辑,然后单击 链接>>要使用现有服务主体进行更新,请使用完整 服务连接对话框的版本."

Click edit on the service connection in Azure DevOps and Click on the link >> "To update using an existing service principal, use the full version of the service connection dialog."

复制服务主体客户端ID"

Copy the "Service principal client ID"

现在在Azure门户中,在Azure Active Directory上单击Clic,然后单击应用程序注册"以使用客户端ID"搜索您的应用程序

Now in the Azure Portal, Clic on Azure Active Directory and then Click on "App Registrations" to search for your application with the "client ID"

转到证书和秘密",然后检查您的客户端证书是否已过期.

Go to "Certificate and Secrets" and check if your client certificate has expired.

如果证书已过期,请生成一个新证书并复制密钥.

If the cert is expired generate a new one and copy the key.

返回到Azure DevOps服务连接",在Azure DevOps中单击服务连接上的编辑,然后单击链接>>要使用现有服务主体进行更新,请使用服务连接对话框的完整版本."

Go back to Azure DevOps "Service Connections", Click edit on the service connection in Azure DevOps and Click on the link >> "To update using an existing service principal, use the full version of the service connection dialog."

使用复制的值更新服务主体密钥,验证连接,然后单击确定".

Update Service Principal Key with the copied value, Verify connection and click ok.

这应该可以解决您的问题

This should solve your issue

这篇关于Azure App Service部署无法获取资源类型'Microsoft.Web/Sites'的资源ID的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆