Error: Failed to get resource ID for resource type Microsoft.Web/Sites
24 June 2023
|
Viewed 3274 times
Error: Failed to get resource ID for resource type 'Microsoft.Web/Sites' and resource name 'AppService-Name'.
Error: Could not fetch access token for Azure. Verify if the Service Principal used is valid and not expired. For more information refer https://aka.ms/azureappservicedeploytsg
You might face this exception when you try to deploy an App Service using Azure Pipelines, if the access token is expired.
If the Service Connection is the Azure Resource Manager using Service Principal - Automatic, we can renew the access token.
Follow below steps to renew the access token.
- Goto your project in Azure DevOps Portal
- Click on Project Settings (bottom left)
- Click on Service Connections under Pipelines section
- Locate your Service Connection and open it.
- Edit and Save (without making any changes)
Access Toke will be renewed automatically. Then navigate to your pipeline and Run It and deployment will be successful.