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.Text; | |
using Azure.Identity; | |
using Azure.ResourceManager; | |
using Azure.ResourceManager.Storage; | |
using Azure.ResourceManager.Storage.Models; | |
using Azure.Storage.Blobs; | |
using Azure.Storage.Blobs.Models; | |
var resourceGroupName = "immutablestorage"; |
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
IAzure GetAzureClient() | |
{ | |
// az CLI app Id - DO NOT CHANGE THIS | |
const string clientId = "04b07795-8ddb-461a-bbee-02f9e1bf7b46"; | |
// Change those for your specific Azure subscription. | |
// TenantId is the directory id of the account you log in to for access your subscription | |
const string tenantId = "......"; | |
const string subscriptionId = "...."; |
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
name: Create a table | |
description: Creates a table. | |
host: EXCEL | |
api_set: {} | |
script: | |
content: | | |
$("#create-table").click(() => tryCatch(createTable)); | |
async function createTable() { | |
await Excel.run(async (context) => { |
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
Azure\Get-AzureStorageAccount |
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
AzureResourceManager\Get-AzureStorageAccount |
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
function Get-ScriptDirectory | |
{ | |
$Invocation = (Get-Variable MyInvocation -Scope 1).Value | |
Split-Path $Invocation.MyCommand.Path | |
} | |
# Trick to load in the Azure module | |
$preference = $ErrorActionPreference | |
$ErrorActionPreference = "SilentlyContinue" | |
Get-AzureAccount | Out-Null |
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
Switch-AzureMode AzureResourceManager |
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
# Read the contents | |
$pathToFile = "d:\somedir\somefile" | |
$vms = ConvertFrom-Json (Get-Content -Path $pathToFile | Out-String) | |
$vmsToBeCreated = @() | |
# Now loop over the objects and build the provisioning congs... | |
foreach ($vm in $vms) | |
{ |
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
# Filter below can be quite complex, below is an example | |
$json = ConvertTo-Json (Get-AzureVM | Where-Object {$_.Name -like "pa*" -and $_.ServiceName -notlike "*dr"}) -Depth 10 | |
$outputFile = "d:\somefolder\somefile" | |
Out-File -FilePath $outputFile -InputObject $json |
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
"outputs": { | |
"key1": { | |
"value": "value1", | |
"type" : "<type-of-value>" | |
} | |
} |
NewerOlder