How can I upload a file to Azure Blob Storage through JMeter using JAVA programmatically?
Asked
Active
Viewed 274 times
1 Answers
0
Here is a code snippet you can use as a basis:
DataLakeDirectoryClient directoryClient =
fileSystemClient.getDirectoryClient("my-directory");
DataLakeFileClient fileClient = directoryClient.createFile("uploaded-file.txt");
File file = new File("C:\\Users\\constoso\\mytestfile.txt");
// InputStream targetStream = new FileInputStream(file);
InputStream targetStream = new BufferedInputStream(new FileInputStream(file));
long fileSize = file.length();
fileClient.append(targetStream, 0, fileSize);
fileClient.flush(fileSize);
You can put it in a suitable JSR223 Test Element and use Groovy as the language
More information:

Dmitri T
- 159,985
- 5
- 83
- 133