Skip to content

Instantly share code, notes, and snippets.


Gregor Suttie gsuttie

View GitHub Profile
View InheritTagsfromResourceGroup.ps1
#Login to Azure
#List all Resources within the Subscription
$Resources = Get-AzureRmResource
#For each Resource apply the Tag of the Resource Group
Foreach ($resource in $Resources)
$Rgname = $resource.Resourcegroupname
View github actions
# Python example Azure Pipeline
- azure-pipelines
- master
- job: Ubuntu_testing
View customRoleDefinition.json
"Name": "Virtual Machine Operator (Custom)",
"Id": null,
"IsCustom": true,
"Description": "Allows to start and stop (deallocate) Azure VMs",
"Actions": [
gsuttie / gist:3b339a128eac2613d0eafa025bb6f5db
Last active Jul 8, 2020
PowerShell Script to Create Azure Custom RBAC Role
View gist:3b339a128eac2613d0eafa025bb6f5db
$subscription_id = (Get-AzContext)
(Get-Content -Path $HOME/customRoleDefinition.json) -Replace 'SUBSCRIPTION_ID', $subscription_id |
Set-Content -Path $HOME/customRoleDefinition.json
New-AzRoleDefinition -InputFile ./customRoleDefinition.json
View gist:92ed20b1cd1f2e0d87e3e2e090ce4708
public static string MakeCall2([ActivityTrigger] CallInfo callInfo, [Table("MadeCalls2", "AzureWebJobStorage")] out CallDetails calldetails, ILogger log)
log.LogWarning($"MakeCall {callInfo.Numbers}");
var madeCallId = Guid.NewGuid().ToString("N");
calldetails = new CallDetails
PartitionKey = "MadeCalls",
View gist:da19b253c079004d5f2d98d836bd93a3
public static async Task<int> PeriodicTask([OrchestrationTrigger] IDurableOrchestrationContext ctx, ILogger log)
var timesRun = ctx.GetInput<int>();
if (!ctx.IsReplaying)
log.LogWarning($"Starting the PeriodicTask activity {ctx.InstanceId}, {timesRun}");
await ctx.CallActivityAsync("A_PeriodicActivity", timesRun);
var nextRun = ctx.CurrentUtcDateTime.AddSeconds(30);
View gist:9e24da3d655bf66e490fd9ff3fd8d844
public static async Task<string> PeriodicTask3([OrchestrationTrigger] IDurableOrchestrationContext context, ILogger log)
var waitBetweenTries = TimeSpan.FromSeconds(100); // 3 tries in 5 minutes
var phoneNumbers = await context.CallActivityAsync<string[]>("A_GetNumbersFromStorage", null);
var callTime = context.CurrentUtcDateTime;
foreach (var phoneNumber in phoneNumbers)
You can’t perform that action at this time.