private BlobContainerAsyncClient getAsyncContainerClient(String containerName, boolean autoCreate) {
    BlobContainerAsyncClient containerAsyncClient =
        storageAsyncClientRef.get().getBlobContainerAsyncClient(containerName);
    if (autoCreate) {
      if (!knownContainers.contains(containerName)) {
        try {
          if (!containerAsyncClient.exists().toFuture().join()) {
            //TODO: Can make checking of container and its creation to async as well.
            containerAsyncClient.create().toFuture().join();
            logger.info("Created container {}", containerName);
          }
        } catch (CompletionException ex) {
          Exception e = Utils.extractFutureExceptionCause(ex);
          if (e instanceof BlobStorageException
              && ((BlobStorageException) e).getErrorCode() != BlobErrorCode.CONTAINER_ALREADY_EXISTS) {
            logger.error("Failed to create container {}", containerName);
            throw ex;
          }
        }
        knownContainers.add(containerName);
      }
    }
    return containerAsyncClient;
  }
Get a reference to an Azure container async client, creating it if necessary.
@param containerName the container name.
@param autoCreate flag indicating whether to create the container if it does not exist.
@return the created {@link BlobContainerClient}.
ambry-cloud/src/main/java/com/github/ambry/cloud/azure/StorageClient.java