title: How to use Azure managed identity with Azure.Storage.Blobs.BlobServiceClient?
body: <p>In <a href="https://docs.microsoft.com/en-us/azure/storage/blobs/storage-quickstart-blobs-dotnet-legacy" rel="nofollow noreferrer">v11 SDK for .NET</a> I was able to use managed identity tokens to get access to Azure blob:</p>
  
  <pre><code>var token = await new AzureServiceTokenProvider().GetAccessTokenAsync("https://storage.azure.com/");
  var tokenCredential = new TokenCredential(token);
  var storageCredentials = new StorageCredentials(tokenCredential);
  var blob = new CloudBlobContainer(new Uri("https://some_storage.blob.core.windows.net/some_container"), storageCredentials);
  </code></pre>
  
  <p>Now I want to switch to <a href="https://docs.microsoft.com/en-us/azure/storage/blobs/storage-quickstart-blobs-dotnet" rel="nofollow noreferrer">v12 SDK</a> and can't understand how to do the same for <code>BlobServiceClient</code>.</p>