Using Azure SQL for asp.net - asp.net

I've designed a website in Visual Studio and I'm starting on the database aspect of the site now. I'm using Azure to host the site at the moment and I was wondering is it best to create the database on Azure and then connect it to asp.net or design it in Visual Studio and then connect to Azure so I can store it there?
I also run the website locally a lot when I am testing it for design purposes so would building it in Azure affect this?
Im also using visual studio ultimate 2013 but its a pre release version and I can't use the azure sdk with it. Will it work on the full version of 2013?

Azure SQL Database at its core is essentially compatible with standard SQL Server. There is a published guide on what the limitations are (http://msdn.microsoft.com/en-us/library/windowsazure/ee336245.aspx) that you should understand first but I'd recommend that you work locally and then push your changes to Azure SQL Database. Note that like any changes to schemas / databases in SQL Server you'll still need to manage those transitions appropriately as part of your deployment process. HTH.

Related

Migrating ASp.net webform based websites to Microsoft Azure

I have to migrate asp.net webform & asp.net MVC websites to Microsoft Azure and most of the webform based website have been created as "website project" in visual studio. and all website use MS SQL Server 2008 R2 as database plus all website use either .net Framework 4.0/4.5.
I confused by reading article regarding migrating webform based website to Azure not working and need code changes and if we use Azure database then we cant use stored procedures etc... this has confused me alot.
So i have few question regarding this.
Can i move asp.net webform 4.0 based website directly to Azure without making any code changes assuming we are connecting to external SQL SERVER 2008.
For first step can which MS SQL Server database i need to choose on Azure so that i can easily restore database in Azure and connect to this database from my local machine using MS Management Studio..
I have heard lot about Azure store files as blob and we need to make change to code to point to new path. What is this Azure blob and why do we need to change code for pointing them blob.
What i have to do keep allowing users from uploading images & document without making any changes in the code..
Does Azure website have always 1 instance running or multiple instance running, i am asking this as our website use InProc session state will i lose session if it is ruuning on multiple instance. or should we prefer SQL Session state in Azure enviroment.
What i should take into consideration for migration current website to Azure.
Will copy pasting all the files in Azure work. Please advise
Depending on how old the ASP.NET webforms projects are, you are going to need to bring them up to date with current security, and anti forgery tokens, etc.
Also if the project was previously a "Website" and not a "Web Application", this is also something that you will need to take into consideration!
I am currently working on upgrading a website to a web application.
This might be a useful website to look through
http://www.gregthatcher.com/Azure/Ch7_ConvertWebsiteToWebApplication.aspx
Migrating to Azure is easy ,
create a Azure account and create the web app which you want to host or create.
you can deploy using FTP or use the build and deploy feature in TFS account.
Steps
You need to create web app in your account.
create a DB in azure manually or export your DB to azure from Management studio if you have an existing DB
get the Connection string from the Publish profile from Azure.
Setup the storage account if you want to store files ,images etc.

deploying VISUAL STUDIO 2010 web application to azure cloud services

I have a Web application in Visual Studio 2010 in 4.0 Framework.I want to deploy this app to azure cloud services.The application contains a local sql database as well as session variables.Can anyone please guide me on the steps to follow regarding the same.Do I have to create another database or the local database will do?
You can use a local database for an Azure web application.
However, as mentioned in this article, if you want to reduce the impact that latency will have on your application, you should use an Azure SQL Database.
If you need to migrate your local database to an Azure SQL Database you can look at some of Azure SQL's migration options.
Hope this helps!

Code First Migrations, Database Projects, and SQL Azure

We are in the process of developing a new site that we plan to host on Azure. None of us have done this before, so it has raised some interesting challenges.
First, we are using code first and using migrations to update the database. We were having some issues figuring out how to deploy the database to Azure, so we ended up creating a database project.
There are a bunch of Azure specific issues with deployment, and you will get errors if you don't rectify all the valid SQL that Azure doesn't allow you to use.
It seemed to me that you should be able to do code first on the azure site just like we did on the local site, and I found This article that seems to address the issue.
What I am wondering though, is best practices.
I would assume we don't need database projects anymore, but I am not
sure about that. What is the best practice for managing databases
with Visual Studio 2013 and code first.
The approach in the article above seems fine for a system in
pre-production, but once a system is in production and has live
data, is this a recommended approach?
How do you protect yourself from mistakes like somebody accidentally changing a
setting that tells Visual Studio to recreate the database?
Any thoughts or ideas would be appreciated.
First i would like to state from my understanding, when using Entity Framework and you have Enabled Migration, it's only meant for development and it is recommended that you set it to false when deploying your code.
As for deploying to Microsoft Azure, i have only done this using Visual Studio Team Services. The thing about Code-First is that you have no Sql Queries and the database is not deployed right away. So here is what i have done in the past,
Create a blank Sql Query in SQL Management Studio
In Visual Studio Server Explorer expand your database for the
project to table level
Right click on each table and select "Show Table Definition" I wish
we could do this at Database level.
Copy and past the T-SQL to a blank Sql file in SQL Management
Studio. Note that all table queries can fit in one
file, just have to follow T-SQL rules. Connect to your Azure
Database Instance using SQL Management Studio.
Run the SQL Query against the database on Azure. Note that the
sample data you had used in developemnt will not be on your Azure
database at this moment, you will have to create an insert T-SQL and
run it against the Azure database.
Also make sure that your app has the right connection string when deploying to Microsoft Azure and it should connect to you database just fine.

SQL server express backend for ASP.NET web service

I come from a linux/apache/php/mysql background. For my current project, I am forced to write web services using ASP.NET. I have installed visual studio and created an ASP.NET web service project. The web service I'm creating will use a SQL database backend. I see that visual studio installed "SQL Server Express 2008." I can see that there is a service called "SQL Server (SQLEXPRESS)" that is running. My question is, how do I run queries against this database? Where's the front end? What tool do I use to create databases and tables? Is there something else I have to install?
I feel completely lost and my google-fu fails me. There are so many different SQL products from microsoft that I can't tell what is the easiest path to just having a simple database with tables I can query from my development machine. With MySQL, I would install the MySQL database, download MySQL query browser and start firing queries at it. How can I do that with Visual Studio/SQL Server Express?
You can download SQL Server Management Studio from here. This is the GUI for working with SQL Server. It will let you create databases, tables, stored procedures, etc. as well as writing queries and manually edit data in the tables.
Aside from SQL Server Management Studio, you can use the Server Explorer tab in Visual Studio (by default on the right side, next to Solution Explorer) to add a data connection. You can do most of the most common database tasks (create/query tables, create views, etc) from there.
there's a command line tool that installs with SQL Server (all versions) called SQLCMD.exe, should be in your install path.
Visual Studio also lets you create dbs, run queries, look at table structures and data (including creating and deleting them, etc), you do that by opening your Server explorer window and making a connection to your local instance (.\SQLExpress by default).
Finally, as the other person mentioned, SQL Server Management Studio Express is a free download, and well worth the time it takes to install.

How do I create my first database for .NET development?

Ok! I'm ready to embark on some .NET development for the first time.
I've recently installed Microsoft Visual Studio which included Microsoft SQL Sever 2005.
What is the prefered method for programming against a development database? I want to write an ASP.NET application that uses a database and I'm not sure how to create one. In my start menu for SQL Server 2005 all I have is:
SQL Server Configuration Manager
SQL Server Error and Usage Reports
SQL Server Surface Area Config
I don't see an intuitive program to create and design databases on that list, so how do I do it?! Will I be creating a full fledged SQL Server database or a "flat-file" fake database to program against?
Can someone please tell me what is up on creating my first MS SQL Server 2005 database?
If you've Visual Studio, just goto server explorer, Add a new database connection to your database, and start off.
Or, create a new website project in Visual studio, right click the App_Data folder->Add New Item and add a SQL Server database mdf file, which will be attached to the sql server when you run the app. You need to deploy the mdf file when doing a production release :)
You might want to watch the videos in ASP.NET website http://www.asp.net/learn/
Otherwise, consider using Microsoft SQL Server Management Studio (an express edition is also available).
You are looking for Microsoft SQL Server Management Studio Express. Its pretty easy to add a database once you get your head around it.
To be clear, the SQL Server included with Visual Studio is an express edition. However, the one thing it is lacking is the SQL Server Management Studio (Express). I'd download and install the express edition that included the management studio (note that VS 2005 and 2008 include SQL Express 2005, you can use either SQL Express 2005 or 2008 for your purposes).
You can create a new database and do everything you need to from within the VS IDE but you'll probably find the SQL Management Studio environment much more intuitive and simpler to use as a beginner.
A quick note on SQL Express - Microsoft doesn't suggest it for 'production' environments due to limitations placed on the amount of RAM that Express can see/use and a few other factors. This is one of the few cases in which I agree - if you're doing anything complex that involves large databases or dozens of users then invest in MSSQL Workgroup Edition at least, or for Enterprise projects use MSSQL Standard or Enterprise versions.

Resources