SALES: 1-800-867-1380

DeploymentDiagnosticManager Constructor

Updated: November 15, 2013

Creates a new instance of the DeploymentDiagnosticManager class.

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

public DeploymentDiagnosticManager (
	string connectionString,
	string deploymentId
)

Parameters

connectionString

Type: System.String

A connection string for a storage account.

deploymentId

Type: System.String

The deployment ID.

The DeploymentDiagnosticManager constructor creates a DeploymentDiagnosticManager object that can manage the running deployment’s diagnostics. You can specify the "Microsoft.WindowsAzure.Plugins.Diagnostics.ConnectionString" or another connection string that refers to a storage account specified in your ServiceConfiguration.cscfg file, as well as a deployment ID for the hosted service you want to manage. Once the object has been created, you can get the current diagnostics configuration, change it, or manage on-demand transfers of the diagnostic data to persistent storage.

See How to Configure Connection Strings for more information about how to construct a connection string to a storage account.

The following code snippet creates a new deployment diagnostic manager.

// 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";
            
// Create a DeploymentDiagnosticManager for the deployment.
DeploymentDiagnosticManager deploymentDiagnosticManager = new DeploymentDiagnosticManager(connectionString, deploymentId);


Development Platforms

Windows Vista, Windows 7, Windows Server 2008, Windows 8.1, Windows Server 2012 R2, Windows 8 and Windows Server 2012

Target Platforms

Was this page helpful?
(1500 characters remaining)
Thank you for your feedback

Community Additions

ADD
Show:
© 2014 Microsoft