Database issues with deploying ASP.NET MVC web app in Azure - mysql

I have a web app published to Azure built in Visual Studio MVC. Many times after publishing updated files the app will fail when querying the database so it seems. For instance the home page will load fine but the app will crash when a link is selected that connects to my database. It is a MySQL database hosted remotely.
Here's the error for the deployed version:
I'm not sure how to interpret the error either and I've looked into enabling development mode in my app but as far as I can tell it is enabled.
Occasionally after a few restarts through Azure the app will start working fine and the app consistently works when I build and launch through Visual Studio. It leads me to believe this is an Azure issue conflicting with my data base setup.
It's making testing a real hassle and I don't have confidence the app/database will be up when I need it to.
Thank you for your help!

I think that you need to get the detailed error message to interpret the error.
To get the error message in azure, we can watch the diagnostic logs, about how to do this, we can refer to: Enable diagnostics logging for web apps in Azure App Service
We can also display the error message directly on browser. For example, if you are using ASP.NET core MVC, we can do as below:
Replace the below code of Startup class:
if (env.IsDevelopment())
{
app.UseBrowserLink();
app.UseDeveloperExceptionPage();
}
else
{
app.UseExceptionHandler("/Home/Error");
}
With:
app.UseBrowserLink();
app.UseDeveloperExceptionPage();
When the error occurs again, we can see the error message at browser directly

Related

Fail to Deploy Forge by using Azure

I want to ask about the Deployment of Forge API by Azure.
I had done it through the resource from Learn Forge, and it seems to work smoothly on the local site, but when I try to publish it, Although it shows permission
after I sign in, it shows 400 error refused, how can I do this for this error?
This is typically caused by an incorrect callback URL for the 3-legged authentication workflow.
When you develop your application locally, you typically set the callback URL (both in your application's code and in https://forge.autodesk.com/myapps) to something like http://localhost:3000/api/forge/callback/oauth).
However, when you deploy your application to Azure, AWS, Heroku, or any other cloud hosting provider, the callback URL must be updated accordingly. For example, if you deploy your application as an Azure Web App, the callback URL could look something like https://my-cool-app.azurewebsites.net/api/forge/callback/oauth. And again, you'll have to change the URL both in https://forge.autodesk.com/myapps, and in your Azure Web App settings.

Deploying a .NET application to Google Cloud Platform worked on initial deploy, now getting 502 Error: Server Error

To give some background, I'm an (unpaid) intern, and I'm unrelated to dealing with this kind of stuff. My employers wanted to update some pictures, and they did locally but didn't know how to upload the new version to the server.
I used the publish settings that were saved in Visual Studio from when the previous intern deployed the server (he was specialized in web site stuff) and it worked on deploy ... then I refreshed the page and I'm getting 502 server error.
Steps I have taken:
Connect to the VM and restart it - didn't solve it. it's using Microsoft server 2016.
Open the VM trough RDP, check if there are errors. There were 3 services not running, and I start them manually. One still isn't running, Downloaded Maps Manager. Ok... I google it and it's not a necessary service so I disable it. Now there are no errors and all services are running but I still am getting this error.
I tried pinging the IP of the server, and the URL itself and it works.
I believe it might be something to do with the load balancer, but I had one HTML class and nothing dealing with actually publishing stuff. If you could point me in the right direction I would appreciate it. The only reason why I'm trying to fix this myself is that I didn't make some kind of backup, and I feel so stupid having taken the site down.
Edit: I've gone to "load balancing" and it says service unhealthy. I tried going to the IPs there and it brings me to the same 502 server error page. From what I've gathered this is a configuration error, it's impossible they messed something with the site itself, right? It did work that first time, and if I run it from Visual Studio it works on the local machine ...

.NET application posts to GearHost and works fine, but does not work on AWS

I have a web application that I would like to migrate from GearHost to Amazon Web Services (Elastic Beanstalk). The web application uses a mysql server that is hosted by GoDaddy. When I try to publish the project to AWS using Visual Studio, the publishing process goes smoothly and there are no errors, however I get a connection timeout when I try to access the site. If i replace https with http I get "HTTPS Required" which leads me to believe the issue is not with the server itself, but with my application.
Does AWS require you to use their database server?
Any help would be appreciated.
UPDATE: I tried an older version of IIS in the AWS settings, the webpage loaded once and now it does not work on refresh.
You don't have to use an AWS database, but you do need to open up the GoDaddy firewall to allow traffic to go back and forth between your new AWS website and the GoDaddy database.

Why is a razor view of my servicestack site displaying the metadata page on azure only?

I have an application that displays my razor views of servicestack endpoints as expected on localhost. However when deployed to azure websites a particular page displays the metadata page for some reason. I don't know how to work out what has gone wrong as it all works on my machine :).
For reference, the view name matches the return DTO. I've tried the site in release mode on my machine. All other pages display as expected on azure and locally. I've cleared the cache and re-started the site from the control panel. I'm running out of things to try.
Any ideas appreciated.
Some general troubleshooting approaches that might help you:
Use Postman, cURL or Fiddler to watch the HTTP traffic between your computer and the website, looking for clues in HTTP headers, requests and responses.
Using FileZilla, connect to your website via FTP. Download the content of /site/wwwroot to a new directory on your local machine. Add this as a virtual website in IIS and run it locally. You'll be running exactly the same code that is deployed.
Instrument your application with tracing in a similar fashion to ASP.NET Tracing and look for exceptions or any other odd behavior.
Refer to Troubleshooting a Web Site for additional resources.

Getting a Windows Store App validated for submission, if it starts out by asking the user to login to facebook?

I have made an app for Windows Store Apps that needs the user to log in to facebook for it to make sense. I use the Authenticaiton Broker and it pops up as the first ting when the app launches.
When i run the developer tools WACK tool , it fails :
Error Found: The crashes and hangs test detected the following errors:
Application 20055S-Innovations.FacebookFanApp_1.0.0.6_neutral__z1vybpgpdtf9j was detected by Windows Error Reporting and experienced a crash or hang.
I dont know if thats related to it using the authentication broker ? Because if I run it myself it works fine and I just login and the app works.