IoTHubClient_UploadToBlobAsync uploads data from memory to a file in Azure Blob Storage.


#include "azure-iot-sdk-c/iothub_client/inc/iothub_client.h"

IOTHUB_CLIENT_RESULT IoTHubClient_UploadToBlobAsync(
  IOTHUB_CLIENT_HANDLE                iotHubClientHandle,
  const char *                        destinationFileName,
  const unsigned char *               source,
  size_t                              size,
  void *                              context


  • iotHubClientHandle The handle created by a call to the IoTHubClient_Create function.

  • destinationFileName The name of the file to be created in Azure Blob Storage.

  • source The source of data.

  • size The size of data.

  • iotHubClientFileUploadCallback A callback to be invoked when the file upload operation has finished.

  • context A user-provided context to be passed to the file upload callback.

Return Value

IOTHUB_CLIENT_OK upon success or an error code upon failure.