I just had an issue with a deployed ASP.NET app on Azure: I changed the connection string in the deployed web.config using the new App Service Editor in the Azure Portal, but the changes had no effect in my application!
This answer from StackOverflow gave me the hint I needed: My connection string was being overridden by an Application Setting in the Azure App Service. I didn’t even know that it was configured.
To see if you have a connection string defined in your Azure App service log into the Azure Portal, open your App Service and go to Settings -> Application Settings -> Connection strings.
Delete the connection string in the Azure application settings. Now you can change the connection string in the web.config using the App Service Editor, for example.
Use the Azure application settings to manage your connection strings. The values defined here will always override the connection strings from your web.config.
If you just published your web app to Azure with Visual Studio you probably won’t have a FTP account configured in your App Service. I just want to share how to set it up to enable downloading logs via FTP.
If you go to “MONITORING-> Diagnostics logs” in your App Service you should see the text “No FTP/deployment user set” in the field FTP/deployment username:
Use the page “DEPLOYMENT -> Deployment credentials” to set up a new FTP user:
If you go back to “Diagnostics logs” you will see the FTP/deployment username you can use to access the logs with the FTP client of your choice (On Windows I like to use WinSCP):
Important: You have to use the full FTP username shown on the “Diagnostics logs” page consisting of the App Service name, a backslash followed by the FTP username:
Hint: Try to avoid FTP and use FTPS instead to protect your credentials and data.
A video tutorial based on my learnings of ASP.NET MVC 5, ASP.NET Identity, SQL Server and Azure.
Summary: I will show you how to create a very simple web application with user authentication. Users can register, log in, create diary entries (text) and visualize their entries.
In part one we will create, test and refactor the application locally on our computer. Although the app is very simple we will touch a lot of different technologies. You will also see some issues you may experience when starting with ASP.NET MVC in Visual Studio and how to fix them.
In part two we will publish our app to the cloud (Azure). Please subscribe to get notified when part two is finished.
ASP.NET Identity ApplicationUser and ApplicationDbContext overview
ASP.NET Identity tables
Extend DiaryEntry model class for usage in DbContext
Create foreign key property and navigation properties (Entity Framework)
Add new DiaryEntry table to DbContext
Create new model class from viewmodel
Use Entity Framework to insert into DiaryEntries table
Show result of data-model change: “Server Error in Application. The model backing the ‘ApplicationDbContext” context has changed since the database was created. Consider using Code First Migrations to update the database”