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

  • Connect to master database and execute the following script:

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

    CREATE USER UserNameHere FROM LOGIN UserNameHere ;
    EXEC sp_addrolemember 'db_datareader', 'UserNameHere';
  • read more

    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): read more

    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:
    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 read more