F# with Azure Blob Storage
F# – Scott Nimrod's Blog
by Bizmonger
3M ago
Repo The repo for this solution can be found here. Specification Library I often write compilable specifications for business apps. The process encourages moderate upfront-design considerations before codifying. Code The following 'Operations' module serves as an outline for blob storage operations: namespace BeachMobile.ImageService open System.Threading.Tasks open Language module Operations = module List = type ByContainer ..read more
Visit website
Data Retrieval with Azure CosmosDB and Redis
F# – Scott Nimrod's Blog
by Bizmonger
3M ago
CosmosDB and Redis are two data stores with different responsibilities. CosmosDB is a NoSQL data store that can serve as an alternative to SQL Server when using its SQL client API. Redis is a data cache technology that is meant to reduce latency, cost, and computing between client and server. The repo for this brain ..read more
Visit website
How to Create a Bearer Token
F# – Scott Nimrod's Blog
by Bizmonger
1y ago
Intro Here's the code that I learned to create for generating an authorization token: Writing the Test The following test was written to generate a bearer token: [<Test>] let ``get authorization token``() = let section = ConfigurationManager.GetSection("section.bearerToken") :?> NameValueCollection; let kvPairs = section.AllKeys.Select(fun k -> new KeyValuePair<string, string>(k, section[k])); let tenantId = kvPairs.Single(fun v -> ..read more
Visit website
Pulumi Code Examples
F# – Scott Nimrod's Blog
by Bizmonger
1y ago
My hobby project consists of building a mobile delivery platform. Thus, I needed some Infrastructure as Code (aka: IaC) to provision deployments. My goal was to have code structured as follows: Fortunately, I was able to learn the basics and write the proof of concept in a short amount of time. Here's some clients to ..read more
Visit website
F#: Azure Service Bus (Topic Subscription)
F# – Scott Nimrod's Blog
by Bizmonger
2y ago
Azure Topic Listener namespace Notifications.DataGateway open System open System.Text open System.Diagnostics open System.Threading.Tasks open Azure.Messaging.ServiceBus open Newtonsoft.Json open Notifications.DataTransfer open Notifications.DataGateway type AzureTopicListener<'T>(subscriptionInfo:SubscriptionInfo) as x = let topic = subscriptionInfo.Topic let subscription = subscriptionInfo.Subscription let connectionString = subscriptionInfo.ConnectionString let requested = Event<_>() let mutable serviceBusClient : ServiceBusClient = null let mutable processor : ServiceBusProcess ..read more
Visit website
F# Domain Modeling: IRS Tax Form 8889
F# – Scott Nimrod's Blog
by Bizmonger
2y ago
I've discovered that IRS tax forms can serve as mind-numbing code katas. I attempted to domain model HSA Form 8889 in F#. The code can be found on my GitHub account. Language namespace HSATaxForm_2020 open System module rec Language = module InEligible = type Coverage = MedicareTriCareTriCareLife type Amount = float ..read more
Visit website
F#: Extract key value pairs from an app config file
F# – Scott Nimrod's Blog
by Bizmonger
2y ago
The following snippet extracts key value pairs from the AppSettings section of an app config file: let appSettings = ConfigurationManager.AppSettings let serviceKeys = ConfigurationManager.AppSettings.AllKeys |> Seq.filter (fun k -> k.ToString().EndsWith "Fn") |> Seq.map (fun k -> (k,appSettings.GetValues(k).First())) <appSettings> <add key="MyAzureFn" value="some_value_1"/> <add key="MyOtherAzureFn" value="some_value_2"/> <add key="MyThirdAzureFn" value="some_value_3"/> </appSettings> ..read more
Visit website
Azure SignalR Client – Group connection
F# – Scott Nimrod's Blog
by Bizmonger
3y ago
SignalR Client using Microsoft.AspNetCore.SignalR.Client; using static OrderRequest.Core; namespace SignalR.Support { public enum Connection { IsDisconnected, IsConnecting, IsConnected, } public class ClientSignalR { static ClientSignalR _clientSignalR; public static ClientSignalR Instance { get { if (_clientSignalR == null) { _clientSignalR = new ClientSignalR(); } return _clientSignalR; } } private ClientSignalR() { } public event Action<object> OnMessageReceived; HubConnection ..read more
Visit website
F# SQLProvider: In Action
F# – Scott Nimrod's Blog
by Bizmonger
3y ago
Intro There's an F# library that provides an ORM experience that is arguably superior to Entity Framework. This library is the SqlProvider. Establishing Connection The following code establishes a connection to SQL Server: namespace DevOps.DataGateway open FSharp.Data.Sql module SqlConnection = //---------------------------------------------------------------------------------------------------- // UPDATE CONNECTION STRING !!! //---------------------------------------------------------------------------------------------------- [<Literal>] let string = "Data Source=MY_MACHINE_NAME\SqlExp ..read more
Visit website
Twilio Integration with F#
F# – Scott Nimrod's Blog
by Bizmonger
3y ago
Intro I decided to document some Twilio integration details for a hobby project that I'm working on. Sms Module Here's the core module for sending an Sms via Twilio: namespace CourierPayroll.DataGateway open Twilio open Twilio.Types open Twilio.Rest.Api.V2010.Account open CourierPayroll.DataTransfer module Sms = let formattedNumber (toPhone:string) = let usaCode = "+1" let phoneWithPrefix = if toPhone.Chars ..read more
Visit website

Follow F# – Scott Nimrod's Blog on FeedSpot

Continue with Google
Continue with Apple
OR