DiagnosticMonitor.UpdateStorageAccount Method (String)

 

Updates the storage account information for the current diagnostic monitor.

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

Syntax

public void UpdateStorageAccount(
    string connectionString
)
public:
void UpdateStorageAccount(
    String^ connectionString
)
member UpdateStorageAccount : 
        connectionString:string -> unit
Public Sub UpdateStorageAccount (
    connectionString As String
)

Parameters

  • connectionString
    Type: System.String

    A String that specifies a connection string to a storage account, used for updating the diagnostic monitor’s storage configuration.

Remarks

The storage configuration for a role instance’s DiagnosticMonitor is updated with the connection string input parameter. The diagnostic monitor’s configuration is updated immediately using the new storage account, you do not need to restart the DiagnosticMonitor.

Example

The following code snippet creates a connection and calls the UpdateStorageAccount method:

// Create a connection string.  You can find the account name and key for 
// the storage account in the Windows Azure Management Portal (https://manage.windowsazure.com)
string connectionString = "DefaultEndpointsProtocol=https;AccountName=<AccountName>;AccountKey=<AccountKey>";

// Update the DiagnosticMonitor with the new storage account information.
diagMonitor.UpdateStorageAccount(connectionString);

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

DiagnosticMonitor Class
Microsoft.WindowsAzure.Diagnostics Namespace

Return to top