Updated: November 15, 2013
Assembly: Microsoft.WindowsAzure.Diagnostics (in Microsoft.WindowsAzure.Diagnostics.dll)
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 PlatformsWindows Vista, Windows 7 and Windows Server 2008