Share via

VSC Azure App Service extension to Publish fails now

Stephen Hollister 5 Reputation points
2026-04-17T12:40:57.0333333+00:00

Publishing via Azure portal to my website fails now when it did not before (6+ months ago).

User's image

User's image

Removed PII Information.

Everything looks ok in localhost. It builds the zip file, but the upload fails or gets canceled. This worked before, but I think it's a key/clientId/authorization problem. Did something expire? My msalConfig has a clientId that I cannot find on my Azure portal, but I didn't change anything.

Thanks for any help you can give me.

Azure App Service
Azure App Service

Azure App Service is a service used to create and deploy scalable, mission-critical web apps.


1 answer

Sort by: Most helpful
  1. Q&A Assist
    2026-04-17T12:41:18.3333333+00:00
    AI generated content. This question contains an answer created with AI from Q&A Assist. Learn more

    The failure is consistent with an authentication/authorization issue rather than a problem with the App Service itself.

    The error dialog shows that the signed‑in user account no longer exists in (or no longer has access to) the Azure AD tenant that owns the application with the given clientId. That means the app registration (the clientId in msalConfig) is in a tenant where this account is not a member or guest anymore, so interactive sign‑in for publishing cannot complete and the VS Code Azure App Service extension aborts the deployment.

    To restore publishing, use one of these approaches:

    1. Sign in with an account that belongs to the correct tenant
      When the Azure sign‑in prompt appears, choose Use another account and sign in with the account that actually belongs to the tenant that owns the application/clientId. Once authenticated, retry the Deploy to Web App operation.
    2. Add the current account as a guest/external user in that tenant
      In the Azure portal for the tenant that owns the app registration, add the current user as a guest and grant it access to the subscription/resource group/App Service. After that, sign out and sign back in from VS Code and redeploy.
    3. Create or use a new app registration and update configuration
      If the original app registration is no longer valid or accessible, create a new app registration in the tenant where the current account has access, then update the clientId in msalConfig (and any related configuration) to use the new registration. Ensure the app registration has the required permissions and that the account has access to the App Service resources.
    4. Verify service principal / role assignments if using a service connection
      If deployment uses a service principal behind the scenes, confirm in Azure portal that the service principal (from the app registration) still exists, is not expired, and has appropriate role assignments (for example, Contributor) on the subscription or resource group that contains the App Service. If it expired, create a new credential or a new service principal and update the deployment configuration accordingly.

    Once the account/tenant mismatch is resolved and the app registration is valid and accessible, the VS Code Azure App Service extension should be able to authenticate and complete the zip deploy successfully.


    References:

Your answer

Answers can be marked as 'Accepted' by the question author and 'Recommended' by moderators, which helps users know the answer solved the author's problem.