Hello @Faisal Gillani ,
Auto scaling of compute resources like memory and CPU cores within an azure VM is possible which is vertical scaling and is manual
For your scenario, i would recommend using the VMSS, for details refer to virtual-machine-scale-sets-autoscale-portal
If your application demand increases, the load on the VM instances in your scale set increases. If this increased load is consistent, rather than just a brief demand, you can configure autoscale rules to increase the number of VM instances in the scale set. When these VM instances are created and your applications are deployed, the scale set starts to distribute traffic to them through the load balancer. You control what metrics to monitor, such as CPU or disk, how long the application load must meet a given threshold, and how many VM instances to add to the scale set.
In short, VM Scale sets are used to deploy identical sets of VM Instances. i.e., when you enable scaling in azure, VM Instances deployed will have the same Configuration as memory and storage. Scale sets will also increase (Scale-Out) VM’s or decrease (Scale In) VM’s as and when the demand increases or decreases. A scale set can be automatic, manual, or both.
Additionally, lamp-deployment refer to https://learn.microsoft.com/en-us/gaming/azure/reference-architectures/general-purpose-lamp-deployment-single-region?tabs=bash
Please "Accept as Answer" if any of above helped so that, it can help others in community looking for remediation for the similar issues.