private void refreshToken() throws MalformedURLException, ExecutionException, InterruptedException {
    IAuthenticationResult iAuthenticationResult = getAccessTokenByClientCredentialGrant(azureCloudConfig);
    AccessToken accessToken = new AccessToken(iAuthenticationResult.accessToken(),
        iAuthenticationResult.expiresOnDate().toInstant().atOffset(OffsetDateTime.now().getOffset()));
    if (accessTokenRef == null) {
      accessTokenRef = new AtomicReference<>(accessToken);
    } else {
      accessTokenRef.set(accessToken);
    }
  }
Refreshes AD authentication token and creates a new ABS client with the new token. Also, it schedules a task
for repeating this step before the obtained token expires.
ambry-cloud/src/main/java/com/github/ambry/cloud/azure/ADAuthBasedStorageClient.java