# Create JSON structure
output="$( echo "{}" | \
jq --arg x "${login_output}" '.tasks.login=($x | fromjson)' | \
Reference: Metering service APIs - Microsoft commercial marketplace
Inconsistency in request data structures for "Marketplace metered billing APIs", between managed apps and SaaS offers
- When submitting a single event, the payload only seems to contain a
resourceId
, and the note says thatresourceId
has different meaning for SaaS app and for Managed app emitting custom meter.", being a resourceGroupID for managed apps, and the SaaS subscription GUID for SaaS.
It starts with an empty JSON object, and each jq
step in the pipeline further augments the structure. In case you want to step-by-step build up a JSON string in a shell.
The --arg
binds a string variable from bash to the jq-variable x
.
The jq expression ($x | fromjson)
parses the string into whatever JSON would be appropriate. So the bash variable true
becomes the proper true
boolean in the JSON. If we only would use $x
(instead of ($x | fromjson)
), the bash variable true
would become the JSON string "true"
.
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: Thoth.Json.Net, 7.1.0" | |
open Thoth.Json.Net | |
type Foo = | |
{ Name: string | |
Age: int } | |
module Encoders = | |
let fooDecoder : Decoder<Foo> = |
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
// My solution to https://strikecommunity.azurewebsites.net/articles/8612/course-introduction-to-the-rust-programming-langua-1.html | |
use std::collections::HashMap; | |
fn main() -> Result<(), std::io::Error> { | |
let mut arguments = std::env::args().skip(1); | |
let k = arguments.next().unwrap(); | |
let v = arguments.next().unwrap(); | |
let mut db = Database::from_disk("kv.db")?; |
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
using System; | |
using System.IO; | |
using System.Threading.Tasks; | |
using Azure; | |
using Azure.Storage.Blobs; | |
using Azure.Storage.Blobs.Models; | |
static class Program | |
{ | |
// https://github.com/Azure/azure-sdk-for-net/issues/22022 |
- Microsoft Documentation
- Welcome to the commercial marketplace | Microsoft Docs
- Plan a virtual machine offer
- Create an Azure virtual machine offer on Azure Marketplace ...
- Common questions about VM
- Relevant video walkthroughs related to VM publishing
- [Using Self-Test A
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 | |
mkdir device server | |
cd device | |
# Create a key pair | |
openssl genrsa -out device-priv.pem 2048 |