Q28. How does Azure recognize the number of instances to be created for a cloud application?

A developer specifies the number of instances of each role of an application in the service configuration file.

The Fabric Controller takes the responsibility of creating web role instances and worker role instances.

How will fabric Controller know what resources to allocate to an application?

The developer sets VM size, local storage resources, diagnostics settings for each web role and worker role. He also sets the number of instances required for each role. These settings are stored in the configuration files. When the application is deployed using the Windows Azure portal, the configuration files are also submitted.

Based on these configuration files, the Fabric controller determines how many instances of Virtual Machines should be created for each role of an application, it creates them and monitors them.

Important words:

Diagnostic settings

Settings refers to those settings which developer makes in the Diagnostic settings dialog box which will help him troubleshoot. To facilitate identification of the cause of an event these diagnostic settings are very handy.
Azure captures the system data which the developer can access after the application has worked for a period of time.