Hi Marouf Ali,
Welcome to the Microsoft Q&A Platform! Thank you for asking your question here.
Your understanding of Azure virtual machines (VMs) and containers is absolutely correct.
Azure Virtual Machines are classified as Infrastructure as a Service (IaaS). This means customers are responsible for managing the entire virtual machine environment, including the operating system, middleware, and applications.
Complete Isolation: Each VM runs its own operating system, providing a high level of isolation between VMs. This is managed by a hypervisor, which allocates physical resources (CPU, memory, storage) to each VM.
Resource Allocation: VMs have dedicated resources that are not shared with other VMs. Each VM includes its own OS, which results in higher resource consumption compared to containers.
Management Responsibility: Users are responsible for maintaining the operating system, installing updates, and managing security patches, which requires more administrative overhead.
Azure Containers are considered Platform as a Service (PaaS). This model abstracts the underlying infrastructure management, allowing users to focus primarily on the application itself.
Shared Operating System: Containers share the host operating system's kernel but run in isolated user spaces. This allows multiple containers to be hosted on a single OS instance, making them lightweight and efficient.
Rapid Deployment: Containers can be started and stopped quickly compared to VMs because they do not require a full OS to boot. This allows for faster scaling of applications.
Reduced Resource Usage: Containers use fewer resources than VMs, enabling more instances to run on a single host. This leads to higher density and efficiency.
Please refer to this document for more information https://learn.microsoft.com/en-us/virtualization/windowscontainers/about/containers-vs-vm
If you have any further queries, please do let us know.
If the answer is helpful, please click "Accept Answer" and "Upvote it."