This file contains hidden or 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 "nuget: Farmer" | |
open Farmer | |
// Give it a resource type. This is helpful the resource and handling dependencies. | |
let rightClickDeployments = ResourceType ("Microsoft.Hi/rightClickDeployments", "2021-06-29") | |
// Define the resource itself. | |
let minimalResource = | |
{ new IArmResource with |
This file contains hidden or 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 "nuget: Farmer, 1.6.0" | |
open Farmer | |
open Farmer.Builders | |
open Farmer.Builders.ContainerGroups | |
open Farmer.Builders.TrafficManager | |
open Farmer.TrafficManager | |
let msi = userAssignedIdentity { | |
name "my-app" |
This file contains hidden or 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
/// Several types of consoles | |
type Console = | |
| Playstation_5 | |
| Xbox_Series_X | |
| Switch | |
with | |
member this.Name = | |
match this with | |
| Playstation_5 -> "Playstation 5" | |
| Xbox_Series_X -> "XBox Series X" |
This file contains hidden or 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
open Microsoft.Extensions.Configuration | |
/// Builds a configuration source from raw JSON. | |
let configSourceFromJson (json:string) : IConfigurationSource = | |
{ new IConfigurationSource with | |
member this.Build (builder:IConfigurationBuilder) = | |
{ new ConfigurationProvider() with | |
member this.Load() = | |
this.Data <- Newtonsoft.Json.JsonConvert.DeserializeObject<Dictionary<string,string>> json | |
} :> IConfigurationProvider |
This file contains hidden or 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 "nuget: Farmer" | |
#r "nuget: MinecraftConfig" | |
#r "nuget: FSharp.Data" | |
open System | |
open Farmer | |
open Farmer.Builders | |
open FSharp.Data | |
open MinecraftConfig |
This file contains hidden or 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
let binding = CustomBinding () | |
let textMessageEncoding = TextMessageEncodingBindingElement () | |
textMessageEncoding.MessageVersion <- MessageVersion.Soap11 | |
let transport = HttpsTransportBindingElement (RequireClientCertificate=false, AllowCookies=true, MaxReceivedMessageSize=int64(Int32.MaxValue)) | |
binding.Elements.Add textMessageEncoding | |
binding.Elements.Add transport |
This file contains hidden or 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
open System | |
open Farmer | |
open Farmer.Builders | |
let deploymentLocation = Location.EastUS | |
let etcdDataStorage = storageAccount { | |
name "etcddata" | |
add_file_share_with_quota "data" 5<Gb> | |
} |
This file contains hidden or 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
{ | |
"$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentTemplate.json#", | |
"contentVersion": "1.0.0.0", | |
"outputs": {}, | |
"parameters": {}, | |
"resources": [ | |
{ | |
"apiVersion": "2018-11-30", | |
"dependsOn": [], | |
"location": "eastus", |
This file contains hidden or 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 | |
if [ "$#" -ne 2 ]; then | |
echo "Usage: deployment-cleanup.sh <subscription_id> <resource_group>" | |
exit 1 | |
fi | |
az group deployment list --subscription $1 -g $2 --query '[].{name:name,ts:properties.timestamp}[*].name' -o tsv | tail -n +100 | xargs -n1 az group deployment delete --subscription $1 -g $2 -n |
This file contains hidden or 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
type DivisionProblem = | |
{ | |
Dividend : int | |
Divisor : int | |
} | |
type DivisionSolution = | |
{ | |
Quotient : int | |
Remainder : int | |
Divisor : int |