CloudStorageAccount.ToString Method (Boolean)

Storage Client Library NET API

[This topic is part of the Microsoft Azure Storage Client Library 1.7, which has been deprecated. See Storage Client Library for the latest version.]

Returns a connection string for the storage account, optionally with sensitive data.

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

Usage

Visual Basic
Dim instance As CloudStorageAccount
Dim exportSecrets As Boolean
Dim returnValue As String

returnValue = instance.ToString(exportSecrets)

Syntax

Visual Basic
Public Function ToString ( _
	exportSecrets As Boolean _
) As String
C#
public string ToString (
	bool exportSecrets
)
C++
public:
String^ ToString (
	bool exportSecrets
)
J#
JScript

Parameters

exportSecrets

Type: System.Boolean

True to include sensitive data in the string; otherwise, false.

Return Value

Type: System.String

A connection string.

Example

The following code example creates a reference to a storage account from a connection string, then writes out the connection string, with sensitive data.

C# Copy Code
static void GetConnectionString()
{
    //Parse a connection string and return a reference to the storage account.
    CloudStorageAccount storageAccount = CloudStorageAccount.Parse(ConfigurationManager.AppSettings["StorageAccountConnectionString"]);

    //Output the connection string with sensitive data.
    Console.WriteLine("Connection string with sensitive data: " + storageAccount.ToString(true));
}

Thread Safety

Any public static (Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.

Platforms

Development Platforms

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

Change History

See Also