Hi ,
Thanks for reaching out to Microsoft Q&A.
The error ClientSecretCredential authentication failed and Could not find tenant id for provided tenant domain indicates that your PowerShell session on the second server cannot authenticate the service principal against Azure AD.
Here are the most common causes:
- Tenant or App mismatch : The
tenantId,appId, andsecretcombination does not belong to the same AAD tenant. Double check that the service principal was created in the same tenant as the subscription. - Firewall / proxy issue : The 2nd server may be behind a proxy or firewall that blocks outbound requests to Azure login endpoints (
login.microsoftonline.com). - Ensure the server has the latest
AzPowerShell module - Verify the SPN has at least Reader/Contributor access to the target subscription-If it fails, the service principal does not exist in that tenant.
Please 'Upvote'(Thumbs-up) and 'Accept' as answer if the reply was helpful. This will be benefitting other community members who face the same issue.