While using the deployment API you may see the following error.
ManagedIdentityCredential authentication unavailable. Multiple attempts failed to obtain a token from the managed identity endpoint.
If this does not happen locally, but does happen in Azure DevOps the service principal may be used because the task is of type Azure PowerShell instead of just PowerShell.
- Check to see if the task is of type Azure PowerShell or PowerShell.
- If it is Azure PowerShell, change it to PowerShell. This connects to the PaaS portal verses connecting directly to the app service, thereby avoiding service principal usage which is no longer supported for deployments.