{"id":566,"date":"2015-01-08T14:49:00","date_gmt":"2015-01-08T14:49:00","guid":{"rendered":"https:\/\/staging.infragistics.com\/blogs\/?p=566"},"modified":"2025-02-26T08:50:45","modified_gmt":"2025-02-26T08:50:45","slug":"microsoft-azure-based-mvc-app","status":"publish","type":"post","link":"https:\/\/www.infragistics.com\/blogs\/microsoft-azure-based-mvc-app","title":{"rendered":"How To Create a Microsoft Azure-Based MVC Application"},"content":{"rendered":"\n<p>\u201cCloud\u201d has been a buzz word for a while now. But what does it mean for you as a developer? For starters, you won\u2019t have to write very different code for the cloud than what you\u2019re already writing for in-premise applications.<\/p>\n\n\n\n<p>Let\u2019s assume that you are already familiar with MVC applications. If that\u2019s true, in this post we\u2019ll focus on demonstrating how building for the cloud is not very much different than any other development. We\u2019ll follow a step by step approach and create an end to end MVC application that is hosted completely in the cloud (both data and application).<\/p>\n\n\n\n<h2 class=\"wp-block-heading\" class=\"wp-block-heading\" id=\"setting-up-the-database-in-the-sql-azure\">Setting up the Database in the SQL Azure<\/h2>\n\n\n\n<p>First, we will set up the database in the cloud. We are going to use SQL Azure as the cloud platform, and let\u2019s go ahead and create a School database. To create this in Azure, you have to:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Login to Microsoft Azure portal<\/li>\n\n\n\n<li>From the side tab, select SQL DATABASES options<\/li>\n\n\n\n<li>In the bottom, click on the NEW button<\/li>\n<\/ul>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"439\" height=\"583\" src=\"https:\/\/staging.infragistics.com\/blogs\/wp-content\/uploads\/2015\/01\/image-6.png\" alt=\"From the side tab, select SQL DATABASES options\" class=\"wp-image-2260\" title=\"From the side tab, select SQL DATABASES options\" srcset=\"https:\/\/www.infragistics.com\/blogs\/wp-content\/uploads\/2015\/01\/image-6.png 439w, https:\/\/www.infragistics.com\/blogs\/wp-content\/uploads\/2015\/01\/image-6-226x300.png 226w\" sizes=\"auto, (max-width: 439px) 100vw, 439px\" \/><\/figure>\n\n\n\n<p>From here, you\u2019ll get the option to create a new database. To create one, you need to provide the following information:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Name of the database. Here we\u2019re going to work with the Microsoft-provided School database, so make sure that you give \u201cSchool\u201d as the name of the database.<\/li>\n\n\n\n<li>Choose the Azure subscription in which database will be created.<\/li>\n\n\n\n<li>You can choose either an existing server or create a new database server. To create a new database server, you\u2019ll have to provide information like region, login name and password.<\/li>\n<\/ul>\n\n\n\n<figure class=\"wp-block-image\"><img decoding=\"async\" src=\"\/community\/cfs-filesystemfile.ashx\/__key\/CommunityServer.Blogs.Components.WeblogFiles\/dhananjay_5F00_kumar.Azure\/0143.2.jpg\" alt=\" To create a new database server, you\u2019ll have to provide information like region, login name and password.\" title=\"To create a new database server, you\u2019ll have to provide information like region, login name and password.\"\/><\/figure>\n\n\n\n<p>Once you click on the CREATE SQL DATABASE option, the School database and a new database server will get created. After successful database creation, you need to configure firewall rules for the database server such that you can connect the local development machine to the SQL Azure database server. To configure the firewall rules, click on <b>Set up Windows Azure firewall rules for this IP address<\/b>.<\/p>\n\n\n\n<figure class=\"wp-block-image\"><img decoding=\"async\" src=\"\/community\/cfs-filesystemfile.ashx\/__key\/CommunityServer.Blogs.Components.WeblogFiles\/dhananjay_5F00_kumar.Azure\/8176.3.jpg\" alt=\" Set up Windows Azure firewall rules for this IP address\" title=\"Set up Windows Azure firewall rules for this IP address\"\/><\/figure>\n\n\n\n<p>Here you\u2019ll be prompted with the information that the current IP address is not added in the existing firewall rules. Click on Yes to add that current IP address to the existing firewall rules of the database server.<\/p>\n\n\n\n<figure class=\"wp-block-image\"><img decoding=\"async\" src=\"\/community\/cfs-filesystemfile.ashx\/__key\/CommunityServer.Blogs.Components.WeblogFiles\/dhananjay_5F00_kumar.Azure\/3757.4.jpg\" alt=\" Click on Yes to add that current IP address to the existing firewall rules of the database server.\" title=\"Click on Yes to add that current IP address to the existing firewall rules of the database server.\"\/><\/figure>\n\n\n\n<p>Next we will connect the newly created cloud database from the SQL Server management studio so that we can run scripts to create tables with the data. To do that, you\u2019ll need to launch SSMS and provide the following information:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>The name of the SQL Azure database server. You can find database server name in the portal.<\/li>\n\n\n\n<li>Choose authentication as SQL Server authentication<\/li>\n\n\n\n<li>User name and password<\/li>\n<\/ul>\n\n\n\n<figure class=\"wp-block-image\"><img decoding=\"async\" src=\"\/community\/cfs-filesystemfile.ashx\/__key\/CommunityServer.Blogs.Components.WeblogFiles\/dhananjay_5F00_kumar.Azure\/5430.5.jpg\" alt=\" To do that, you\u2019ll need to launch SSMS and provide the following information\" title=\"To do that, you\u2019ll need to launch SSMS and provide the following information\"\/><\/figure>\n\n\n\n<p>After successful connection to the SQL Azure database server, you will able to view the connection in the SSMS as shown below:<\/p>\n\n\n\n<figure class=\"wp-block-image\"><img decoding=\"async\" src=\"\/community\/cfs-filesystemfile.ashx\/__key\/CommunityServer.Blogs.Components.WeblogFiles\/dhananjay_5F00_kumar.Azure\/5430.6.jpg\" alt=\" After successful connection to the SQL Azure database server, you will able to view the connection in the SSMS as shown below\" title=\"After successful connection to the SQL Azure database server, you will able to view the connection in the SSMS as shown below\"\/><\/figure>\n\n\n\n<p>We are going to use the <a href=\"http:\/\/msdn.microsoft.com\/en-us\/library\/vstudio\/bb399731%28v=vs.100%29.aspx\" rel=\"noopener\">Microsoft-provided School database<\/a> to create the tables and data. We already have the school database created from provided script in the local database server, so next we will have to create the script which can run on the SQL Azure database server. To create this, right click on the database and then select Tasks and then Generate Scripts. &nbsp;In the generate script window, select <b>Script entire database and all database objects<\/b>.<\/p>\n\n\n\n<figure class=\"wp-block-image\"><img decoding=\"async\" src=\"\/community\/cfs-filesystemfile.ashx\/__key\/CommunityServer.Blogs.Components.WeblogFiles\/dhananjay_5F00_kumar.Azure\/6011.7.jpg\" alt=\" In the generate script window, select Script entire database and all database objects.\" title=\"In the generate script window, select Script entire database and all database objects.\"\/><\/figure>\n\n\n\n<p>On the next screen, click on the Advanced option.<\/p>\n\n\n\n<figure class=\"wp-block-image\"><img decoding=\"async\" src=\"\/community\/cfs-filesystemfile.ashx\/__key\/CommunityServer.Blogs.Components.WeblogFiles\/dhananjay_5F00_kumar.Azure\/4341.8.jpg\" alt=\" On the next screen, click on the Advanced option.\" title=\"On the next screen, click on the Advanced option.\"\/><\/figure>\n\n\n\n<p>In Advanced window, change the following values:<\/p>\n\n\n\n<p>Types of data to script: <b>Schema and data<\/b><\/p>\n\n\n\n<p>Script for database engine type:&nbsp; <b>SQL Azure database<\/b><\/p>\n\n\n\n<figure class=\"wp-block-image\"><img decoding=\"async\" src=\"\/community\/cfs-filesystemfile.ashx\/__key\/CommunityServer.Blogs.Components.WeblogFiles\/dhananjay_5F00_kumar.Azure\/7077.9.jpg\" alt=\" Script for database engine type:\u00a0 SQL Azure database\" title=\"Script for database engine type:\u00a0 SQL Azure database\"\/><\/figure>\n\n\n\n<p>Select the option to save to new query window and click on Next. You will find that the generated script is created and opened in the new query window inside the SSMS. &nbsp;Select the SQL Azure database connection and run the script.&nbsp; You will find that tables along with the data has been created in the School database residing on the SQL Azure database server.<\/p>\n\n\n\n<figure class=\"wp-block-image\"><img decoding=\"async\" src=\"\/community\/cfs-filesystemfile.ashx\/__key\/CommunityServer.Blogs.Components.WeblogFiles\/dhananjay_5F00_kumar.Azure\/8561.10.jpg\" alt=\"You will find that tables along with the data has been created in the School database residing on the SQL Azure database server.\" title=\"You will find that tables along with the data has been created in the School database residing on the SQL Azure database server.\"\/><\/figure>\n\n\n\n<p>We have created the School database which is in the cloud. In the next section, we will use the cloud database to create a MVC application.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\" class=\"wp-block-heading\" id=\"creating-the-mvc-application\">Creating the MVC Application<\/h2>\n\n\n\n<p>In this section we will create and set up the MVC application to be published in the Azure Web Site. You can do so by choosing MVC template.<\/p>\n\n\n\n<figure class=\"wp-block-image\"><img decoding=\"async\" src=\"\/community\/cfs-filesystemfile.ashx\/__key\/CommunityServer.Blogs.Components.WeblogFiles\/dhananjay_5F00_kumar.Azure\/6320.11.jpg\" alt=\" In this section we will create and set up the MVC application to be published in the Azure Web Site. You can do so by choosing MVC template.\" title=\"In this section we will create and set up the MVC application to be published in the Azure Web Site. You can do so by choosing MVC template.\"\/><\/figure>\n\n\n\n<p>We don\u2019t want any authentication for this application. To configure this click on the <b>Change Authentication<\/b> option, and in the dialog box select No Authentication as shown below:<\/p>\n\n\n\n<figure class=\"wp-block-image\"><img decoding=\"async\" src=\"\/community\/cfs-filesystemfile.ashx\/__key\/CommunityServer.Blogs.Components.WeblogFiles\/dhananjay_5F00_kumar.Azure\/6087.12.jpg\" alt=\" To configure this click on the Change Authentication option, and in the dialog box select No Authentication as shown\" title=\"To configure this click on the Change Authentication option, and in the dialog box select No Authentication as shown\"\/><\/figure>\n\n\n\n<p>We want to host the application in the cloud. To be precise, the application will be hosted in the Azure Web Site. To configure that, select the <b>Host in the cloud<\/b> check box, and from the drop down, choose Web Site.<\/p>\n\n\n\n<figure class=\"wp-block-image\"><img decoding=\"async\" src=\"\/community\/cfs-filesystemfile.ashx\/__key\/CommunityServer.Blogs.Components.WeblogFiles\/dhananjay_5F00_kumar.Azure\/4846.13.jpg\" alt=\" select the Host in the cloud check box, and from the drop down, choose Web Site.\" title=\"select the Host in the cloud check box, and from the drop down, choose Web Site.\"\/><\/figure>\n\n\n\n<p>Next you will be asked to authenticate your account.&nbsp; Authenticate yourself by providing the user name and the password.<\/p>\n\n\n\n<figure class=\"wp-block-image\"><img decoding=\"async\" src=\"\/community\/cfs-filesystemfile.ashx\/__key\/CommunityServer.Blogs.Components.WeblogFiles\/dhananjay_5F00_kumar.Azure\/0537.14.jpg\" alt=\" Authenticate yourself by providing the user name and the password.\" title=\"Authenticate yourself by providing the user name and the password.\"\/><\/figure>\n\n\n\n<p>On the next screen you need to configure:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>A site name. This name will be used as URL to access the application when hosted in the azure server.<\/li>\n\n\n\n<li>Region: the Azure server region in which the application will be hosted.<\/li>\n\n\n\n<li>A database server. In this example we\u2019ll select the same database server in which the School database resides.<\/li>\n\n\n\n<li>A password to connect to the database server.<\/li>\n<\/ul>\n\n\n\n<figure class=\"wp-block-image\"><img decoding=\"async\" src=\"\/community\/cfs-filesystemfile.ashx\/__key\/CommunityServer.Blogs.Components.WeblogFiles\/dhananjay_5F00_kumar.Azure\/5736.15.jpg\" alt=\" In this example we\u2019ll select the same database server in which the School database resides.\" title=\"In this example we\u2019ll select the same database server in which the School database resides.\"\/><\/figure>\n\n\n\n<p>After successful authentication with the Azure service and the database server, you will see a message in Visual Studio that the application is ready.<\/p>\n\n\n\n<figure class=\"wp-block-image\"><img decoding=\"async\" src=\"\/community\/cfs-filesystemfile.ashx\/__key\/CommunityServer.Blogs.Components.WeblogFiles\/dhananjay_5F00_kumar.Azure\/4834.16.jpg\" alt=\" After successful authentication with the Azure service and the database server, you will see a message in Visual Studio that the application is ready.\" title=\"After successful authentication with the Azure service and the database server, you will see a message in Visual Studio that the application is ready.\"\/><\/figure>\n\n\n\n<h2 class=\"wp-block-heading\" class=\"wp-block-heading\" id=\"building-the-application\">Building the Application<\/h2>\n\n\n\n<p>As of now we have set up the database and created the MVC application to be hosted in the Azure web site. Now let\u2019s go ahead and build the application.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">Adding the data model<\/h3>\n\n\n\n<p>We will start with creating the data model using the School database hosted in the SQL Azure. We will use ADO.NET Entity Data Model to create the model. To create the model in the MVC project, create a folder named <b>Infrastructure<\/b>. Right click on the infrastructure folder, and select <b>Add New Item<\/b>. In the Add New Item dialog box, select <b>ADO.NET Entity Data Model <\/b>from the Data tab and name it <b>SchoolModel<\/b>.<\/p>\n\n\n\n<figure class=\"wp-block-image\"><img decoding=\"async\" src=\"\/community\/cfs-filesystemfile.ashx\/__key\/CommunityServer.Blogs.Components.WeblogFiles\/dhananjay_5F00_kumar.Azure\/0636.17.jpg\" alt=\" Add New Item dialog box, select ADO.NET Entity Data Model from the Data tab and name it SchoolModel.\" title=\"Add New Item dialog box, select ADO.NET Entity Data Model from the Data tab and name it SchoolModel.\"\/><\/figure>\n\n\n\n<p>On the next screen, select the EF designer from database option.<\/p>\n\n\n\n<figure class=\"wp-block-image\"><img decoding=\"async\" src=\"\/community\/cfs-filesystemfile.ashx\/__key\/CommunityServer.Blogs.Components.WeblogFiles\/dhananjay_5F00_kumar.Azure\/1207.18.jpg\" alt=\" On the next screen, select the EF designer from database option.\" title=\"On the next screen, select the EF designer from database option.\"\/><\/figure>\n\n\n\n<p>Click on New Connection, and in the new connection dialog box, provide the following information:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>SQL Azure data base server name. We created this server in the previous section<\/li>\n\n\n\n<li>Select SQL Server Authentication option<\/li>\n\n\n\n<li>Provide the SQL Azure database server user name and the password<\/li>\n\n\n\n<li>Select the School database from the drop down<\/li>\n<\/ul>\n\n\n\n<figure class=\"wp-block-image\"><img decoding=\"async\" src=\"\/community\/cfs-filesystemfile.ashx\/__key\/CommunityServer.Blogs.Components.WeblogFiles\/dhananjay_5F00_kumar.Azure\/1614.19.jpg\" alt=\" Click on New Connection, and in the new connection dialog box, provide the following information\" title=\"Click on New Connection, and in the new connection dialog box, provide the following information\"\/><\/figure>\n\n\n\n<p>In the next dialog box, select the Yes option, include the sensitive data in the Connection string, and leave the default name for the connection string.<\/p>\n\n\n\n<figure class=\"wp-block-image\"><img decoding=\"async\" src=\"\/community\/cfs-filesystemfile.ashx\/__key\/CommunityServer.Blogs.Components.WeblogFiles\/dhananjay_5F00_kumar.Azure\/3757.20.jpg\" alt=\" Yes option, include the sensitive data in the Connection string, and leave the default name for the connection string.\" title=\"Yes option, include the sensitive data in the Connection string, and leave the default name for the connection string.\"\/><\/figure>\n\n\n\n<p>We are going to work with the <b>Person<\/b> table. So click on the Person check box and leave the other checkboxes to default.<\/p>\n\n\n\n<figure class=\"wp-block-image\"><img decoding=\"async\" src=\"\/community\/cfs-filesystemfile.ashx\/__key\/CommunityServer.Blogs.Components.WeblogFiles\/dhananjay_5F00_kumar.Azure\/0121.21.jpg\" alt=\" So click on the Person check box and leave the other checkboxes to default.\" title=\"So click on the Person check box and leave the other checkboxes to default.\"\/><\/figure>\n\n\n\n<p>By clicking on <b>Finish<\/b>, the data model will be created as shown below:<\/p>\n\n\n\n<figure class=\"wp-block-image\"><img decoding=\"async\" src=\"\/community\/cfs-filesystemfile.ashx\/__key\/CommunityServer.Blogs.Components.WeblogFiles\/dhananjay_5F00_kumar.Azure\/1220.22.jpg\" alt=\" By clicking on Finish, the data model will be created as shown\" title=\"By clicking on Finish, the data model will be created as shown\"\/><\/figure>\n\n\n\n<p>We have successfully created and added a data model in the MVC application. Keep in mind that SchoolModel is now connected to the cloud database in the SQL Azure.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">Adding Controller with read and write operation<\/h3>\n\n\n\n<p>Next we\u2019ll add a controller with views, using the Entity framework. We will use MVC scaffolding to create views to perform CRUD operations on the Person table. To add a controller, right click on the Controller folder and select <b>MVC 5 Controller with views, using Entity Framework<\/b> option as shown below:<\/p>\n\n\n\n<figure class=\"wp-block-image\"><img decoding=\"async\" src=\"\/community\/cfs-filesystemfile.ashx\/__key\/CommunityServer.Blogs.Components.WeblogFiles\/dhananjay_5F00_kumar.Azure\/2287.23.jpg\" alt=\" MVC 5 Controller with views, using Entity Framework\" title=\"MVC 5 Controller with views, using Entity Framework\"\/><\/figure>\n\n\n\n<p>In the next dialog box, we need to choose the model and the context class. Here we will choose Person as the model class and SchoolEntities as the DataContext class. To create the views corrosponding to the database operation, make sure that the other check boxes are checked.<\/p>\n\n\n\n<figure class=\"wp-block-image\"><img decoding=\"async\" src=\"\/community\/cfs-filesystemfile.ashx\/__key\/CommunityServer.Blogs.Components.WeblogFiles\/dhananjay_5F00_kumar.Azure\/6087.24.jpg\" alt=\" To create the views corrosponding to the database operation, make sure that the other check boxes are checked.\" title=\"To create the views corrosponding to the database operation, make sure that the other check boxes are checked.\"\/><\/figure>\n\n\n\n<p>With this step, we have created the controller and views for the CRUD operations on the person table. In the solution explorer, you should have the following files:<\/p>\n\n\n\n<figure class=\"wp-block-image\"><img decoding=\"async\" src=\"\/community\/cfs-filesystemfile.ashx\/__key\/CommunityServer.Blogs.Components.WeblogFiles\/dhananjay_5F00_kumar.Azure\/0121.25.jpg\" alt=\"for the CRUD operations on the person table. In the solution explorer, you should have the following files \" title=\"for the CRUD operations on the person table. In the solution explorer, you should have the following files\"\/><\/figure>\n\n\n\n<p>At this point, if you go ahead and run the application, you will get data from the person table which resides in the SQL Azure is listed. You can also create new data, edit and delete data.<\/p>\n\n\n\n<figure class=\"wp-block-image\"><img decoding=\"async\" src=\"\/community\/cfs-filesystemfile.ashx\/__key\/CommunityServer.Blogs.Components.WeblogFiles\/dhananjay_5F00_kumar.Azure\/0121.26.jpg\" alt=\"  You can also create new data, edit and delete data.\" title=\" You can also create new data, edit and delete data.\"\/><\/figure>\n\n\n\n<h2 class=\"wp-block-heading\" class=\"wp-block-heading\" id=\"making-your-application-more-immersive\">Making Your Application More Immersive<\/h2>\n\n\n\n<p>In this example, we don\u2019t need Home, About and Contact View. Also, let\u2019s say we want a list of people on the base URL of the application.<\/p>\n\n\n\n<p>Let us start by removing the Home controller and deleting the Home subfolder in the View folder and in the layout.cshtml file comment the div with the class <b>navbar-header<\/b>. Once the home controller and view is deleted, next open <b>RouteConfig.cs<\/b> from <b>App_Start<\/b> folder and change the default controller to School in the route as shown below:<\/p>\n\n\n\n<figure class=\"wp-block-image\"><img decoding=\"async\" src=\"\/community\/cfs-filesystemfile.ashx\/__key\/CommunityServer.Blogs.Components.WeblogFiles\/dhananjay_5F00_kumar.Azure\/7870.27.jpg\" alt=\" next open RouteConfig.cs from App_Start folder and change the default controller to School in the route as shown below\" title=\"next open RouteConfig.cs from App_Start folder and change the default controller to School in the route as shown below\"\/><\/figure>\n\n\n\n<p>We are now done with creating the application. Press F5 to run and test the application locally. You should able to see the application running as shown below:<\/p>\n\n\n\n<figure class=\"wp-block-image\"><img decoding=\"async\" src=\"\/community\/cfs-filesystemfile.ashx\/__key\/CommunityServer.Blogs.Components.WeblogFiles\/dhananjay_5F00_kumar.Azure\/8176.28.jpg\" alt=\" Press F5 to run and test the application locally. You should able to see the application running as shown\" title=\"Press F5 to run and test the application locally. You should able to see the application running as shown\"\/><\/figure>\n\n\n\n<h2 class=\"wp-block-heading\" class=\"wp-block-heading\" id=\"publishing-the-application\">Publishing the Application<\/h2>\n\n\n\n<p>To publish the app, right click on the project and click on publish. In the connection dialog box, validate the values and click on next.<\/p>\n\n\n\n<figure class=\"wp-block-image\"><img decoding=\"async\" src=\"\/community\/cfs-filesystemfile.ashx\/__key\/CommunityServer.Blogs.Components.WeblogFiles\/dhananjay_5F00_kumar.Azure\/2768.29.jpg\" alt=\" In the connection dialog box, validate the values and click on next.\" title=\"In the connection dialog box, validate the values and click on next.\"\/><\/figure>\n\n\n\n<p>In the settings dialog box, for the database, select the SchoolEntities connection string and click on next.<\/p>\n\n\n\n<figure class=\"wp-block-image\"><img decoding=\"async\" src=\"\/community\/cfs-filesystemfile.ashx\/__key\/CommunityServer.Blogs.Components.WeblogFiles\/dhananjay_5F00_kumar.Azure\/0121.30.jpg\" alt=\" In the settings dialog box, for the database, select the SchoolEntities connection string and click on next.\" title=\"In the settings dialog box, for the database, select the SchoolEntities connection string and click on next.\"\/><\/figure>\n\n\n\n<p>Finally, click on <b>publish<\/b> to publish the application in the Azure web site.<\/p>\n\n\n\n<figure class=\"wp-block-image\"><img decoding=\"async\" src=\"\/community\/cfs-filesystemfile.ashx\/__key\/CommunityServer.Blogs.Components.WeblogFiles\/dhananjay_5F00_kumar.Azure\/4331.31.jpg\" alt=\"Finally, click on publish to publish the application in the Azure web site.\" title=\"Finally, click on publish to publish the application in the Azure web site.\"\/><\/figure>\n\n\n\n<p>If you run into any errors, you can open the management portal and for the database server verify that Windows Azure Services option is set to yes or not in the Allowed Services. It should be set to <b>Yes<\/b> as shown below:<\/p>\n\n\n\n<figure class=\"wp-block-image\"><img decoding=\"async\" src=\"\/community\/cfs-filesystemfile.ashx\/__key\/CommunityServer.Blogs.Components.WeblogFiles\/dhananjay_5F00_kumar.Azure\/5736.32.jpg\" alt=\" It should be set to Yes as shown\" title=\"It should be set to Yes as shown\"\/><\/figure>\n\n\n\n<h2 class=\"wp-block-heading\" class=\"wp-block-heading\" id=\"conclusion\">Conclusion<\/h2>\n\n\n\n<p>Now you should be able to perform CRUD operation from MVC application hosted in Azure web site and accessing the database hosted in SQL Azure. In this post we learned about:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Creating database in the SQL Azure<\/li>\n\n\n\n<li>Migrating data from local database server to the SQL Azure database server<\/li>\n\n\n\n<li>Using data from cloud in a MVC application using the entity framework<\/li>\n\n\n\n<li>Host MVC application in the Azure web site<\/li>\n\n\n\n<li>Publish the application to Azure web site.<\/li>\n<\/ul>\n\n\n\n<p>Hopefully you found this article is useful \u2013 thanks for reading and happy coding!<\/p>\n\n\n\n<figure class=\"wp-block-image\"><a href=\"\/products\/ultimate\" target=\"_blank\" rel=\"noopener noreferrer\"><img decoding=\"async\" src=\"\/community\/cfs-filesystemfile.ashx\/__key\/CommunityServer.Blogs.Components.WeblogFiles\/dhananjay_5F00_kumar\/5415.8321.650x80_2D00_ultimate.png\" alt=\" \"\/><\/a><\/figure>\n\n\n\n<p><\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u201cCloud\u201d has been a buzz word for a while now. But what does it mean for you as a developer? For starters, you won\u2019t have to write very different code for the cloud than what you\u2019re already writing for in-premise applications.<\/p>\n","protected":false},"author":65,"featured_media":2368,"comment_status":"publish","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[17],"tags":[],"class_list":["post-566","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-how-to"],"_links":{"self":[{"href":"https:\/\/www.infragistics.com\/blogs\/wp-json\/wp\/v2\/posts\/566","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.infragistics.com\/blogs\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.infragistics.com\/blogs\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.infragistics.com\/blogs\/wp-json\/wp\/v2\/users\/65"}],"replies":[{"embeddable":true,"href":"https:\/\/www.infragistics.com\/blogs\/wp-json\/wp\/v2\/comments?post=566"}],"version-history":[{"count":4,"href":"https:\/\/www.infragistics.com\/blogs\/wp-json\/wp\/v2\/posts\/566\/revisions"}],"predecessor-version":[{"id":2433,"href":"https:\/\/www.infragistics.com\/blogs\/wp-json\/wp\/v2\/posts\/566\/revisions\/2433"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.infragistics.com\/blogs\/wp-json\/wp\/v2\/media\/2368"}],"wp:attachment":[{"href":"https:\/\/www.infragistics.com\/blogs\/wp-json\/wp\/v2\/media?parent=566"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.infragistics.com\/blogs\/wp-json\/wp\/v2\/categories?post=566"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.infragistics.com\/blogs\/wp-json\/wp\/v2\/tags?post=566"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}