This file contains 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
#Clear-Host | |
$classlist - ".\class-list.tsv" #contains a tab-delimited list of object ids, resource group names and locations | |
$tenant = "guid" | |
$app_id = "guid" | |
$app_key = ConvertTo-SecureString "key" -AsPlainText -Force | |
$cred = New-Object -TypeName pscredential -ArgumentList $app_id, $app_key | |
Login-AzureRmAccount -Credential $cred -ServicePrincipal -TenantId $tenant | |
Get-Content $classlist | ForEach-Object { | |
$tokens = $_ -split "\t" |
This file contains 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
for number in {1..20} | |
do | |
account=comp69052017a2 | |
account+=$number | |
az storage account create --name $account --resource-group COMP6905A2Storage --location eastus --sku Standard_LRS --encryption blob | jq ".name" | |
az storage account keys list --account-name $account --resource-group COMP6905A2Storage | jq '.[].value' | tr -s '\n' ',' | |
done | |
This file contains 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
az storage account keys list --account-name comp69052017a2test --resource-group COMP6905A2Storage |
This file contains 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
#ensure logged in to azure | |
#ensure default subscription is desired one | |
az storage account create --name comp69052017a2test \ #test storage account | |
--resource-group COMP6905A2Storage \#test resource group | |
--location eastus --sku Standard_LRS \ | |
--encryption blob |
This file contains 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
#Prior to doing this, ensure that user is logged in | |
# 'az login' works | |
#Then, if you have multiple subscriptions attached to account, select the appropriate one using: | |
# 'az account set --subscription <name or id>' | |
#command below: | |
az group create --name COMP6905A2Storage #name I used |
This file contains 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
#This works with a Classic Azure Cloud Service Web Role | |
$SubsciptionName = "<name>" | |
$CloudServiceName = "<web-role-name>" | |
Add-AzureAccount | |
Select-AzureSubscription -Name $SubscriptionName | |
Get-AzureRole -ServiceName $CloudServiceName | |
$username = "<username>" | |
$password = "<other-options-can-be-used>" | |
$securepassword = ConvertTo-SecureString -String $password -AsPlainText -Force |
This file contains 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
Sub FillRows() | |
For i = 1 To ThisWorkbook.Sheets.Count | |
Sheets(i).Activate | |
'You can add more code | |
With ActiveSheet | |
Dim lRow As Long | |
Dim lCol As Long | |
lRow = Cells(Rows.Count, 3).End(xlUp).Row | |
lCol = Cells(1, Columns.Count).End(xlToLeft).Column |
This file contains 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
#'I got this from here: https://github.com/Azure-Samples/active-directory-dotnet-graphapi-console/issues/27#issuecomment-155565140 | |
$Tenant = "[something].onmicrosoft.com"; | |
$tenantGuid = "[find this in the manifest]" | |
$graphver = "1.5" | |
$appID = "[also manifest, but portal, too.]" | |
$userVal = "[username]@" + $tenant | |
$pass = "[password]" | |
$creds = New-Object System.Management.Automation.PsCredential($userVal, (ConvertTo-SecureString $pass -AsPlainText -Force)) |
This file contains 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
#works with Azure in Powershell v 1.3.2 | |
clear | |
$StorageAccountName = "[storageaccountname]" | |
$Key = "[storageaccountkey]" | |
$Context = New-AzureStorageContext -StorageAccountKey $Key -StorageAccountName $StorageAccountName | |
$CorsRules = (@{ | |
AllowedHeaders=@("*"); | |
AllowedOrigins=@("*"); | |
ExposedHeaders=@("content-length"); | |
MaxAgeInSeconds=200; |