Many of you might be eager to know the deployment machine details like Operating
System, Processes, and Hardware Configuration of the Azure application. In this
article I am focusing on this deployment details display.
Where are the Roles executed?
We have to take a note that the web role and worker role are executed on a
Virtual Machine. The VM role provides flexibility in deploying a configured
Virtual Machine role.
Creating the Application
We can start with a web role and add the following code into the Page Load
builder = new StringBuilder();
Show the Environment Information
64Bit Operating System: </b>"
Debugger Attached: </b>"
Show the Process Information
process in Process.GetProcesses())
Show the RoleEnvironment Information
Role Instance Name: </b>"
Display the Resutls
InfoLabel.Text = builder.ToString();
The code does the following activities.
Use the Environment class to list the Operating System Name, Version, Procesor Count etc.
Use the Process class to list the current active processes in the machine
Use the RoleEnvironment class to get the Role Name, Deployment Id, Is Emulated properties.
The following are the important properties we are accessing:
Get the machine name: Environment.MachineName
Get the operating system version: Environment.OSVersion
Get the number of processors in the machine: Environment.ProcessorCount
Get the active processes: Process.GetProcesses()
Get the role name: RoleEnvironment.CurrentRoleInstance.Role.Name
Get the deployment id: RoleEnvironment.DeploymentId
Check whether emulator mode: RoleEnvironment.IsEmulated
Executing the application
On executing the application in the development environment the following
results are retrieved.
Executing on the Cloud
Now we can deploy the application to the cloud and view the results. You can
refer to the packaging and deploying steps
After the deployment status is ready in the cloud, we can execute the
The execution result is shown below:
From the above result we can see the Operating system version. Together with
that Debugger.IsAttached and RoleEnvironment.IsEmulated properties are returning
false inside the cloud execution.
In this article we have seen the deployment details of the Azure application. We
have executed the application in the local development machine and in the online
Cloud platform. The attached source code contains the above described