Hello @Jalal Feghhi ,
To run applications on virtual machine (VM) instances in a scale set, you first need to install the application components and required files. This article introduces ways to build a custom VM image for instances in a scale set, or automatically run install scripts on existing VM instances. You also can find how to manage application or OS updates across a scale set.
There is another great resource to learn how to build a scalable application with virtual machine scale sets. There you could find exercise steps how to install and update applications in virtual machine scale sets.
One more resource for you: "How to create a Virtual Machine Scale Set with Visual Studio". Once you've successfully deployed Virtual Machine Scale Sets through Visual Studio, you can further customize your project to suit your application requirements. For example, configure autoscale by adding an Insights resource. You could add infrastructure to your template, such as standalone virtual machines, or deploy applications using the custom script extension. Good example templates can be found in the Azure Quickstart Templates GitHub repository. Search for vmss.
-------------------------
(If the reply was helpful please don't forget to upvote and/or accept as answer, thank you)
Regards,
Olga