Facebook Twitter Instagram
    TecAdmin
    • Home
    • FeedBack
    • Submit Article
    • About Us
    Facebook Twitter Instagram
    TecAdmin
    You are at:Home»Azure»How to Change TimeZone in Azure App Service

    How to Change TimeZone in Azure App Service

    By RahulApril 16, 20223 Mins Read

    TimeZone plays an important role for time crucial applications. In that case, you must have to set a proper timezone for the running operating system. One of our users asked about setting up the Timezone in Azure App Services.

    Advertisement

    In this tutorial, you will learn how to set the Timezone for an application running on Azure App Services. All the screenshots of this tutorial are made for Windows-based Azure App Service.

    Identify the OS

    You can easily set the Timezone to Windows app service using environment variables but the settings are different for an app service hosted in Linux or Windows.

    To identify the OS type, follow:

    1. Log in to the Azure Portal
    2. Open the Azure app service
    3. Go to Console
    4. On the console Window you will either get a Windows prompt or a Linux shell.

    Find The TimeZone

    The Windows and Linux platforms followed some different string formats for different-2 Timezones. So first you need to find the correct string for the required timezone based on the Azure App Service OS type: To find the string follow:

    • Windows based App Service – Open a PowerShell terminal on a Windows system and run the following command. It will list the Timezone.
      Get-ChildItem -Path 'HKLM:\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Time Zones' | Select-Object PSChildName
      
    • Linux based App Service – Visit https://en.wikipedia.org/wiki/List_of_tz_database_time_zones
    How to Change Timezone of Azure App Service
    List of Timezone for Windows Environment

    Change TimeZone on Azure App Service

    Now, go through the following steps and configure the application setting with the correct name and value.

    1. Log in to the Azure Portal
    2. Open Azure App Service
    3. On the left-hand sidebar click on Configuration under Settings.
    4. Click on “+ New Application Setting”
    5. Set the environment variables based on OS type:
      • For Windows App Service type Name and Value as:
        Name=WEBSITE_TIME_ZONE
        Value=Eastern Standard Time
      • For Linux App Service type Name and Value as:
        Name=TZ
        Value=America/New_York
    6. Click Ok
    7. Click Save to confirm and save the change.
    How to Set Timezone of Azure App Service
    Setting Up Timezone of a Azure App Service

    That’s it. You have changed the Timezone of the Windows Azure App Service successfully.

    Verify TimeZone

    Now, make sure that the timezone is applied correctly to the Azure app service. Open the app console and check the current date and time of the service. Match the current date and time with the actual time of the configured Timezone.

    How to Configure Timezone of Azure App Service
    Check Current Date and Time in Azure App Service

    Conclusion

    In this tutorial, You have learned to configure the Timezone of a running App Service on the Azure cloud platform. Now all the date and time-related activities will use the new Timezone as default for that Azure App Service.

    Azure Azure App Service timezone
    Share. Facebook Twitter Pinterest LinkedIn Tumblr Email WhatsApp

    Related Posts

    How to Set or Change Time Zone in Linux

    How to Set or Change the Time Zone in Linux

    How to Change Time Zone in Debian Linux

    How to Get Current Date & Time in PHP

    View 2 Comments

    2 Comments

    1. Lucas Recoaro on January 25, 2023 8:01 pm

      Thanks so much

      Reply
    2. Sundus on August 6, 2022 9:55 am

      Many thanks, I was looking for this

      Reply

    Leave A Reply Cancel Reply

    Advertisement
    Recent Posts
    • How to Install PHP 8.2-7.4 on RHEL & CentOS Stream 9
    • How to Install MySQL 8.0 on RHEL & CentOS Stream 9
    • How to Split Large Archives in Linux using the Command Line
    • System.out.println() Method in Java: A Beginner’s Guide
    • Split Command in Linux With Examples (Split Large Files)
    Facebook Twitter Instagram Pinterest
    © 2023 Tecadmin.net. All Rights Reserved | Terms  | Privacy Policy

    Type above and press Enter to search. Press Esc to cancel.