如何使用 PowerShell 向 Azure 資源組應用標記?
就像 Azure VM 一樣,我們可以將 Azure 標籤應用於資源組或任何其他資源。標記針對資源 ID 運作,在 Azure 中所有資源都帶有資源 ID 屬性。
要將標籤應用於 Azure 資源組,我們首先需要獲取資源組詳細資訊以使用其資源 ID。以下程式碼顯示瞭如何將新標籤應用於 Azure 資源組。
示例
PS C:\> $rg = Get-AzResourceGroup -Name AnsibleTestRG
PS C:\> $tag = @{Owner='Chirag'; CostCenter='USFinance'}
PS C:\> New-AZTag -ResourceId $rg.ResourceId -Tag $tag -Verbose輸出

廣告
資料結構
網路
RDBMS
作業系統
Java
iOS
HTML
CSS
Android
Python
C
C++
C#
MongoDB
MySQL
Javascript
PHP