Blog Post

TestingSpot Blog
2 MIN READ

Querying Azure Tables using JMeter

Microsoft_Testing_Team's avatar
Microsoft_Testing_Team
Iron Contributor
Mar 03, 2020

Author : Ashish Tiwari

 

Performance test data ensures, how well our performance test simulates the real-world users. As a performance tester, one of the major challenges we face is getting the huge amount data.

Suppose the data you need is present in azure tables and you want to extract specific data that you are interested in.  This blog will tell you how you can make connection and query azure tables using JMeter.

Tools Used:

  • JMeter
  • Microsoft Azure Storage Explorer

We can easily query JMeter using Rest API (Please refer to https://docs.microsoft.com/en-us/rest/api/storageservices/querying-tables-and-entities link for query Syntax). The below URL will filter the table results based on partition key.

In JMeter, Put the following header in JMeter HTTP Header Manager.

Header:

Accept: application/json

 

And URL in the HTTP Request.

URL:

https://%3cStorageName%3e.table.core.windows.net/%3cTableName%3e()?$filter=PartitionKey%20eq%20'%3cPartitionKey%3e'&st=2019-10-10T09%3A17%3A37Z&se=2019-10-11T09%3A17%3A37Z&sp=raud&sv=2018-03-28&tn=%3cTableName%3e&sig=1%2BcTkVFsyqSTIWUfG5BEzCPL%2BpEgZ%2BOcrkR7YIdXZ3s%3D

https://%3cStorageName%3e.table.core.windows.net/%3cTableName%3e> - This part of URL we can get easily from Microsoft Azure Storage Explorer (Environment > Storage Account > Table Name). Please refer to the Screenshot below

 

  • ()?$filter=PartitionKey%20eq%20'<PartitionKey>’filtering the result based on column(here I have used Partition Key as column name ). We need to provide filtering value in single quotes(<PartitionKey>).
  • st=2019-10-10T09%3A17%3A37Z&se=2019-10-11T09%3A17%3A37Z&sp=raud&sv=2018-03-28&tn=<TableName>&sig=1%2BcTkVFsyqSTIWUfG5BEzCPL%2BpEgZ%2BOcrkR7YIdXZ3s%3DThis part of URL is Shared access Signature. For this table, we can get the Shared access signature from Azure table by right clicking on Azure table and clicking on “Get Shared Access Signature”.

 

 

 

  • Then we need to provide access duration and access rights

  • Click on Create.
  • The query part (without “?”) we need to append to our URL. 
  • When we run this, we will get the result of the query as an API response.

 

 

Now, after getting the response we can extract the response according to our need. In my case, I have extracted the desired fields from the response and made the CSV file out of it. And, I have used that CSV to do the Load Testing.

Updated Mar 03, 2020
Version 2.0
No CommentsBe the first to comment