Partilhar via


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)

Syntax

public RoleInstanceDiagnosticManager(
    string connectionString,
    string deploymentId,
    string roleName,
    string roleInstanceId
)
public:
RoleInstanceDiagnosticManager(
    String^ connectionString,
    String^ deploymentId,
    String^ roleName,
    String^ roleInstanceId
)
new : 
        connectionString:string *
        deploymentId:string *
        roleName:string *
        roleInstanceId:string -> RoleInstanceDiagnosticManager
Public Sub New (
    connectionString As String,
    deploymentId As String,
    roleName As String,
    roleInstanceId As String
)

Parameters

  • connectionString
    Type: System.String

    The connection string for the storage account.

Remarks

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 (https://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 (https://manage.windowsazure.com).
string deploymentId = "28267ed8caf3424eab3f0b01acdd7281";
string roleName = "WebRole1";
string roleInstanceId = "WebRole1_IN_0";

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

Warning

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.

See Also

RoleInstanceDiagnosticManager Class
Microsoft.WindowsAzure.Diagnostics.Management Namespace

Return to top