This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
resources | |
| where type =~ 'microsoft.compute/virtualmachines' | |
| project vmId = id, vmName = name, vmZone = tostring(zones[0]), vmGroup = trim_end('\\d+$', name), appName = tags['Application Name'], location | |
| summarize vmCount = count(), zoneCount = dcountif(vmZone, isnotempty(vmZone)) by vmGroup | |
| where zoneCount < min_of(vmCount, 2) | |
| join kind=inner( | |
resources | |
| where type=~ 'microsoft.compute/virtualmachines' | |
| project vmId = id, vmName = name, vmZone = tostring(zones[0]), vmGroup = trim_end('\\d+$', name), appName = tags['Application Name'], location) on vmGroup | |
| project vmGroup, vmName, location, vmZone, vmId, appName |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Param( | |
[switch]$Help, | |
[int]$WarningLevelPct = 70, | |
$SubscriptionId, | |
$ResourceProvider, | |
$QuotaApiToken | |
) | |
if ($Debug.IsPresent) { | |
$DebugPreference = "Continue" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
param ( | |
[string]$subscriptionId = "", | |
[string]$bootDiagnosticsResourceGroup = "", | |
[string]$bootDiagnosticsStorageAccountName = "", | |
[string]$vmssId = "", | |
[switch]$keep, | |
[Parameter(Mandatory = $true)][string]$resourceGroup, | |
[Parameter(Mandatory = $true)][string]$vmName, | |
[Parameter(Mandatory = $true)][Int32]$zone | |
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
app_name=$1 | |
resource_group=$2 | |
settings=$(az functionapp config appsettings list \ | |
--resource-group "$resource_group" \ | |
--name "$app_name") | |
if [[ $? == 0 ]]; then # az command succeeded |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash -e | |
delete_aad_app() { | |
az ad app delete --id "$1" | |
echo "AAD app [$1] deleted." | |
} | |
usage() { | |
echo "Usage: $0 [-y]" | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#r "Newtonsoft.Json" | |
#r "Microsoft.WindowsAzure.Storage" | |
using System.Configuration; | |
using System.Net; | |
using Microsoft.AspNetCore.Mvc; | |
using Microsoft.Extensions.Primitives; | |
using Microsoft.WindowsAzure.Storage; | |
using Microsoft.WindowsAzure.Storage.Blob; | |
using Newtonsoft.Json; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#r "Newtonsoft.Json" | |
#r "Microsoft.WindowsAzure.Storage" | |
using System.Configuration; | |
using System.Net; | |
using Microsoft.AspNetCore.Mvc; | |
using Microsoft.Extensions.Primitives; | |
using Microsoft.WindowsAzure.Storage; | |
using Microsoft.WindowsAzure.Storage.Blob; | |
using Newtonsoft.Json; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System; | |
using System.Collections.Generic; | |
namespace Foo | |
{ | |
public static class DictionaryExtensions | |
{ | |
public static TValue ElementAtOrDefault<TKey, TValue>(this IDictionary<TKey, TValue> dictionary, TKey key) | |
{ | |
if (dictionary == null) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System.Collections.Generic; | |
using System.Linq; | |
namespace Mantle.Extensions | |
{ | |
public static class EnumerableExtensions | |
{ | |
public static IOrderedEnumerable<T> Order<T>(this IEnumerable<T> source) | |
{ | |
if (source == null) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System; | |
using System.Collections.Generic; | |
using System.Text; | |
namespace Extensions | |
{ | |
public static class FunctionalStringSplitExtension | |
{ | |
public static string[] Split(this string source, Func<char, bool> splitOn) | |
{ |
NewerOlder