In this article we will see the step by step process to move JIRA from on-premises or virtual machine to Microsoft Azure VM.

  1. Backup from the existing installation
  2. Provision Azure VM (if you don’t have already)
  3. Install JIRA on Azure VM but don’t run it
  4. Restore JIRA home folder
  5. Create new database
  6. Run JIRA
  7. Restore database

1. Backup from the existing installation

First take the database backup, login as administrator, go to System menu and click on Import & Export , enter File name, database will be export as xml back (normally it will be exported to C:\Program Files\Atlassian\Application Data\JIRA\export).

Now copy the JIRA home folder ( which is normally at this location C:\Program Files (x86)\Atlassian\Application Data\JIRA ) to Azure VM. read more

More and more companies are using cloud infrastructure to host their applications and databases. In this article we will discuss the high level steps to move on-premises SQL Server database to Azure SQL database using Microsoft SQL Server Management Studio:

  1. Download and install the latest version of Microsoft SQL Server Management Studio, old version can give unexpected errors as now Azure SQL databases have almost same set of features as on-premises databases can have.
  2. Right click on the database to deploy to Azure, click on Tasks and Deploy Database to Microsoft Azure SQL Database.
  3. Follow the wizard, enter deployment settings (you must have an Azure subscription), click next, verify the details and submit the migration process.

 

(adsbygoogle = window.adsbygoogle || []).push({});

There are some other ways as well to migrate the database to Azure but we found this very intuitive.

Hope it will help you in your next migration.

Comments read more

ASP.NET SignalR is a library for ASP.NET developers that simplifies the process of adding real-time web functionality to applications. Real-time web functionality is the ability to have server code push content to connected clients instantly as it becomes available, rather than having the server wait for a client to request new data – Microsoft

Normally server sends notifications to clients when communication is initiated by some client but there are situations when we want server to push data to clients even there is no request from any clients.
Here is step by step procedure to do so.

[the_ad id=”181″]

Step 1
Add hub class, right click (on the App_Code in case of website project or appropriate folder in case of web application project), select Add and then Add New Item. Select the SignalR Hub Class template, give it a name say BroadcasterHub and click Add.
Your class should look like below:

using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using Microsoft.AspNet.SignalR;
using Microsoft.AspNet.SignalR.Hubs;
[HubName("mainBroadcasterHub")]
public class BroadcasterHub : Hub
{
private readonly Broadcaster _broadcaster;
public BroadcasterHub() : this(Broadcaster.Instance) { }

public BroadcasterHub(Broadcaster broadcaster)
{
_broadcaster = broadcaster;
}
}
read more

You can create the user in Microsoft SQL Server & Microsoft Azure SQL Database using the following code.

  1. Connect to master database and execute the following script:

    CREATE LOGIN UserNameHere WITH password='Password here';
    CREATE USER UserNameHere FROM LOGIN UserNameHere;
    
  2. Then connect to the desired database and execute the following script:

    CREATE USER UserNameHere FROM LOGIN UserNameHere ;
    EXEC sp_addrolemember 'db_datareader', 'UserNameHere';
    

We have added newly created user to data reader role, you can add user to whatever roles you want.
Comments
#wpdevar_comment_4 span,#wpdevar_comment_4 iframe{width:100% !important;}

Sometime we need to do undo checkout from other user’s workspace in Team Foundation Server (TFS). Here is the procedure to do it using Visual Studio’s Command Prompt.
Open the Visual Studio Command Prompt and type the following command:

tf undo /workspace:"WorkspaceName;WorkspaceOwnerName" $/Project/SomeFile.aspx 

Replace the workspace and workspace owner’s name and also path of the file to undo checkout.

You must have “Undo other users’ changes” permission to perform this. When you will execute this command it might prompt for your TFS credentials (if those were not saved/remembered).

Tip: You can use the above command to undo checkout a file from your own workspace.

Tip: To get the workspace and owner names and file path, try to check out the same file in Visual Studio it will provide this information in output window, copy from there and replace in the above command and execute it.

Tip: You can undo check out all the files in project or specific directory by add /recursive parameter in the command, please see the example below:
Example 1

tf undo /workspace:"WorkspaceName;WorkspaceOwnerName" $/Project /recursive

Example 2

tf undo /workspace:"WorkspaceName;WorkspaceOwnerName" $/Project/SomeDirectory /recursive

Note: “WorkspaceName;WorkspaceOwnerName” is given it quotation marks, most of the documentation and tutorials don’t mention it but your command couldn’t be executed successfully if you don’t wrap it in quotation marks.

Comments
#wpdevar_comment_6 span,#wpdevar_comment_6 iframe{width:100% !important;}

Recently we were in a situation where we need to merge data from our offline version of application with online database.
We planned to use uniqueidentifier as data type for ID columns instead of int (auto identity).

But when we looked at reviews a lot of people were against this idea, they said if we use uniqueidentifier column as primary key (and clustered index) then there will be lot of fragmentation in our database, also the extra size of key.

Some people suggested that use the int type (auto identity) as primary key and add another column of uniqueidentifier type for this purpose. We decided to go with this idea and added a uniqueidentifier column in each table.

We don’t see any issue in this design right now and hopefully it will work for long term.

Comments
#wpdevar_comment_7 span,#wpdevar_comment_7 iframe{width:100% !important;}

Hosting providers unload your application after certain amount of time if the application is idle. Microsoft Azure provide Always ON option (with some extra cost) to keep the application always running. You can enable these settings from Azure Portal as show below:

However there is an issue if your application is running on HTTPS and you have rewrite rules to redirect HTTP traffic to HTTPS then Always ON settings in Azure will not work.

You can fix it in many ways, here is one of them. Add the following rewrite rule in your web.config, it should be first rule (if you have other rules in web.config):

<system.webServer>   
    <rewrite>
      <rules>
        <rule name="Top Rules" enabled="true" stopProcessing="true">
          <!-- Please always keep this rule on the top of list -->
          <match url=".*" />
          <conditions logicalGrouping="MatchAny">
            <add input="{HTTP_USER_AGENT}" pattern="Initialization" ignoreCase="true"/>
            <add input="{HTTP_USER_AGENT}" pattern="AppInit" 		ignoreCase="true" />
            <add input="{HTTP_USER_AGENT}" pattern="WarmUp" 		ignoreCase="true"/>
            <add input="{HTTP_USER_AGENT}" pattern="AlwaysOn" 		ignoreCase="true"/>
          </conditions>
          <action type="Rewrite" url="{URL}" />
        </rule>
 
      </rules>
    </rewrite>
  </system.webServer>

Comments
#wpdevar_comment_8 span,#wpdevar_comment_8 iframe{width:100% !important;}

DateTime.Now returns the time by taking into account server’s time zone on which application is hosted. As Azure web apps has time zone set to UTC even its location is somewhere else say in central US.

When we try to access the server’s time using DateTime.Now, it returns UTC time.

You can fix this issue by adding the following application settings using Azure Portal:
Key: WEBSITE_TIME_ZONE
Value: Time zone of the application where it is hosted in Azure say Central Standard Time

You can get the name of time zones from here

It will save you from modifying your code base, you just have to set this key in one place.
Comments
#wpdevar_comment_9 span,#wpdevar_comment_9 iframe{width:100% !important;}

In this article we will see how to take Microsoft SQL Server database backup to Azure storage. At high level, we have to do the following to achieve this:

  1. Create storage account in Microsoft Azure
  2. Create container in Azure storage account
  3. Create SQL Server credential using information from Microsoft Azure storage account
  4. Taking backup using Microsoft SQL Server Management Studio
  5. Taking backup using SQL code

1. Create storage account in Microsoft Azure

Login to Azure Portal. Create a storage account. To add a storage account, click on the Storage accounts on left and then click on +Add option on top.

It will show the following options, fill in all the details but remember to select General purpose under Account kind, it is circled in the image, otherwise it will give error while taking backup.

2. Create container in Azure storage account

Once storage account is created, we need to create a Container which will keep the database backup files. To add a container, click on Storage accounts, all the storage accounts in your Azure account will be shown. Click on the newly created storage account to open its properties. Click on Containers then on +Container, give the name and click OK as shown in the image below:

3. Create SQL Server credential using information from Microsoft Azure storage account read more