Azure Blob Storage is part of the Microsoft Azure Storage service, providing a relatively low cost service for storing large amounts of unstructured data, such as text or blobs; “blobs” stands for Binary Large Objects. A blob is a collection of binary data stored as a single entity. It typically comprises images, audio, or any other file. In this tutorial,…
When you create an Azure website, you are automatically provided with a production slot that represents your live website. In addition, with each deployment slot, you are eligible to create up to four additional deployment slots that you may swap with the production slot or with the other non-production slots. Having this option, you can create more robust deployment workflows than just deploying your…
In order to sort a collection of objects based on another list that contains the proper order, we can create an extension method that performs a Join between these two collections and pass a func as innerKeySelector argument to allow us to sort this collection based on whatever key we want. Example
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 | // Object that we are going to use class Item { public int Id { get; set; } public string Name { get; set; } } // Initialize a collection of objects var items = new List<Item> { new Item {Id = 1, Name = "Item 1"}, new Item {Id = 3, Name = "Item 3"}, new Item {Id = 5, Name = "Item 5"}, new Item {Id = 2, Name = "Item 2"} }; // Sort items based on the following order of ids var sortedIds = new[] { 1, 2, 5, 3 }; // Sort items based on the following order of ids var sortedNames = new[] { "Item 1", "Item 5", "Item 3" }; var sortedById = items.SortBy(sortedIds, c => c.Id); var sortedByName = items.SortBy(sortedNames, c => c.Name); // Result { "sortedById": [ { "id": 1, "name": "Item 1" }, { "id": 2, "name": "Item 2" }, { "id": 5, "name": "Item 5" }, { "id": 3, "name": "Item 3" } ], "sortedByName": [ { "id": 1, "name": "Item 1" }, { "id": 5, "name": "Item 5" }, { "id": 3, "name": "Item 3" } ] } |
In a cloud environment, sooner or later, you may come across scenarios where some services might become temporarily unavailable, since you are depending, to a large extent, on network connections and external services. Usually, these are little glitches that may even be self-healing, however, in order not to ruin the user experience, you have to be prepared to handle them skillfully. Usually, in…
1 2 3 | DECLARE @DesiredLength AS INT = 10; SELECT Lower(substring(replace(newID(), '-', ''), cast(RAND() * (31 - @DesiredLength) AS INT), @DesiredLength)) AS RandomString; |
In Azure portal, if your account contributes to other azure subscriptions, you are allowed to switch from one to another using a drop-down menu at the top left corner. Problem is that by default the name used in Azure Active Directory is “Default Directory” which seems a little confusing. In order to change it to something more meaningful you can use the old windows azure portal,…
Since Azure SDK 2.7 for .NET App Service Tools for Visual Studio 2015 supports remote profiling for Web Apps, API Apps and WebJobs running in Azure. So, in case you want to analyze performance issues in your application there are three ways you can do it: Using Visual Studio 2015 Browsing the Azure App Service’s Site Control Management dashboard (aka kudu) Using…