Time Synchronisation across Azure Function and VMs (Linux / Windows)

GRAY Mike 161 Reputation points
2024-07-04T11:45:05.0366667+00:00

Hi,

I am looking into how I can provide a solution so the workloads I have in Azure are all time synchronised using the same source. I have a number of VM (Linux/Windows) as well as a number of PaaS services. the function mainly resides in Azure Functions. Could someone please recommend how Azure Functions and the VMs are time synced to use the same source.

I know PaaS is managed within Azure. Also the VMs can be configured to either use NTP or Chrony on Linux. I need to understand whether all these services can be configured to use the same source or whether any other alternate solutions / recommendations are available.

Thanks

Azure Functions
Azure Functions
An Azure service that provides an event-driven serverless compute platform.
5,114 questions
Azure Virtual Machines
Azure Virtual Machines
An Azure service that is used to provision Windows and Linux virtual machines.
8,000 questions
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. Silvia Wibowo 3,986 Reputation points Microsoft Employee
    2024-07-08T04:18:08.3133333+00:00

    Hi @GRAY Mike , I understand you want to make sure that all VMs (Windows and Linux) and Azure Functions use the same source for time synchronization.

    Azure hosts are synchronized to internal Microsoft time servers that take their time from Microsoft-owned Stratum 1 devices, with GPS antennas. Virtual machines in Azure can either depend on their host to pass the accurate time (host time) on to the VM or the VM can directly get time from a time server, or a combination of both.

    There are three options for configuring time sync for your Windows VMs hosted in Azure:

    Historically, most Azure Marketplace images with Linux have been configured in one of these: (to confirm ntpd is synchronizing correctly, run the ntpq -p command)

    • No time sync service is running by default.
    • ntpd is running as the time sync service, and synchronizing against an external NTP time source that is accessed over the network. For example, Ubuntu 18.04 LTS Marketplace images use ntp.ubuntu.com.
    • Some Azure Marketplace images with Linux are being changed to use chronyd as the time sync service, and chronyd is configured to synchronize against the Azure host rather than an external NTP time source.

    The Azure host time is usually the best time source to synchronize against, as it is maintained accurately and reliably, and is accessible without the variable network delays inherent in accessing an external NTP time source over the public internet.

    Azure Functions, depending on the OS and the hosting plan, will use the default time sync configuration on the host.

    Please accept an answer if correct. Original posters help the community find answers faster by identifying the correct answer. Here is how.

    0 comments No comments

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.