Beispiel #1
0
        /// <summary>
        /// Gets a list of storage accounts from the storage catalog
        /// </summary>
        List <StorageAccount> IStorageActivity.GetStorageAccountList(bool includeKeys)
        {
            var getStorageAccountList = _client.GetStorageAccountList();

            if (!includeKeys)
            {
                return(getStorageAccountList);
            }
            // if the get keys flag is supplied then ensure that this returns the keys with the structure
            foreach (var storageAccount in getStorageAccountList)
            {
                var keys = _client.GetStorageAccountKeys(storageAccount.Name);

                storageAccount.PrimaryAccessKey   = keys[0];
                storageAccount.SecondaryAccessKey = keys[1];
            }
            return(getStorageAccountList);
        }