Skip to main content

· 5 min read

One of the frequent questions i get from partners is on how to set Timezone for an application running on Azure app service. It is too easy to change the timezone for an app service hosted in windows OS , but the same settings do not apply for an app service hosted in Linux or Web App running using a container.

How to configure for App Service on Windows:

If your app service plan runs on Windows, As a quick fix, in the configuration, just add a setting named “WEBSITE_TIME_ZONE” with the value you want:

Timezone configuration on Web App

How to configure for AppService on Linux:

If your App Service Plan is Linux, you need to do it differently. You need to set TZ variable in Application settings.

Say if you want to set your timezone to Asia/Kolkata. you need to set the TZ variable value as

Timezone configuration on Linux Web App

Timezone Values:

The supported timezone values are listed here.

Value="Morocco Standard Time" For (GMT) Casablanca
Value="GMT Standard Time" For (GMT) Greenwich Mean Time : Dublin, Edinburgh, Lisbon, London
Value="Greenwich Standard Time" For (GMT) Monrovia, Reykjavik
Value="W. Europe Standard Time" For (GMT+01:00) Amsterdam, Berlin, Bern, Rome, Stockholm, Vienna
Value="Central Europe Standard Time" For (GMT+01:00) Belgrade, Bratislava, Budapest, Ljubljana, Prague
Value="Romance Standard Time" For (GMT+01:00) Brussels, Copenhagen, Madrid, Paris
Value="Central European Standard Time" For (GMT+01:00) Sarajevo, Skopje, Warsaw, Zagreb
Value="W. Central Africa Standard Time" For (GMT+01:00) West Central Africa
Value="Jordan Standard Time" For (GMT+02:00) Amman
Value="GTB Standard Time" For (GMT+02:00) Athens, Bucharest, Istanbul
Value="Middle East Standard Time" For (GMT+02:00) Beirut
Value="Egypt Standard Time" For (GMT+02:00) Cairo
Value="South Africa Standard Time" For (GMT+02:00) Harare, Pretoria
Value="FLE Standard Time" For (GMT+02:00) Helsinki, Kyiv, Riga, Sofia, Tallinn, Vilnius
Value="Israel Standard Time" For (GMT+02:00) Jerusalem
Value="E. Europe Standard Time" For (GMT+02:00) Minsk
Value="Namibia Standard Time" For (GMT+02:00) Windhoek
Value="Arabic Standard Time" For (GMT+03:00) Baghdad
Value="Arab Standard Time" For (GMT+03:00) Kuwait, Riyadh
Value="Russian Standard Time" For (GMT+03:00) Moscow, St. Petersburg, Volgograd
Value="E. Africa Standard Time" For (GMT+03:00) Nairobi
Value="Georgian Standard Time" For (GMT+03:00) Tbilisi
Value="Iran Standard Time" For (GMT+03:30) Tehran
Value="Arabian Standard Time" For (GMT+04:00) Abu Dhabi, Muscat
Value="Azerbaijan Standard Time" For (GMT+04:00) Baku
Value="Mauritius Standard Time" For (GMT+04:00) Port Louis
Value="Caucasus Standard Time" For (GMT+04:00) Yerevan
Value="Afghanistan Standard Time" For (GMT+04:30) Kabul
Value="Ekaterinburg Standard Time" For (GMT+05:00) Ekaterinburg
Value="Pakistan Standard Time" For (GMT+05:00) Islamabad, Karachi
Value="West Asia Standard Time" For (GMT+05:00) Tashkent
Value="India Standard Time" For (GMT+05:30) Chennai, Kolkata, Mumbai, New Delhi
Value="Sri Lanka Standard Time" For (GMT+05:30) Sri Jayawardenepura
Value="Nepal Standard Time" For (GMT+05:45) Kathmandu
Value="N. Central Asia Standard Time" For (GMT+06:00) Almaty, Novosibirsk
Value="Central Asia Standard Time" For (GMT+06:00) Astana, Dhaka
Value="Myanmar Standard Time" For (GMT+06:30) Yangon (Rangoon)
Value="SE Asia Standard Time" For (GMT+07:00) Bangkok, Hanoi, Jakarta
Value="North Asia Standard Time" For (GMT+07:00) Krasnoyarsk
Value="China Standard Time" For (GMT+08:00) Beijing, Chongqing, Hong Kong, Urumqi
Value="North Asia East Standard Time" For (GMT+08:00) Irkutsk, Ulaan Bataar
Value="Singapore Standard Time" For (GMT+08:00) Kuala Lumpur, Singapore
Value="W. Australia Standard Time" For (GMT+08:00) Perth
Value="Taipei Standard Time" For (GMT+08:00) Taipei
Value="Tokyo Standard Time" For (GMT+09:00) Osaka, Sapporo, Tokyo
Value="Korea Standard Time" For (GMT+09:00) Seoul
Value="Yakutsk Standard Time" For (GMT+09:00) Yakutsk
Value="Cen. Australia Standard Time" For (GMT+09:30) Adelaide
Value="AUS Central Standard Time" For (GMT+09:30) Darwin
Value="E. Australia Standard Time" For (GMT+10:00) Brisbane
Value="AUS Eastern Standard Time" For (GMT+10:00) Canberra, Melbourne, Sydney
Value="West Pacific Standard Time" For (GMT+10:00) Guam, Port Moresby
Value="Tasmania Standard Time" For (GMT+10:00) Hobart
Value="Vladivostok Standard Time" For (GMT+10:00) Vladivostok
Value="Central Pacific Standard Time" For (GMT+11:00) Magadan, Solomon Is., New Caledonia
Value="New Zealand Standard Time" For (GMT+12:00) Auckland, Wellington
Value="Fiji Standard Time" For (GMT+12:00) Fiji, Kamchatka, Marshall Is.
Value="Tonga Standard Time" For (GMT+13:00) Nuku'alofa
Value="Azores Standard Time" For (GMT-01:00) Azores
Value="Cape Verde Standard Time" For (GMT-01:00) Cape Verde Is.
Value="Mid-Atlantic Standard Time" For (GMT-02:00) Mid-Atlantic
Value="E. South America Standard Time" For (GMT-03:00) Brasilia
Value="Argentina Standard Time" For (GMT-03:00) Buenos Aires
Value="SA Eastern Standard Time" For (GMT-03:00) Georgetown
Value="Greenland Standard Time" For (GMT-03:00) Greenland
Value="Montevideo Standard Time" For (GMT-03:00) Montevideo
Value="Newfoundland Standard Time" For (GMT-03:30) Newfoundland
Value="Atlantic Standard Time" For (GMT-04:00) Atlantic Time (Canada)
Value="SA Western Standard Time" For (GMT-04:00) La Paz
Value="Central Brazilian Standard Time" For (GMT-04:00) Manaus
Value="Pacific SA Standard Time" For (GMT-04:00) Santiago
Value="Venezuela Standard Time" For (GMT-04:30) Caracas
Value="SA Pacific Standard Time" For (GMT-05:00) Bogota, Lima, Quito, Rio Branco
Value="Eastern Standard Time" For (GMT-05:00) Eastern Time (US & Canada)
Value="US Eastern Standard Time" For (GMT-05:00) Indiana (East)
Value="Central America Standard Time" For (GMT-06:00) Central America
Value="Central Standard Time" For (GMT-06:00) Central Time (US & Canada)
Value="Central Standard Time (Mexico)" For (GMT-06:00) Guadalajara, Mexico City,Monterrey
Value="Canada Central Standard Time" For (GMT-06:00) Saskatchewan
Value="US Mountain Standard Time" For (GMT-07:00) Arizona
Value="Mountain Standard Time (Mexico)" For (GMT-07:00) Chihuahua, La Paz, Mazatlan
Value="Mountain Standard Time" For (GMT-07:00) Mountain Time (US & Canada)
Value="Pacific Standard Time" For (GMT-08:00) Pacific Time (US & Canada)
Value="Pacific Standard Time (Mexico)" For (GMT-08:00) Tijuana, Baja California
Value="Alaskan Standard Time" For (GMT-09:00) Alaska
Value="Hawaiian Standard Time" For (GMT-10:00) Hawaii
Value="Samoa Standard Time" For (GMT-11:00) Midway Island, Samoa
Value="Dateline Standard Time" For (GMT-12:00) International Date Line West

To verify that whether offset is updated or not navigate to Console and execute time command

Also, note that TZ codes are different from the Windows codes. Here's the reference database:

https://en.wikipedia.org/wiki/List_of_tz_database_time_zones

I hope it helps someone out there.

· 2 min read

There are few mandatory sites that every developer on azure should know. This post will contain a curated list of awesome websites which will definitely help.

Azure Checklist - This checklist is your guide to the best practices for deploying secure, scalable, and highly available infrastructure in Azure

Devops Generator - It is really a nice tool to get you a starting point for your demos on azure devops

Azure Charts - Azure heatmap where you can see the changes to Microsoft cloud services in a heat map visualisation

Cosmic notes - Learn more about Azure Cosmos DB database, one Cosmic Note at a time!

AKS Workshop - You’ll go through tasks that will help you master the basic and more advanced topics required to deploy a multi-container application to Kubernetes on Azure

Price Calulator - Pricing calculator to help you understand the pricing. This tool will make it easier to understand the pricing of the different services/products.

Azure VM pricing - Find and compare Azure Virtual machines specs and pricing on a one page.

Azure IoT Developer Kit - The Microsoft Azure MXChip IoT Developer Kit (a.k.a DevKit) can be used to develop and prototype IoT solutions leveraging Microsoft Azure services. It includes an Arduino compatible board with rich peripherals and sensors, an open-source board package and a growing projects catalog.

Severless Library - Collection of azure functions xamples. If you are looking for some ideas on how Azure functions can be leveraged or need an example for your scenario this is a great resource.

Azure speed test - Use this tool to measure the latency from your web browser to the Blob Storage Service in each of the Microsoft Azure Data Centers.

App Migration - Assess any app with an endpoint scan. Download the Migration Assistant and start your .NET and PHP app migration to Azure App Service.

The above tools/sites have helped me a lot in the journey of myself as a Azure developer. I'm sure this would help any of the developer who wants to get started on Azure.

· 3 min read

Hey NG folks, ng-Srilanka 2019, the First-ever Angular conference on the 14th of September 2019 was a great success. It was a dream come true moment for me. Yes, I am one of those developers who marries one platform or framework and doesn’t care too much about the other ones. I have been an Angularjs/Angular developer for the past 7 years. One of the reasons why I wanted to make this happen was because of the strong and wide Angular community in Sri Lanka. When I became a GDE in Angular in 2018, my first aim was to build a strong developer,especially Angular community in SriLanka. NG-Srilanka has been a 2 year dream and finally I am glad it happened with all grandeur .

To those who missed the event this year, below are some of the biggest highlights and benefits that ng-Srilanka had to offer that you can take right back to your development desk.

First ever Angular conference:

It was such an honor for me and my team to organize this fantastic conference for the first time in SriLanka and 2nd Angular conference in SouthEast Asia. When we started it we never imagined NG-Srilanka will grow into a large international conference which will attract such a strong support from the industry.

For the community, by the community:

A set of volunteers from the two top universities in SriLanka focused on reaching out to and building interest in the local community. The event was adorned by 400+ passionate developers from 15+ universities and 20+ companies. We ensured that we had a diverse speaker line up and further promoted diversity with scholarships and ensured that most participants made it to the event.

NG-Scholarship for students :

Unlike most of the Angular conferences, we came up with a scholarship program to provide free training on Angular by the local experts. The scholarship winners were selected based on the knowledge on Angular and their passion to learn more.

Great Agenda:

NG-Sri Lanka 2019 kicked off with @mgechev of the Angular team, who joined us from California and delivered the keynote. Later, the sessions were divided into two tracks named "Stacked" and "Sandwich". "Stacked" track touched upon various topics on Angular and "Sandwich track" deep dived into specific workshops. The event was also garnsihed with few lighter moments like entertainment performances by NSBM students.

Finally the speakers addressed the audience in an open QnA session, through which certain Angular topics were further discussed.This was a huge value add for the attendees, and proved truly a platform where many meaningful conversations can happen.

An AWESOME Team:

The real success of ng-Srilanka was the team behind it. Thank you, to the fantastic co-organizers who worked with me day and night, the amazing support staff , dedicated volunteers, the sponsors, the awesome speakers and of course the great attendees.I would like to thank everyone who contributed to the success of the event, devoted their time and support to make this conference a big HIT.

Such a nerve wracking but amazing experience! So lucky to work with such a supportive team.

We've been recieving wonderful feedback from the speakers,attendees and several others on social media about the conference. Looking forward to NG-Srilanka 2020!

· One min read

There are few cool speed test tools available out there which allows you to test network latencies and speed to data centers from different countries and locations.  Along with finding the closest Datacenter near your location, it tests the storage latency as well as upload and download speeds. 

Check it out from the following urls:

𝗔𝘇𝘂𝗿𝗲: http://azurespeedtest.azurewebsites.net

𝗔𝗪𝗦: https://cloudharmony.com/speedtest-for-aws

Make use of the above tools to identify which region is suitable for your solution. Hope it helps.

· 6 min read

I have been working with Cosmos DB for almost 2 years and most of the time i have used SDKs to connect to Cosmos DB. In the recent times i started consuming Rest API for my hybrid application. One of the tricky part in Cosmos DB is that connecting to it and running queries with REST API. In this blog post, I want to elaborate more on the repository i have created to test the APIs in one go. Also will discuss more on how to call Azure Cosmos DB by using its REST API. I will be using the Cosmosdb account and Postman tool.

If you are very new to Cosmosdb, read my blog on how to setup Cosmos DB in local and connect via Visual Studio Code. Many of us come from the SQL background, when we want to connect to SQL Server, usually we need to have a username and password. You need to do more than that to connect and run queries in CosmosDB. But CosmosDB needs some more parameters to connect to it.

Once you create the Cosmos DB account on Azure and navigate to the keys section on the left pane. You will see two types of tabs on the Keys. There are two types of keys, one type of users having the Key can Read and Write. Other type ofusers having the key can only Read. 

Let's understand different terms used while making a connection to Cosmos DB

Master Keys are keys are created when the Cosmos DB Account is created. This key can be regenerated by clicking on refresh icon to regenerate them in the Azure portal. When you are using Cosmos DB emulator you won't be able to generate it. These keys are very sensitive ones and provide access to the administrative resources. We should be very careful when weneed to store them. Recommended way is to use Read-Only Keys as much as we can.

Resource Tokens are responsible for providing access to specific containers, documents, attachments, stored procedures, triggers, and UDFs. Each user must have a resource token. It is mandatory that every application needs to use a resource token to call Cosmos DB API.

Users are specific for Cosmos DB databases. You can attach specific permissions or roles to each user like the way we do in SQL server.

Cosmos DB API

As i mentioned earlier we have many options to access to CosmosDB. Rest API is one of these options and it is the low level access way to Cosmos DB. Most of the features supported with SDK are available and you can customize all options of CosmosDB by using REST API. To customize the calls, and pass the required authorization information, you need to use http headers.

In the following example, I am going to try to create a database in CosmosDB emulator by using the REST API. First let’s look at the required header fields for this request. These requirement applies to all other REST API calls too.

x-ms-version : As the name indicates this is the version of the REST API. You can find the available versions here. If you are confused on what to use always use the latest one.

x-ms-date : This is the date of your request. It must be formatted by Coordinated Universal Time. (ex: Sun, 30 June 2019 05:00:23 GMT)

x-ms-session-token: It is required if you want to use session consistency. For each of your new write request in Session consistency, CosmosDB assings a new SessionToken to the calls. You need to track the right session token and use it in this header property to keep usng the same session. SDK does this for you in the background, if you want to use the REST API, you need to do this manually.

Authorization: This one is the most important and tricky one. This needs to get generated for each of your call to Cosmos DB. It must be in the following format

How to Call APIs with Postman:

To call Cosmos DB directly from POSTMAN, you need to get the Cosmosdb account URL we need to use. If you are using the emulator, you can get it from the the local environment which should be like https://localhost:8081. I will be using the account created in Azure protal.

One other thing you need to setup is the environment variable as you see we are using some of the configured variables in the script, you can create a new environment variable using Postman by navigating to environments and add new environment with configured variables.

Create environments

Configured variables

we need to look at the documentation of CosmosDB Rest API. You can find all URL locations from this link. Since I am trying to list the databases inside a collection, I am going to use the following path.

https://postmandemo.documents.azure.com:443/

     Also, documentation tells us that this must be a GET Http Action. In Postman, I pick the GET and type the URL to the URL section in the following example.

As Next step, we need to create an environment in Postman to store some variables. As connecting to cosmos db needs a token we need to generate a token for CosmosDB and get the current date to fill the header named x-ms-date. I am going to use variables in Environment to store the values. To Create an environment. Click on gears icon and click on Add.

The below example shows the environment variables that we will frequently use to test Cosmos DB API.

As we are requesting to get the list of databases, we are ready to add values to headers section. Click on Headers link, and add the following headers. These are the required HTTP headers for all CosmosDB REST API calls.

x-ms-version : 2019-06-30
(This is the latest version. You can find the other versions here.)

x-ms-date: {{utcDate}}
(This is the variable we defined in the Postman environment. Its value will be generated dynamically in the Pre-request Script.)

authorization : {{authToken}} (This is the other parameter we just created. We are going to generate its value in script.)

Acceptapplication/json.
(This is required since this is going to be a GET Http Action.)

Your screen should looks like this.

Next, we need to generate an authorization token and the current date in the required format.
To do this, we’ll use the Pre-request Script section in Postman. This script runs automatically before each request. In this step, we’ll generate the authToken and utcDate parameters.
Simply copy and paste the following code into the Pre-request Script tab:

https://gist.github.com/sajeetharan/c2c1fbc48bf24e3b321323b34232f5a8

We are done with all the things needed to get the list of databases. Click on the send button to see the list of databases as response.

Great! Look at all that information we received back in the body of the Response.

This is the way to test Cosmos DB API with POSTMAN. You can try different APIs with the simple collection we've created here. Now it becomes easy for developers to leverage the Cosmos DB api and to play around with it.