[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
) |
Parameters
- exportSecrets
Type: System.Boolean
True
to include sensitive data in the string; otherwise, false
.
Return Value
Type:
System.StringA 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
Change History
See Also