RoleInstanceDiagnosticManager Constructor (String, String, String, String)

 

Initializes a new instance of the RoleInstanceDiagnosticManager class.

Namespace:   Microsoft.WindowsAzure.Diagnostics.Management
Assembly:  Microsoft.WindowsAzure.Diagnostics (in Microsoft.WindowsAzure.Diagnostics.dll)

public RoleInstanceDiagnosticManager(
	string connectionString,
	string deploymentId,
	string roleName,
	string roleInstanceId
)

Parameters

connectionString
Type: System.String

The connection string for the storage account.

deploymentId
Type: System.String

The deployment ID.

roleName
Type: System.String

The name of the role.

roleInstanceId
Type: System.String

The role instance ID.

The RoleInstanceDiagnosticManager constructor creates an object that represents the diagnostic monitor for a role instance. The methods and properties of this class enable you to configure on-demand transfers and change the current configuration of a diagnostic monitor.

The following code snippet creates a RoleInstanceDiagnosticManager using this method:

// Get the connection string. It's recommended that you store the connection string in your web.config or app.config file.
// Use the ConfigurationManager type to retrieve your storage connection string.  You can find the account name and key in
// the Windows Azure Management Portal (http://manage.windowsazure.com).
//string connectionString = "DefaultEndpointsProtocol=https;AccountName=<AccountName>;AccountKey=<AccountKey>";
string connectionString = System.Configuration.ConfigurationManager.ConnectionStrings["StorageConnectionString"].ConnectionString;

// You can find the deployment ID, role name, and role instance ID in the 
// Windows Azure Management Portal (http://manage.windowsazure.com).
string deploymentId = "28267ed8caf3424eab3f0b01acdd7281";
string roleName = "WebRole1";
string roleInstanceId = "WebRole1_IN_0";

RoleInstanceDiagnosticManager roleInstanceDiagnosticManager = new RoleInstanceDiagnosticManager(connectionString, deploymentId, roleName, roleInstanceId);

System_CAPS_warningWarning

This API is not supported in Azure SDK versions 2.5 and higher. Instead, use the diagnostics.wadcfg XML configuration file. For more information, see Collect Logging Data by Using Azure Diagnostics.

Return to top
Show: