0
votes

I am in the process of creating a release pipeline for a node application to a web app in app services. The issue is i am getting this error :

Error: Failed to get resource ID for resource type 'Microsoft.Web/Sites' and resource name 'SurveySaysStaging'. Error: Could not fetch access token for Managed Service Principal. Please configure Managed Service Identity (MSI) for virtual machine 'https://aka.ms/azure-msi-docs'. Status code: 400, status message: Bad Request.

I have activated MSI but it is still not working. I also could not find anything related to service principals in my settings and only shows details of the subscriptions. Any help would be very appreciated.

Thanks!

2

2 Answers

0
votes

Error: Failed to get resource ID for resource type 'Microsoft.Web/Sites'

According to the error message:

 Failed to get resource ID for resource type 'Microsoft.Web/Sites' and resource name 'SurveySaysStaging'. Error: Could not fetch access token for Managed Service Principal.

If you are trying to run your release with the hosted agent, you may have this issue. Because A hosted agent doesn't support MSI based authentication.

In order to use MSI based Authentication, you need to configure a private agent on Azure VM and configure MSI on the Azure VM.

You could check this document for some more details.

Note: You could verify if MSI based authentication has been configured properly please run below script from your PS on Azure VM:

Invoke-WebRequest -Uri "https://169.254.169.254/metadata/identity/oauth2/token?api-version=2018-02-01&resource=https://management.azure.com/" -Headers @{Metadata="true"} -Method Get

Besides, if you are already in private agent with activated MSI, you could check this thread or this thread for some helps.

Hope this helps.

0
votes

My problem was fixed, all i needed to do was create a service connection to the service group.