Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"azureFunctions.deploySubpath": ".",
"azureFunctions.projectLanguage": "PowerShell",
"azureFunctions.projectRuntime": "~3"
}
"azureFunctions.projectRuntime": "~4"
}
20 changes: 16 additions & 4 deletions AutoTagger/run.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -35,11 +35,23 @@ try {
} else {
$lastModifiedBy = $appid
}

$tags = @{
"LastModifiedBy" = $lastModifiedBy
"LastModifiedTimeStamp" = $time

# Check if resource was already tagged so we know if this is the creation of the resource
$alreadyTagged = Get-AzResource -TagName 'Created TimeStamp' -Name $resource.Name -ResourceGroupName $resource.ResourceGroupName
if ($alreadyTagged) {
$tags = @{
"LastModifiedBy" = $lastModifiedBy
"LastModifiedTimeStamp" = $time
}
}else {
$tags = @{
"LastModifiedBy" = $lastModifiedBy
"LastModifiedTimeStamp" = $time
"Created By" = $lastModifiedBy
"Created TimeStamp" = $time
}
}

try {
Update-AzTag -ResourceId $uri -Tag $tags -Operation Merge
}
Expand Down
5 changes: 3 additions & 2 deletions host.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,9 @@
"managedDependency": {
"Enabled": true
},
"functionTimeout": "00:10:00",
"extensionBundle": {
"id": "Microsoft.Azure.Functions.ExtensionBundle",
"version": "[1.*, 2.0.0)"
"version": "[3.3.0, 4.0.0)"
}
}
}