Skip to content

Commit

Permalink
Merge pull request #24 from Azure/juschen/add-tags
Browse files Browse the repository at this point in the history
Added ability set tags for Deploy script
  • Loading branch information
justinytchen authored Mar 14, 2024
2 parents 30a194d + ced6e31 commit 4ab7424
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 4 deletions.
5 changes: 4 additions & 1 deletion DeployGPO.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,9 @@ Param (
[System.String]$ArcRemoteShare,

[System.String]$AgentProxy,

[Hashtable]$Tags,

[System.String]$PrivateLinkScopeId,
[switch]$AssessOnly
)
Expand Down Expand Up @@ -255,7 +258,7 @@ try {
Write-Host "Install file `'AzureConnectedMachineAgent.msi`' successfully copied to $AzureArcDeployPath" -ForegroundColor Green
}

$infoTable = @{"ServicePrincipalClientId"="$ServicePrincipalClientId";"SubscriptionId"="$SubscriptionId";"ResourceGroup"="$ResourceGroup";"Location"="$Location";"TenantId"="$TenantId";"PrivateLinkScopeId"="$PrivateLinkScopeId"}
$infoTable = @{"ServicePrincipalClientId"="$ServicePrincipalClientId";"SubscriptionId"="$SubscriptionId";"ResourceGroup"="$ResourceGroup";"Location"="$Location";"TenantId"="$TenantId";"PrivateLinkScopeId"="$PrivateLinkScopeId"; "Tags"=$tags}
$infoTableJSON = $infoTable | ConvertTo-Json -Compress

if (Test-Path "$AzureArcDeployPath\ArcInfo.json" -ErrorAction SilentlyContinue) {
Expand Down
8 changes: 5 additions & 3 deletions EnableAzureArc.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -84,9 +84,11 @@ $location = $arcInfo.Location
$PrivateLinkScopeId = $arcInfo.PrivateLinkScopeId

$tags = @{ # Tags to be added to the Arc servers
Department = "Department"
deployedBY = "GPO"
Responsible = "Responsible"
DeployedBy = "GPO"
}

if($arcInfo.Tags){
$arcInfo.Tags.psobject.properties | Foreach { $tags[$_.Name] = $_.Value }
}

$workfolder = "$env:SystemDrive\temp"
Expand Down

0 comments on commit 4ab7424

Please sign in to comment.