Using Fiddler and Advanced Rest Client to test Azure Storage and Azure Mobile Services
This post is about how you can use tooling test your cloud based services
Writing client code to test backend services introduces another level of testing
You end up testing both the client and the server
The secret to testing the service tier is to use 3rd party tools
Chrome's Advanced Rest Client and Fiddler are two examples
Related Posts
Get Request with Chrome
Used to get a Shared Access Signature
A mobile services account could be used to host a Node.js application that provides shared access signatures to raspberry pi devices
The shared access signature is needed by the raspberry pi, so that it can directly and securely upload photos to Azure storage
We have related posts that shows how Node.js can be used to provide Shared Access Signatures (SAS)
Advanced REST client can be used to test this
Advanced REST Client Interface
See Figure 1
The client URL points to your Node.js application running inside of Azure Mobile Services
The Mobile Service App key is tied to the Azure Mobile Services that you have provisioned
A Get request is how we call into the Node.js Mobile Service API
The SAS token is what is returned back
The SAS token can be used to upload photos
- That is tested in the next section
Figure 1: Chrome's Advanced Rest Client doing a GET request to get a shared access signature from Azure mobile services
PUT Request with Fiddler
Used to test the shared access signature obtained in the previous step
Will result in a photo getting uploaded using the shared access signature
Figure 2 illustrates:
- The Client URL encapsulates the SAS Token from the previous step
- A PUT is need to upload a blob and the SAS Token can be used for that
- You will need to select a file to upload
- Then just hit EXECUTE
I just could not get Advanced REST Client to do this part. It sent an incorrect Content-Length regardless of what I tried.
Figure 2: Fiddler issuing a PUT request to upload a photo to Azure Storage
The Uploaded File
Visual Studio can show us the uploaded image
You can see the following:
- The Azure Storage account is called raspberrypistorage
- The uploaded photo is called 95350.jpg
- The URL is visible
Figure 3: Viewing Azure Storage to verify a photo upload
Conclusion
It is very simple to use proxies and test clients like Advanced Rest Client and Fiddler. Both products are free and can be found easily.
These tools eliminate some potential challenges when testing back end services.
Comments
- Anonymous
August 14, 2015
The comment has been removed