Skip to content

Instantly share code, notes, and snippets.

View JayDoubleu's full-sized avatar
🎯
Focusing

Jay W JayDoubleu

🎯
Focusing
View GitHub Profile
def set_headers(credentials):
headers = credentials.signed_session().headers
headers['Content-type'] = 'application/json'
return(headers)
@JayDoubleu
JayDoubleu / azure_subscription_partner.ps1
Created April 7, 2020 01:06
azure partner information powershell billing
function Get-AccessToken {
$context = Get-AzContext
$profile = [Microsoft.Azure.Commands.Common.Authentication.Abstractions.AzureRmProfileProvider]::Instance.Profile
$profileClient = New-Object -TypeName Microsoft.Azure.Commands.ResourceManager.Common.RMProfileClient -ArgumentList ($profile)
$token = $profileClient.AcquireAccessToken($context.Subscription.TenantId)
return $token.AccessToken
}
function Get-AzSubscriptionPartner {
param(
[Parameter(Mandatory = $true)]
- hosts: localhost
connection: local
vars:
exabgp_conf:
- section: neighbor
name: 127.0.0.15
config: |-
local-as 64512;
local-address 127.0.0.1;
description "Example neighbor";
import sys
import argparse
from azure.keyvault import KeyVaultClient
from azure.common.credentials import get_azure_cli_credentials
from msrestazure.azure_active_directory import MSIAuthentication
parser = argparse.ArgumentParser(
description=
'Script to retrieve azure keyvault secret using Microsoft MSI or Azure.Cli authentication'
)