DeploymentDiagnosticManager Class
Assembly: Microsoft.WindowsAzure.Diagnostics (in Microsoft.WindowsAzure.Diagnostics.dll)
The DeploymentDiagnosticManager class is used to get the diagnostics configuration of a deployment and its role instances that are currently running on Windows Azure. Once a deployment has been specified, you can use other classes and methods of the Microsoft.WindowsAzure.Diagnostics.Management namespace to modify the diagnostics and logging configuration for the deployment and its roles.
You can instantiate a DeploymentDiagnosticManager class from an application running in the cloud or on a local computer. The only requirement is that your application can access the Blob storage endpoint for the wad-control-container created by your role’s DiagnosticMonitor.
You create a DeploymentDiagnosticManager object for a deployment by specifying the storage location for your diagnostics configuration file, using the DiagnosticsConnectionString, and supplying the deployment ID of a hosted service.
For example, 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 and Windows Server 2008Target Platforms