Skip to content

Instantly share code, notes, and snippets.

Avatar

Jason Farrell xximjasonxx

View GitHub Profile
View msal.cs
// See https://aka.ms/new-console-template for more information
using Microsoft.Identity.Client;
var app = ConfidentialClientApplicationBuilder
.Create("a43255e1-24df-4b22-94e9-4e583e6301c3")
.WithClientSecret("RKP8Q~LKTGJKwzsItxnpIfIVG2XMAyPG1IhvIcpk")
.WithAuthority(new Uri("https://login.microsoftonline.com/81699cc3-1e16-40c8-afb9-5b4e2aac2dca"))
.Build();
var token = await app.AcquireTokenForClient(new[]
View ping.cs
#r "Newtonsoft.Json"
using System.Net;
using Microsoft.AspNetCore.Mvc;
using Microsoft.Extensions.Primitives;
using Newtonsoft.Json;
public static IActionResult Run(HttpRequest req, ILogger log)
{
return new OkObjectResult("ping");
View client.json
{
"snow_identifier": string,
"client_id": string,
"role_assignments": [
{
"backend_application_id": string,
"roles": [ string ]
}
]
}
View api.json
{
"snow_identifier": string,
"client_id": string (Guid),
"application_roles": [
{
"displayName": string,
"description": string,
"roleName": string
}
],
View main.tf
terraform {
}
variable storage_account_resource_group_name {
type = string
}
variable storage_account_name {
type = string
}
View main.tf
terraform {
}
variable storage_account_resource_group_name {
type = string
}
variable storage_account_name {
type = string
}
View main.tf
terraform {
required_providers {
azurerm = {
source = "hashicorp/azurerm"
version = "=3.30.0"
}
}
}
provider "azurerm" {
View objects-update.cs
public async Task<IActionResult> Run(
[Redis(key: "values", valueType: RedisValueType.Collection, Connection = "RedisConnectionString")] ICollector<Person> values)
{
values.Add(new Person { Id = "1", Name = "Name 1" });
values.Add(new Person { Id = "1", Name = "Name 2" });
}
View person.cs
public class Person : IRedisListItem
{
public string Name { get; set; }
public string Id { get; set; }
}
View objects-write.cs
public async Task<IActionResult> Run(
[Redis(key: "values", valueType: RedisValueType.Collection, Connection = "RedisConnectionString")] ICollector<Person> values)
{
values.Add(new Person { Name = "Name 1" });
values.Add(new Person { Name = "Name 2" });
}