Querying Azure Tables using JMeter

This post has been republished via RSS; it originally appeared at: New blog articles in Microsoft Tech Community.

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 this 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

March1.jpg

 

And URL in the HTTP Request.

URL:

https://<StorageName>.table.core.windows.net/<TableName>()?$filter=PartitionKey%20eq%20'<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%3D

March2.jpg

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

 

March3.jpg.png

  • ()?$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”.

 

 

March4.jpg.png

 

  • Then we need to provide access duration and access rights

March5.jpg

  • 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.

 

March6.jpg.png

 

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.

Leave a Reply

Your email address will not be published. Required fields are marked *

*

This site uses Akismet to reduce spam. Learn how your comment data is processed.