text: "use strict";
  /**
   * @file uploadFileToAzure.ts
   * @Copyright (c) Microsoft Corporation.  All rights reserved.
   *
   * Uploads an individual file to an Azure Blob Service instance, wrapped in a promise
   */
  Object.defineProperty(exports, "__esModule", { value: true });
  const RetryablePromise_1 = require("./../RetryablePromise");
  function uploadFileToAzure(blobService, containerName, localFilename, serverFilename, log = console.log) {
      serverFilename = serverFilename || localFilename;
      return new RetryablePromise_1.default((resolve, reject) => {
          try {
              blobService.createBlockBlobFromLocalFile(containerName, serverFilename, localFilename, (error, result, response) => {
                  if (error) {
                      reject(new Error(`Unable to upload file: ${serverFilename} from ${localFilename}`));
                  }
                  if (result) {
                      log(`Uploaded file: ${serverFilename}`);
                  }
                  resolve(blobService);
              });
          }
          catch (error) {
              reject(new Error(error));
          }
      });
  }
  exports.default = uploadFileToAzure;
  
  //# sourceMappingURL=uploadFileToAzure.js.map
  