Skip to content

Instantly share code, notes, and snippets.

View vladbarosan's full-sized avatar
🎯
Focusing

Vlad Barosan vladbarosan

🎯
Focusing
View GitHub Profile
package main
import (
"context"
"fmt"
"log"
"net/http"
"os"
"time"
@vladbarosan
vladbarosan / kvusage.go
Created November 5, 2018 19:13
useKv example go
package main
import (
mgmtkv "github.com/Azure/azure-sdk-for-go/services/keyvault/mgmt/2018-02-14/keyvault"
dataplanekv "github.com/Azure/azure-sdk-for-go/services/keyvault/v7.0/keyvault"
"github.com/Azure/go-autorest/autorest/azure"
"github.com/Azure/go-autorest/autorest/azure/auth"
)
func sampleKV(sess *AzureSession) {
package documentdb
// Copyright (c) Microsoft and contributors. All rights reserved.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
This file has been truncated, but you can view the full file.
{
"affectedPackages": {
"41868acf66911bfeeeb8cb23de731323f08e0320": [
"consumption/2018-05-31",
"services/2018-03-01-preview",
"policy/2018-03-01",
"adhybridhealthservice/2014-01-01",
"authoring/luis",
"network/2018-05-01",
"maps/2017-01-01-preview",
@vladbarosan
vladbarosan / parseResourceId.go
Last active March 21, 2018 23:53
Parse azure resource id in go
package main
import (
"fmt"
"regexp"
"strings"
)
func main() {
details, err := ParseResourceID("/subscriptions/subid-3-3-4/resourceGroups/regGroupVladdb/providers/Microsoft.Network/LoadBalancer/vladdbresourcetest")
@vladbarosan
vladbarosan / ajv.json
Created February 17, 2018 02:07
ajv vs zschema validation
[{
"keyword": "enum",
"dataPath": ".sku.name",
"schemaPath": "#/properties/sku/properties/name/enum",
"params": {
"allowedValues": ["Standard_LRS", "Standard_GRS", "Standard_RAGRS", "Standard_ZRS", "Premium_LRS"]
},
"message": "should be equal to one of the allowed values"
}, {
"keyword": "enum",
@vladbarosan
vladbarosan / aadAuthCodeExample.go
Last active July 30, 2020 08:50
aadAuthCodeExample.go
package main
import (
"fmt"
"math/rand"
"net/http"
"github.com/Azure/go-autorest/autorest/adal"
"github.com/Azure/go-autorest/autorest/azure"
)