title: This request is not authorized to perform this operation. Azure blobClient
body: <p>I have the following code to return a list of containers using the <code>WindowsAzure.Storage</code> nuget package:</p>
  
  <pre><code>public static class AzureBlobStorageClient
  {
      public static CloudBlobClient GetClient(string AccountName = "foo", string AccountKey = "bar" )
      {
          try
          {
  
              var connectionString = $"DefaultEndpointsProtocol=https;AccountName={AccountName};AccountKey={AccountKey};EndpointSuffix=core.windows.net";
              CloudStorageAccount storageAccount = CloudStorageAccount.Parse(connectionString);
              CloudBlobClient blobClient = storageAccount.CreateCloudBlobClient();
              IRetryPolicy exponentialRetryPolicy = new ExponentialRetry(TimeSpan.FromSeconds(2), 10);
              blobClient.DefaultRequestOptions.RetryPolicy = exponentialRetryPolicy;
              return blobClient;
          }
          catch (StorageException ex)
          {
              Console.WriteLine("Error returned from the service: {0}", ex.Message);
              throw;
          }
      }
  
      public static void DeleteContainer(CloudBlobContainer container)
      {
          var result = container.DeleteIfExistsAsync().Result;
      }
  
      public static List&lt;CloudBlobContainer&gt; GetContainers()
      {
          var client = GetClient();
          BlobContinuationToken continuationToken = null;
          List&lt;CloudBlobContainer&gt; results = new List&lt;CloudBlobContainer&gt;();
          do
          {
              var response = client.ListContainersSegmentedAsync(continuationToken).Result;
              continuationToken = response.ContinuationToken;
              results.AddRange(response.Results);
          }
          while (continuationToken != null);
  
          return results;
      }
  
  }
  </code></pre>
  
  <p>when i run this, i get the following error on client.ListContainersSegmentedAsync(continuationToken).Result :</p>
  
  <blockquote>
    <p>System.AggregateException: 'One or more errors occurred. (This request is not authorized to perform this operation.)'</p>
  </blockquote>
  
  <p>and I can't see how to set the authorization for the request. </p>
  
  <p>My question is how to get past this error message</p>