חיים חדד
חיים חדד

Reputation: 522

Getting error after publishing my project into Azure App-Aplication (Web Hosting)

I tried several times to publish my website from Visual Studio 2019 to the Azure server but I getting errors.

I have an MVC-CORE 3.0 project which works fine using IIS EXPRESS (localhost).

In my web-application, there is a login page (home page), which is the first view. It perfectly works both on Azure and the localhost.

But once I using the published website and log in to my account (=move to the next view), I got this error:

enter image description here

*The login process works great using localhost

*I already published my app 2 months ago and it perfectly worked! This error appeared just after republishing (private needs).

Please HELP ME !!!

Upvotes: 1

Views: 561

Answers (2)

Monika Reddy
Monika Reddy

Reputation: 973

Have you tried to set the environment variable inside the web app on Azure?

If not, please try this:

Open the Application Settings blade --> Scroll Down to -->"Application Settings" --> add the "ASPNETCORE_ENVIRONMENT" and "Development".

Also please take a look at this doc for more reference.

Upvotes: 0

Jason Pan
Jason Pan

Reputation: 21972

I think you should try these way to solve you issues.

According to your describe, you can open you site correctly. But when you do other operations, the error occured. Here are my advice,

Tips 1, check your web.config file ,make sure you dbConnection is correct. Pls pay attention to Connection strings in portal.And the priority on the portal is higher than that in the web.config.

Connection strings in portal

Tips 2, check your web.config file ,modify the config, like the post. Add settings like below,

<configuration>
  <system.web>
    <customErrors mode="Off" />
  </system.web>
</configuration>

If my advices don't work, you can try to solve the problem by Monika Reddy-MSFT's way.

Update

If you can't open you site correctly, pls check Stack settings in portal.

And next time when you republish your apps, you can backup publish file first in order to restore previous version. Or you can publish your app in slot, if it works fine then you can swap it.

Upvotes: 1

Related Questions