Skip to content

Instantly share code, notes, and snippets.

@sirkirby
Created January 24, 2017 19:58
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save sirkirby/389a289f55e8160efcbeef99e1d33db4 to your computer and use it in GitHub Desktop.
Save sirkirby/389a289f55e8160efcbeef99e1d33db4 to your computer and use it in GitHub Desktop.
Runscope Azure Storage API Table Query
{
"trigger_url": "https://api.runscope.com/radar/fcb31ec5-f6ac-43a4-ac7c-999999999999/trigger",
"name": "Azure Storage",
"version": "1.0",
"exported_at": 1485287745,
"steps": [
{
"url": "https://{{accountName}}.table.core.windows.net/{{tableName}}(PartitionKey='12345',RowKey='678910')",
"variables": [],
"args": {},
"step_type": "request",
"auth": {},
"note": "",
"headers": {},
"assertions": [
{
"comparison": "equal_number",
"value": 200,
"source": "response_status"
}
],
"scripts": [],
"fragment": "",
"before_scripts": [
"var storageAccount = variables.get(\"accountName\");\r\nvar accountKey = variables.get(\"accountKey\");\r\nvar date = moment().format(\"ddd, DD MMM YYYY HH:mm:ss\");\r\nvar data = date + \"\\n\" +\r\n \"/\" + storageAccount + \" /\" + variables.get(\"tableName\")\r\n// utf-8 encoding\r\nvar encodedData = unescape(encodeURIComponent(data));\r\n// encrypt and encode the data\r\nvar hash = CryptoJS.HmacSHA256(encodedData, variables.get(\"accountKey\"));\r\nvar signature = hash.toString(CryptoJS.enc.Base64);\r\n// build the auth header \r\nvar auth = \"SharedKeyLite \" + variables.get(\"accountName\") + \":\" + signature;\r\n// add the headers to the request\r\nrequest.headers[\"Authorization\"] = auth;\r\nrequest.headers[\"Date\"] = date;"
],
"data": "",
"method": "GET"
}
],
"description": ""
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment