Server error in '/' Application Visual Studio 2015 community - azure

Need your help on this.I'm a newbie to the C# visual studio domain.
I was going over the tutorial on Microsoft site to create App and deploy on Azure. Here is the link below:
https://azure.microsoft.com/en-us/documentation/articles/web-sites-dotnet-deploy-aspnet-mvc-app-membership-oauth-sql-database/
After completing every single step .I have this annoying error message that keeps popping up whenever I try to access/ login-in - by using the google account or using the default user name and password on the site. Screenshot here
I've gone line by line checking my steps and codes ;my azure server, app and database is running perfectly. Google API and app is running - no errors.
On my local machine it is works fine. But, when I publish the code to Azure - the home page comes up and I can navigate to the login page but - I just can't login-in using the google AuthOut nor the default login page using the default credentials on line.
For the life of me - can't understand why its not working. Need help people.

The error means that your site is trying to talk to your database (SQL Server) but it can't connect to it. You probably don't have a SQL server database setup.
Look at step 11 in the instructions:
11.Select Create new server, enter a server name, user name, and password.
I'm guessing that you didn't create the database when you were creating your web app.

Related

How to deploy GAS web app with limited access

I have a app builded in android studio which is a simple searchable database. I use a function doGet(in the apps script) to fetch data from a gsheet. Everything works well, but the real gsheet I need is in the local domain of my company(stored in a Shared Drive) so when I try to deploy the apps script as a web app I can't set permission to anyone(limited only to user of company). The response of the url is so a blank page.
Is there a method to get around this trouble?
Update: I also tried to add a Google sign in page when opening the app but still doesn't work

Web Deploy from a new computer

I got a new computer and I'm trying to publish my website through web deploy in Visual Studio from the new computer but it keeps saying failed due to unauthorized user. I'm using the same visual studio account, the same password. Everything else is identical to what it looks like in the old computer.
Is there something on the azure website that I need to update to allow a new computer to publish? Is the password different from the username/password I login to get into azure portal? There seem to be a lot more **** in my old computer's password input than what's required. I just assumed that it at some point did that for security purposes.
This is the error I get when going to Settings in the publishing window in Visual Studio and when I click Validate Connection:
Connect to the remote computer ("website name" using the Web
Management Service, but could not authorize. Make sure that you are
using the correct user name and password, that the site you are
connecting to exists, and the credentials represent a user who has
permissions to access the site. Learn more at:
http://go.microsoft.com/fwlink/?LinkId=221672#ERROR_USER_UNAUTHORIZED.
The remote server returned an error: (401) Unauthorized.
Is there something on the azure website that I need to update to allow a new computer to publish?
No.
Is the password different from the username/password I login to get into azure portal?
Its not different. Its the same.
I have noticed that sometimes, even with everything being correct from our side, VS web deploy to Azure simply may not work. It could a simple connection issue from VS to Azure, in terms of authentication and no fault of yours.
I don't know why VS is giving authentication error, but as an alternative, you could, deploy your site locally to a folder in Visual Studio. Then, deploy the site manually to your site via FTP.
https://learn.microsoft.com/en-us/azure/app-service-web/web-sites-deploy
In the long run, you will come to trust FTP deploy than VS deploy which is simply too much of a hassle.

Webmatrix cannot connect to azure database and fails to publish website as a result

I have created a Drupal7 website in Webmatrix 3 and it all works fine. I followed the instructions here to pre-provision a website and database on Azure, download a publish profile and attempt to use it to deploy the website. I imported the profile but no database connection setting appeared in the settings dialog, so I entered the relevant details and attempted to validate. The connection settings I put in are like this:
Server: asdfghjk.database.windows.net
Database: abcdrupal7
User: abc
Password: V1earb13H
When I validate Webmatrix says it can connect to the server but not the database. I have also tried the user id in the form abc#asdfghjk with no greater success. I can log in to the database server on azure using these details.
Can anyone tell me what's going wrong?

Azure - customErrors="off" in web.config is not displaying detailed errors in Azure app (cloud service)

I have an app deployed to Azure and it uses ADFS (Active Directory Federated Services) for authentication.
When the user tries to navigate to the app on Azure, it redirects the user to the ADFS authentication page. User enters their credentials and clicks OK, and ADFS redirects the user to the landing page of my app.
Everything is working fine up to this point. I'm getting a generic server error on the app once the user hits the landing page. PROBLEM: I need to see the detailed errors. I try setting <customErrors="off" />, repackage my app and redeploy, but that doesn't give me detailed errors:
Here's what I've tried: I've tried packaging my app in Debug mode (after Release mode didn't work), I've edited both web.config's (in the root of the solution, as well as in the Views folder, just to cover all bases). Nothing worked.
What am I doing wrong?
A couple of things to try:
Are you SURE the customerErrors attribute is set correctly? The
Identity and Access tooling in Visual Studio seems to like to reset
that back to "Off" (every time you update via the tool).
Are you able to connect to the role instance via Remote Desktop? If
so, you could inspect the web.config settings for the site?
Browsing to the site from the server might also provide a more
friendly error message.
When you RDP into the cloud service, you can look at the Event
Viewer to see the detailed error messages.
I fixed this error by ftp'ing into my azure website and deleting the wwwroot folder and then publishing my website via visual studio.

Named Schema not working in Azure SQL

I want to use a separate/ named schema in an Azure WebSite app to implement a multi-tenancy in separate schemas pattern with Azure SQL. My app runs correctly in Visual Studio but not on Azure. I searched StackOverflow for similar issues, and found:
This answer suggests it can't be done: Multi-tenant application on Windows Azure. This question does not apply directly to named schemas: Azure SQL database working when ran locally but not when published to Azure.
For the MVC4 app I am developing I configured the Azure SQL database to use a named schema and modified the Connection String login name and password. When I tried to register the first user it threw the error message "Invalid object name 'UserProfile'" from Azure SQL. I checked the stack trace and everything looked reasonable so I reviewed the code for the SimpleMembershipProvider and did not see anything that should break when using a named schema.
As a Proof of Concept, I opened Visual Studio 2012 and created a new MVC4 app with .NET Framework 4.5 using the Internet Application template, which of course implements the Simple Membership Provider. I opened the Azure console and created a new web site with new database, then published the app to Azure. I ran the app and clicked the Register link to add the first user. This was successful, and I was able to logout, login, etc.
I then modified the PoC app's Azure SQL configuration by creating a new named schema, login and user. I added the db_owner role for the new user in the new database. I altered the user's default schema and transferred the tables created by the initial run into the named schema. I confirmed that the user's default schema is correct and the tables are in the named schema. I changed the user name and password in the Connection String section of the Publish dialog and again published the app from Visual Studio. I opened the website in Chrome and clicked the Register link. I entered a user name and password and got the error message "Invalid object name 'UserProfile'". I got the same error when atttempting to login with the user created in the first run.
I am looking for ideas about what to check next. I can work around this issue, but if I missed anything simple I would rather fix things the efficient way. Any ideas?
It seems I found a bug in Azure WebSites that causes the Connection String to not be updated by publishing the web site.
There is a connection string on the Azure Management portal's Configure page for the web site. This connection string is used to connect to the web site's database. It initially contains the User Id and Password used to create the database. Entering a different User ID and Password in the Visual Studio web site project (in Web.config or in the Publish Web dialog) has no effect on the connection string in Azure. This caused a problem in my specific situation, but would also be an issue for anyone who does not use the sa-like server-level user for accessing the database from the web site.
The workaround I found for this issue is to directly modify the Connection String in Azure on the web site's Configure page, instead of relying on effectiveness of a change in the Visual Studio project. This resolved the problem and now the named schema is working correctly.

Resources