Introduction
Recently, I have become more interested in the fundamentals of computer science so I can become a better programmer and engineer.
Today we will create a simple sorting Function that will take two arrays as input, write each incoming request to Azure Table Storage and return the sorted array as well as some statistics on how long the Function ran.
Today's example be using the WeightedQuickUnionWithPathCompression algorithm from Robert Sedgewick's Algorithms in Java, Third Edition. He and Kevin Wayne have published a fourth edition which you can read online. If you're interested in going further they offer their course free of charge on Coursera as well.
Errata
- Yochay Kiriatay, who is a principal program manager for Microsoft Azure's App Service Platform, was recently on .Net Rocks talking with Richard and Carl about Azure Functions. Stream the podcast here, if you wish, while you do today's demo. I had the opportunity to see Yochay do a demo live back in October at the .Net Developer's Association MeetUp. Unfortunately the session was done before all demos were being posted to YouTube so there isn't an archive. But getting the opportunity to listen to him again was a pleasure.
A Quick Rant
With the introduction of the Azure Functions tools for Visual Studio 2017 there are now three distinct ways to go about creating Azure Functions. Naturally, things are getting a little bit confusing.
I tried out the new tools yesterday for my GitHub demo but couldn't get the Azure Functions Project to publish correctly using CI/CD. I am not sure if there is a solution to this problem at the moment as the blog post only mentions publishing directly from Visual Studio. Which, is an okay option, but not the solution that we were going for yesterday.
I am finding that while the documentation for Azure Functions is out there, it is starting to become a bit fragmented and harder to follow.
Prerequisites
- Today's demo assumes that your Function is set up as a class library. If it isn't follow the steps in the section "Adding our Hello Function to a Solution.".
- This will work with our GitHub example from yesterday which is located here: AzureFunctionsBlogDemos.
You will need to ensure that you have the Azure CLI installed and the App Settings:
func azure login (optional) func azure account list (optional) func azure account set func azure functionapp list func azure functionapp fetch-app-settings [name]
Adding the Function
We are going to add a new folder and three items to our Project.
- First, we'll create a couple folders called "WeightedQuickUnionWithPathCompression" and "Shared
- Next we will add a class called "WeightedQuickUnionWithPathCompression.cs"
- Then, we will add a "function.json" file and a "readme.md" file
- Lastly, we will add our "Arrays.cs" class to the Shared folder
Note: I find this way to be a little simpler than doing the File --> New Azure Function that has been introduced into the VS 2017 tooling. The new tooling uses the Azure Webjob attributes which I am not as familiar with.
WeightedQuickUnionWithPathCompression.cs
Quick note: Update the keys for lines 44-46 as you like. I added a comment to help you remember.
using Microsoft.Azure.WebJobs;
using Microsoft.Azure.WebJobs.Host;
using Newtonsoft.Json;
using System;
using System.Diagnostics;
using System.Linq;
using System.Net;
using System.Net.Http;
using System.Threading.Tasks;
namespace AzureFunctionsBlogDemos.Sorting
{
public class WeightedQuickUnionWithPathCompression
{
public static async Task Run(HttpRequestMessage req, TraceWriter log,
IAsyncCollector outputTable)
{
log.Info("WeightedQuickUnionWithPathCompressionTrigger processed a request.");
// Parse request input
string jsonContent = await req.Content.ReadAsStringAsync();
var weightedQuickUnionWithPathCompression = JsonConvert.DeserializeObject(jsonContent);
log.Info($"Inputs: {weightedQuickUnionWithPathCompression.NumberToUnionFrom.Select(s => s.ToString())}, {weightedQuickUnionWithPathCompression.NumberToUnionTo.Select(s => s.ToString())}");
if (weightedQuickUnionWithPathCompression.NumberToUnionFrom.Length != weightedQuickUnionWithPathCompression.NumberToUnionTo.Length)
{
return req.CreateResponse(HttpStatusCode.OK, new
{
message = "Number of items to union do not match."
});
}
Stopwatch stopwatch = new Stopwatch();
stopwatch.Start();
Arrays.WeightedQuickUnionWithPathCompression(weightedQuickUnionWithPathCompression);
stopwatch.Stop();
weightedQuickUnionWithPathCompression.Runtime = stopwatch.Elapsed;
// The following Keys are used for TableStorage - Change as you wish...
weightedQuickUnionWithPathCompression.AlgorithmName = "WeightedQuickUnionWithPathCompression";
weightedQuickUnionWithPathCompression.PartitionKey = "Sorting";
weightedQuickUnionWithPathCompression.RowKey = Guid.NewGuid().ToString();
await outputTable.AddAsync(weightedQuickUnionWithPathCompression);
return req.CreateResponse(HttpStatusCode.OK, new
{
message = JsonConvert.SerializeObject(weightedQuickUnionWithPathCompression)
});
}
}
}
function.json
{
"scriptFile": "..\\bin\\AzureFunctionsBlogDemos.dll",
"entryPoint": "AzureFunctionsBlogDemos.Sorting.WeightedQuickUnionWithPathCompression.Run",
"disabled": false,
"bindings": [
{
"authLevel": "function",
"direction": "in",
"methods": [
"post"
],
"name": "req",
"type": "httpTrigger",
"webHookType": "genericJson"
},
{
"direction": "out",
"name": "$return",
"type": "http"
},
{
"connection": "AzureWebJobsStorage",
"direction": "out",
"name": "outputTable",
"tableName": "Sorting",
"type": "table"
}
]
}
readme.md
# HttpTrigger - C#
The `HttpTrigger` makes it incredibly easy to have your functions executed via an HTTP call to your function.
## How it works
When you call the function, be sure you checkout which security rules you apply. If you're using an apikey, you'll need to include that in your request.
## Learn more
Documentation
Lastly, in the Shared folder here is code Arrays.cs
using System;
using System.Linq;
namespace AzureFunctionsBlogDemos.Sorting
{
///
/// QuickFindInput takes an array of integers and then uses the two other arrays to union
///
public class Arrays
{
public int[] NumberToUnionFrom { get; set; }
public int[] NumberToUnionTo { get; set; }
public int[] OutputArray { get; set; }
public TimeSpan Runtime { get; set; }
public string AlgorithmName { get; set; }
public string PartitionKey { get; set; }
public string RowKey { get; set; }
public static void QuickFind(Arrays quickFind)
{
int max = 0;
max = quickFind.NumberToUnionFrom.Max() > quickFind.NumberToUnionTo.Max() ? quickFind.NumberToUnionFrom.Max() : quickFind.NumberToUnionTo.Max();
// setup the output array
quickFind.OutputArray = new int[max + 1];
for (int i = 0; i < quickFind.OutputArray.Length; i++)
{
quickFind.OutputArray[i] = i;
}
for (int i = 0; i < quickFind.NumberToUnionTo.Length; i++)
{
int fromIndex = quickFind.NumberToUnionFrom[i];
int toIndex = quickFind.NumberToUnionTo[i];
int hold = quickFind.OutputArray[fromIndex];
for (int j = 0; j < quickFind.OutputArray.Length; j++)
{
if (quickFind.OutputArray[j] == hold)
{
quickFind.OutputArray[j] = quickFind.OutputArray[toIndex];
}
}
}
}
public static void QuickUnion(Arrays quickFind)
{
int max = 0;
max = quickFind.NumberToUnionFrom.Max() > quickFind.NumberToUnionTo.Max() ? quickFind.NumberToUnionFrom.Max() : quickFind.NumberToUnionTo.Max();
// setup the output array
quickFind.OutputArray = new int[max + 1];
for (int i = 0; i < quickFind.OutputArray.Length; i++)
{
quickFind.OutputArray[i] = i;
}
for (int i = 0; i < quickFind.NumberToUnionTo.Length; i++)
{
int unionFrom = quickFind.NumberToUnionFrom[i];
int unionTo = quickFind.NumberToUnionTo[i];
int j, k;
for (j = unionFrom; j != quickFind.OutputArray[j]; j = quickFind.OutputArray[j]) ;
for (k = unionTo; k != quickFind.OutputArray[k]; k = quickFind.OutputArray[k]) ;
quickFind.OutputArray[j] = k;
}
}
public static void WeightedQuickUnion(Arrays quickFind)
{
int max = 0;
max = quickFind.NumberToUnionFrom.Max() > quickFind.NumberToUnionTo.Max() ? quickFind.NumberToUnionFrom.Max() : quickFind.NumberToUnionTo.Max();
// setup the output and depth arrays
quickFind.OutputArray = new int[max + 1];
int[] depth = new int[max + 1];
for (int i = 0; i < quickFind.OutputArray.Length; i++)
{
quickFind.OutputArray[i] = i;
depth[i] = 1;
}
for (int i = 0; i < quickFind.NumberToUnionTo.Length; i++)
{
int j, k;
int unionFrom = quickFind.NumberToUnionFrom[i];
int unionTo = quickFind.NumberToUnionTo[i];
for (j = unionFrom; j != quickFind.OutputArray[j]; j = quickFind.OutputArray[j]) ;
for (k = unionTo; k != quickFind.OutputArray[k]; k = quickFind.OutputArray[k]) ;
if (depth[j] < depth[k])
{
quickFind.OutputArray[j] = k;
depth[k] += depth[j];
}
else
{
quickFind.OutputArray[k] = j;
depth[j] += depth[k];
}
}
}
public static void WeightedQuickUnionWithPathCompression(Arrays quickFind)
{
int max = 0;
max = quickFind.NumberToUnionFrom.Max() > quickFind.NumberToUnionTo.Max() ? quickFind.NumberToUnionFrom.Max() : quickFind.NumberToUnionTo.Max();
// setup the output and depth arrays
quickFind.OutputArray = new int[max + 1];
int[] depth = new int[max + 1];
for (int i = 0; i < quickFind.OutputArray.Length; i++)
{
quickFind.OutputArray[i] = i;
depth[i] = 1;
}
for (int i = 0; i < quickFind.NumberToUnionTo.Length; i++)
{
int j, k;
int unionFrom = quickFind.NumberToUnionFrom[i];
int unionTo = quickFind.NumberToUnionTo[i];
for (j = unionFrom; j != quickFind.OutputArray[j]; j = quickFind.OutputArray[j])
{
quickFind.OutputArray[j] = quickFind.OutputArray[quickFind.OutputArray[j]];
}
for (k = unionTo; k != quickFind.OutputArray[k]; k = quickFind.OutputArray[k])
{
quickFind.OutputArray[k] = quickFind.OutputArray[quickFind.OutputArray[k]];
}
if (depth[j] < depth[k])
{
quickFind.OutputArray[j] = k;
depth[k] += depth[j];
}
else
{
quickFind.OutputArray[k] = j;
depth[j] += depth[k];
}
}
}
}
}
You'll notice that Arrays.cs has multiple algorithms for connecting two arrays. We will take advantage of this in a future post!
Run and Test the Function
Now we should be able to hit F5 and run our new WeightedQuickUnionWithPathCompression algorithm.

Grab the URL and we will launch Postman to send a test locally. First, change the HTTP verb to "Post." Then, we change the "Content-Type" under "Headers" to "application/json".

Next, we click into the "Body" tab and switch to "raw".

We can then paste the following into the "Body" textbox in Postman:
Test Body for WeightedQuickUnionWithPathCompression
{
"NumberToUnionFrom" : [93, 1649, 339, 256, 1809, 1722, 1570, 1166, 652, 109, 1656, 1932, 782, 2, 1482, 733, 24, 90, 1616, 1814, 1144, 185, 226, 1784, 800, 1271, 852, 1801, 641, 1967, 669, 438, 1744, 1893, 120, 1871, 1268, 1496, 258, 1118, 1281, 228, 939, 1193, 1251, 1370, 279, 419, 603, 1250, 1639, 387, 1030, 336, 1785, 1908, 1422, 555, 1455, 538, 870, 1769, 524, 684, 1439, 1217, 187, 889, 1881, 1610, 1465, 527, 1831, 498, 533, 915, 1246, 1033, 532, 1430, 991, 432, 1197, 1391, 327, 281, 1408, 1408, 107, 212, 448, 713, 41, 1720, 247, 1512, 1703, 255, 1753, 33, 1182, 1389, 537, 992, 1784, 1112, 556, 532, 1803, 869, 662, 389, 22, 25, 1546, 437, 571, 1133, 356, 1158, 1809, 778, 781, 1669, 1162, 751, 486, 110, 250, 1020, 1212, 990, 1279, 498, 247, 1602, 1895, 205, 1606, 1215, 1725, 875, 1605, 1238, 1550, 59, 690, 16, 174, 1809, 940, 570, 1898, 594, 224, 404, 607, 868, 1830, 1033, 626, 445, 281, 782, 1657, 1671, 1109, 1524, 1777, 1944, 542, 366, 1526, 1141, 1432, 934, 1173, 1543, 118, 1103, 61, 469, 1936, 440, 79, 641, 1092, 684, 274, 1843, 994, 1026, 374, 573, 589, 1279, 594, 822, 1580, 1879, 949, 1166, 238, 229, 1267, 574, 1043, 757, 1162, 1290, 1231, 1063, 750, 727, 971, 156, 508, 1840, 702, 1016, 579, 424, 1249, 1934, 949, 1515, 1992, 953, 551, 152, 339, 350, 1963, 239, 153, 895, 231, 1706, 1173, 1505, 1597, 334, 1522, 984, 611, 1930, 276, 1646, 1601, 432, 771, 753, 120, 564, 1300, 524, 1916, 303, 1279, 1751, 581, 90, 205, 1009, 950, 881, 1100, 510, 573, 76, 1924, 801, 667, 1196, 1418, 244, 901, 265, 1322, 1019, 1239, 345, 1351, 119, 1381, 1586, 229, 1398, 939, 1629, 978, 1927, 426, 1421, 924, 1506, 128, 513, 34, 1730, 829, 1765, 1072, 1525, 507, 1969, 85, 923, 1145, 1055, 1622, 1650, 981, 260, 512, 236, 739, 86, 1627, 1363, 651, 1702, 1571, 944, 1097, 1997, 374, 1246, 272, 1912, 116, 388, 231, 1592, 189, 1473, 1272, 1825, 1611, 1412, 1500, 1306, 252, 1883, 6, 1327, 946, 166, 908, 687, 766, 42, 885, 670, 1078, 1127, 193, 128, 427, 510, 1594, 839, 650, 1233, 939, 1234, 1419, 1388, 70, 1039, 963, 914, 475, 215, 1862, 1345, 1449, 1688, 938, 1770, 1050, 208, 337, 1584, 1145, 74, 1502, 1561, 513, 1062, 1279, 1144, 1398, 1100, 1817, 661, 655, 1019, 944, 772, 1908, 1557, 95, 1869, 1724, 1852, 1566, 670, 807, 1733, 1677, 505, 1189, 657, 1460, 1386, 502, 1066, 88, 865, 1731, 1858, 875, 1008, 1759, 1819, 1515, 1374, 398, 1201, 689, 430, 743, 166, 1861, 1492, 112, 467, 1860, 1293, 507, 832, 753, 779, 1384, 774, 1954, 741, 1640, 431, 158, 1589, 930, 79, 1040, 50, 682, 1087, 109, 1905, 336, 192, 272, 1606, 1043, 1247, 1761, 1023, 795, 1967, 1273, 34, 1205, 794, 357, 898, 1104, 95, 1623, 985, 1864, 774, 1734, 1966, 1042, 1100, 1499, 664, 1125, 1811, 810, 1025, 358, 1955, 956, 314, 560, 1147, 1736, 137, 1012, 931, 1945, 1672, 1158, 124, 383, 135, 1721, 141, 945, 587, 1463, 1124, 40, 1561, 458, 305, 563, 1943, 1747, 1097, 1897, 983, 1157, 248, 1676, 1250, 1838, 43, 338, 1957, 359, 1486, 1972, 933, 829, 61, 808, 918, 717, 1363, 942, 983, 866, 222, 1561, 1233, 1914, 1395, 1856, 254, 584, 1792, 389, 1914, 1033, 962, 515, 910, 448, 1132, 297, 1678, 1803, 988, 227, 1977, 1151, 1107, 732, 397, 1497, 1645, 1226, 383, 155, 914, 117, 934, 686, 442, 1336, 443, 186, 83, 1373, 566, 1096, 58, 1899, 1866, 1545, 1898, 470, 1584, 1066, 1263, 1180, 1877, 1994, 1583, 81, 806, 662, 1458, 757, 939, 566, 5, 1759, 119, 844, 1580, 223, 5, 1796, 1854, 1491, 1720, 1615, 1661, 881, 1093, 1208, 865, 851, 1599, 1174, 1641, 1317, 891, 1734, 239, 939, 1103, 360, 529, 1780, 728, 1325, 434, 0, 1090, 299, 1780, 1022, 1965, 1674, 465, 1788, 1211, 1772, 1459, 262, 333, 702, 988, 1598, 1797, 607, 1158, 1764, 924, 688, 867, 385, 605, 640, 1120, 1644, 1266, 74, 763, 394, 1181, 1661, 1790, 794, 1427, 1843, 886, 1924, 709, 1853, 106, 1119, 274, 1977, 606, 400, 1372, 931, 1982, 120, 167, 669, 1075, 402, 1431, 1394, 417, 1324, 554, 820, 521, 1137, 1008, 1064, 1081, 672, 911, 194, 170, 1954, 1721, 1233, 1054, 1070, 581, 1747, 110, 627, 34, 719, 272, 335, 91, 642, 227, 511, 585, 1388, 1362, 33, 1426, 1561, 1370, 1888, 1332, 968, 110, 1209, 895, 1934, 1488, 1177, 760, 28, 399, 934, 1615, 5, 1820, 1683, 1284, 1789, 1290, 1834, 548, 186, 1045, 365, 837, 569, 87, 1523, 832, 137, 528, 160, 1862, 1165, 1738, 1613, 1637, 901, 1731, 100, 1230, 1094, 1574, 62, 243, 1292, 896, 580, 1567, 1678, 748, 1636, 270, 1536, 1339, 1145, 1922, 1745, 371, 326, 1846, 1964, 345, 623, 1500, 239, 1072, 449, 266, 207, 46, 383, 57, 1190, 603, 1454, 612, 983, 122, 1545, 1673, 1506, 1956, 1153, 1388, 891, 1889, 326, 1826, 592, 1690, 1891, 529, 1405, 253, 1266, 749, 950, 562, 4, 220, 447, 313, 1360, 1631, 365, 1579, 1080, 932, 1885, 533, 939, 1623, 826, 653, 340, 8, 1191, 1234, 609, 350, 745, 622, 1674, 516, 154, 1854, 651, 937, 1337, 704, 1661, 421, 117, 1324, 1225, 1193, 596, 1522, 1022, 1311, 808, 1393, 1940, 59, 750, 268, 1702, 752, 1913, 1257, 1558, 1715, 1952, 1654, 1474, 1824, 639, 843, 1476, 511, 928, 143, 1595, 1181, 871, 518, 1505, 1502, 1427, 1146, 1412, 1669, 211, 1298, 1541, 1351, 682, 1614, 1766, 1886, 151, 1898, 1023, 80, 1146, 1945, 468, 463, 1849, 1401, 554, 1752, 45, 511, 382, 665, 1798, 759, 1188, 232, 763, 200, 1325, 766, 1844, 1889, 1503, 654, 113, 123, 1141, 1024, 1076, 1590, 359, 1029, 1119, 1514, 34, 925, 50, 1042, 1652, 25, 591, 1659, 1623, 1700, 915, 875, 1553, 1923, 426, 1534, 1122, 1951, 573, 257, 235, 1257, 441, 1813, 350, 1726, 259, 1529, 675, 454, 151, 1353, 1546, 283, 724, 262, 181, 1721, 547, 1299, 175, 185],
"NumberToUnionTo": [1939, 1963, 649, 428, 1408, 1374, 1530, 1180, 1942, 112, 1386, 1377, 1222, 1710, 795, 1251, 957, 1449, 1027, 491, 1390, 1027, 1456, 56, 203, 956, 956, 1690, 1135, 1382, 258, 945, 1119, 1378, 362, 852, 1376, 981, 235, 268, 7, 1324, 577, 1638, 1593, 1347, 1352, 1902, 1295, 1447, 916, 893, 679, 1839, 1558, 912, 506, 592, 225, 452, 417, 1840, 45, 560, 1854, 440, 258, 1844, 1348, 1942, 1875, 1976, 1214, 758, 483, 66, 450, 1818, 463, 856, 1603, 1053, 395, 1687, 466, 1364, 266, 1280, 1820, 1450, 345, 783, 755, 1782, 1851, 167, 1279, 16, 1784, 1152, 1088, 1508, 554, 1352, 1571, 939, 1679, 1920, 1355, 1491, 462, 688, 129, 1369, 849, 1363, 1444, 357, 94, 489, 174, 978, 24, 1897, 1597, 1091, 1221, 1431, 907, 316, 787, 433, 34, 1310, 1767, 95, 499, 1042, 115, 1526, 1684, 345, 1924, 328, 988, 1657, 654, 1385, 933, 488, 722, 921, 1922, 1294, 978, 110, 1484, 657, 1755, 480, 1718, 248, 1013, 1038, 704, 28, 653, 818, 1602, 754, 863, 402, 241, 568, 804, 1828, 1053, 1695, 909, 1939, 437, 1835, 497, 418, 1593, 1865, 510, 739, 331, 1656, 610, 1842, 1287, 1635, 1807, 1436, 1331, 886, 1623, 959, 1003, 1835, 1783, 179, 1624, 320, 680, 1354, 490, 1149, 1057, 1788, 1747, 1815, 42, 1883, 1750, 595, 1444, 838, 1517, 1914, 487, 1945, 143, 1021, 1114, 605, 760, 1368, 497, 167, 72, 1950, 936, 601, 51, 318, 793, 1273, 1185, 1156, 249, 1182, 599, 822, 94, 1472, 1592, 1924, 1685, 736, 1441, 785, 1441, 1088, 1348, 1838, 35, 602, 1205, 74, 593, 1121, 652, 890, 1716, 1797, 878, 1441, 1832, 1432, 1801, 171, 1653, 361, 1664, 1304, 1346, 1320, 927, 1642, 1012, 836, 1683, 1760, 725, 1286, 508, 1847, 1253, 213, 282, 191, 67, 1110, 562, 1128, 529, 1708, 1106, 297, 593, 151, 92, 252, 935, 1270, 1131, 1079, 1424, 43, 491, 715, 1675, 1563, 1061, 1757, 1438, 891, 164, 429, 1288, 1030, 187, 1618, 1149, 1609, 103, 543, 1799, 536, 775, 1637, 213, 630, 1048, 861, 744, 1430, 825, 1455, 155, 1428, 423, 1210, 1721, 1567, 515, 504, 48, 804, 1689, 1638, 1543, 677, 1008, 1562, 1964, 473, 1103, 1325, 1166, 588, 1280, 887, 1268, 853, 501, 1045, 514, 200, 1013, 7, 65, 709, 273, 1859, 606, 977, 1896, 1582, 1093, 1598, 494, 994, 846, 1136, 94, 1536, 1621, 1486, 897, 270, 327, 1500, 288, 1567, 147, 1536, 1941, 868, 1065, 1470, 1990, 1848, 1790, 1682, 1572, 833, 403, 1148, 956, 986, 576, 1520, 231, 1568, 94, 286, 40, 131, 759, 965, 1423, 1028, 1303, 743, 1680, 565, 421, 706, 1712, 1070, 1035, 1028, 517, 1623, 1608, 645, 1203, 1164, 1563, 1260, 1132, 473, 529, 1910, 1694, 807, 1268, 719, 1472, 1861, 1495, 1809, 108, 100, 47, 962, 544, 1047, 2, 1007, 411, 1697, 1436, 1886, 1950, 1547, 1003, 608, 1959, 1448, 1083, 876, 568, 1499, 1832, 950, 498, 1392, 1048, 872, 1296, 1701, 1233, 1850, 1574, 1225, 919, 416, 1575, 646, 100, 155, 1162, 555, 848, 1435, 1036, 643, 1959, 146, 1804, 660, 760, 24, 778, 619, 1241, 609, 267, 1097, 463, 1151, 1998, 1129, 1711, 710, 463, 1585, 311, 724, 627, 586, 1032, 1313, 1347, 927, 1714, 12, 650, 397, 1913, 1854, 1433, 902, 1068, 635, 941, 1209, 1072, 954, 1984, 310, 149, 478, 182, 948, 156, 32, 844, 138, 972, 1451, 331, 1234, 1519, 1217, 1628, 1447, 676, 1851, 905, 1229, 1959, 1870, 1183, 609, 1718, 1096, 60, 1075, 1768, 1253, 513, 1356, 740, 317, 436, 553, 1130, 398, 770, 1681, 1167, 512, 1424, 462, 1522, 198, 1383, 1851, 1007, 1494, 533, 1221, 49, 754, 351, 278, 1295, 1573, 1230, 1060, 1972, 1769, 369, 1718, 937, 974, 494, 1201, 780, 1074, 316, 277, 1080, 1223, 61, 1446, 445, 720, 1086, 1520, 1713, 209, 67, 273, 720, 1291, 1307, 1985, 1966, 158, 1258, 1556, 1168, 1709, 1709, 1397, 142, 1706, 1524, 548, 1704, 181, 1070, 1933, 1178, 255, 140, 826, 692, 904, 1832, 574, 487, 1709, 1347, 1763, 1702, 96, 997, 1646, 1667, 508, 1235, 622, 1815, 759, 1109, 1370, 1513, 664, 1304, 739, 1196, 538, 1815, 1531, 1138, 133, 1095, 465, 1150, 480, 1292, 1061, 325, 683, 1069, 1458, 362, 1946, 1695, 46, 708, 1878, 880, 1196, 946, 447, 117, 418, 1146, 770, 1312, 28, 1600, 1093, 1377, 1949, 1894, 1815, 624, 1569, 1000, 532, 495, 1187, 1215, 173, 296, 1131, 1690, 1650, 1007, 1567, 969, 1258, 30, 1318, 1657, 619, 585, 691, 15, 676, 1319, 380, 1167, 1264, 1461, 1232, 1306, 1119, 1564, 547, 1322, 126, 1045, 175, 1382, 1693, 1980, 772, 151, 985, 728, 1495, 1762, 1745, 1059, 341, 1062, 59, 291, 1274, 1229, 1933, 1553, 323, 1213, 114, 19, 1951, 712, 1064, 1825, 570, 85, 459, 244, 842, 212, 1854, 1935, 1964, 639, 1813, 540, 1030, 1948, 1823, 618, 1422, 204, 1119, 169, 1246, 828, 290, 1318, 1389, 572, 721, 962, 1267, 1673, 29, 60, 1086, 1159, 158, 1409, 1302, 1500, 216, 129, 1207, 124, 327, 635, 1416, 1392, 523, 375, 1390, 1496, 596, 1746, 1592, 895, 579, 1741, 1795, 1141, 855, 269, 1490, 892, 667, 290, 609, 1753, 1453, 1870, 1789, 413, 1315, 1921, 1987, 990, 961, 1122, 501, 1655, 1902, 1996, 49, 346, 1572, 1771, 1076, 282, 468, 190, 580, 416, 1614, 160, 644, 1946, 638, 314, 1457, 36, 25, 1662, 1939, 652, 585, 976, 181, 675, 1759, 601, 1933, 1457, 1240, 140, 1239, 859, 220, 1143, 1320, 896, 1213, 327, 1285, 1263, 1289, 1373, 799, 1154, 1276, 40, 351, 646, 1665, 464, 1629, 239, 57, 1396, 1760, 596, 1590, 401, 523, 1866, 256, 1122, 1175, 1473, 921, 1785, 1726, 1494, 994, 560, 822, 1698, 377, 675, 1363, 1212, 176, 1026, 1398, 1718, 249, 1287, 1792, 776, 510, 1000, 801, 823, 1383, 724, 1305, 811, 1803, 1418, 1006, 167, 197, 1325, 233, 1491, 314, 857, 1652, 1104, 1641, 1931, 1861, 1381, 33, 548, 419, 564, 1003, 804, 1616, 969, 1330, 399, 963, 1920, 983, 903, 111, 270, 1255, 11, 1894, 959, 1669, 1196, 1015, 850, 792, 1906, 1404, 1392, 1635]
}
Once a test has been sent in Azure will create a new table in table storage automatically and we can navigate there to see our two input arrays, the output array and the runtime of the union algorithm.
If you haven't already, take a moment to download Azure Storage Explorer. Authenticate to your Azure subscription and then you can drill into Subscription --> Storage Accounts and then select the Storage Account you're using for your Functions.
When I select the "Sorting Table", this is set in the "function.json" file under the "tablename" key, I see the following:

Commit to Git
Now, we're ready to make a commit from Powershell which will trigger another deployment.
git add -A
git commit -m "Added WeightedQuickUnionWithPathCompression."
git push origin master
It should take a minute or so and then your function will be visible. Grab the URL just like we did yesterday. We will now be able to update the local address in Postman and send the same request to the Function hosted in Azure.

Conclusion
Today we added a new Function that takes two arrays as input and merges them. We've taken advantage of our continuous deployment we set up yesterday and committed out new changes to GitHub and saw the results published to Azure. We were then able to submit a test to our new live Function and we got back the results we were looking for.
Additionally, we can see that every request is written to Azure Table Storage and we can inspect the inputs, output and runtime of our merge algorithm.
What's next:
- After that we will take a look at how we can beautify our API and add testability to our API using Swagger. Additionally, we'll take a look at the Microsoft recommendations for testing an Azure Function.