Skip to main content

2 posts tagged with "windows"

View All Tags

· 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.

· 4 min read

I was at the Global Azure Bootcamp recently concluded last week, one of the participant came and asked me, "Hey what is Cosmos DB" I casually responded “Well, that’s Microsoft’s globally distributed, massively scalable, horizontally partitioned, low latency, fully indexed, multi-model NoSQL database". The immediate question came after that was whether it supports hybrid applications. In this blog I will be explaining how to leverage the features of cosmos db when you're building hybrid applications.

Ionic framework is an open source library of mobile-optimized components in JavaScript, HTML, and CSS. It provides developers with tools for building robust and optimized hybrid apps which works on Android,IOS and web.  Ionic comes with very native-styled mobile UI elements and layouts that you’d get with a native SDK on iOS or Android.

Let's see how to build Hybrid application with Ionic and Cosmosdb

PreRequisites:

You need to have npm and node installed on your machine to get started with Ionic.

Step 1: Make sure you've installed ionic in your machine with the following command,

ionic -v

Step 2: Install Ionic globally

if it's not installed, install it by using the command

npm i -g ionic

Step 3: Create a new ionic project

Ionic start is a command to create a new ionic project. You pass in the directory name to create, and the template to use. The template can be a built-in one (tabs, blank) or can point to a GitHub URL.

The aim is to create a simple ToDo application which displays lists of tasks, and user should be able to add new tasks.

Lets create a blank project with the command

 ionic start cosmosdbApp tabs

You will see a new project getting created.

Step 4: Run the ionic app

You can run the app with a simple command by navigating to the folder and then run

Ionic serve

This starts a local web server and opens your browser at the URL, showing the Ionic app in your desktop browser. Remember, ionic is just HTML, CSS and JavaScript!

It will open the application in the default browser with the default app.

If you're stuck at any point you can refer to my slides on How to get started with Ionic and follow the steps.

https://slides.com/sajeetharansinnathurai/ionicnsbm#/10

Step 5: Create the cosmosdb account on azure portal,

We need to create an cosmosdb account and use the Endpoint and SecretKey in our application. You can follow the

Blog on how to create it from the azure portal

https://sajeetharan.wordpress.com/2018/03/26/wear-out-the-features-of-azure-cosmosdb-with-aspnetcore-application/

Create a database named "ToDoList" and containeras "Items".

Once created, lets go back to the application.

Step 6: Lets add Cosmosdb SDK to the project

To consume the Cosmosdb service in the application we need to add the Azure Cosmos Javascript SDK to the project. This can be done with the command

npm i @azure/cosmos

Step 7:  You need to create an interface/model which will be used to save/retrieve the objects from the cosmosdb

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

Step 8: You need to add two pages home and todo page , home to display the lists of items inside the containerand todo page to add a new item. These two pages can be generated insdie the module with the command,

ionic g page home

Ionic g page todo

https://gist.github.com/sajeetharan/85229d091990d149b9c09d71f3387287

Step 9: We need to add a service to embed the logic to communicate with the cosmosdb you can create a new service inside the module as,

ionic g service cosmos

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

As we need to make use of the available methods inside the @azure/cosmos You can import cosmos with the line,

import * as Cosmos from "@azure/cosmos";

Now make use of all the available functions in the SDK to add,delete,update items in the cosmosdb.

Step 8: To make application compatible with android/ios , run the following command,

Ionic cordova build ios/android

If you want to make the development faster, you could try building your ionic application with capacitor as well.

Now your hybrid application uses cosmosdb as a backend, with this demo you know how to use cosmosdb as a database for your hybrid application. I hope you should be able to create more applications in the future with cosmosdb and ionic.

You can check the demo application source code from here.