Posts

Automate Deployments in Azure for Github Repository or TFS (Team Foundation Server)

Image
Automating the deployment saves lot of time in the development process of an application. If you are using Github or TFS repository then you can automate the deployment to Azure. This deployment will be triggered when there is a new check in. Before going into auto deployment please go through my previous article  How to Deploy Asp.net Web Application to Azure using Visual Studio ?. Prerequisites: 1.  Visual Studio Team Service Account.  2. Github or TFS Repository. Steps to Automate Deployment to Azure App Service:   Step #1:   Go to the   portal.azure.com   and login with your credentials. Step #2:   Go to App Services then select "Continuous Delivery" .  Right side you will see "Configure"  button.  Step #3:   Click on Source code and  select GitHub from Code repository. And also make sure that your repository and branches are correct.  If you want to use TFS then...

Deploy Asp.Net Application in Azure and Manage Configurations And Switch from Stating to Production

Image
When we need to deploy an Asp.Net application on online, we need to have a virtual machine and iis installed on that machine. The deployment process will be manual. You need to manage the iis settings and point to the path/folder where your application code exists on that virtual machine. To make this process simple Azure is giving App Services which makes the deployment more simpler and quick. Steps to Deploy Asp.net Code to Azure App Service: Step #1:   Go to the   portal.azure.com   and login with your credentials. Step #2:   Now we need to create an app service. After logging in, on the left side you see different menu items listed. You need to click on App Services.   Then click on Add button to add new App Service.  Step #3:   After clicking on Add we see all the types of App Services in the right side. Select "Asp .net Empty Web App" and then click on create button. Step #4: After clicking on Create button y...

Different ways of Handling Bulk Inserts using C# and SQL Server

Image
 When we need to insert bulk data into sql database through application we have different options to do so. Bulk data can be like 10k records or 100k records or even more. We need to keep the amount of time it takes to insert data as minimal as possible. Otherwise it will hit the performance of the application. The below are the different ways of doing the bulk inserts. 1) SqlBulkCopy (Available from ASP.Net 2.0) 2) Table Valued Parameters (Available from SQL Server 2008+) 3) Short Hand Insert Query Execution time Comparison with 50K Records Insertion: 1) SqlBulkCopy: It is a class which enables you to send bulk data to Sql Server table. You can send the data using DataTable. You can use WriteToServer() method to make a request to sql server for bulkinsert. While the bulk copy operation is in progress, the associated destination SqlConnection is busy serving it, and no other operations can be performed on the connection. Sample Code: In this example I ...