Teglarni qo'llash
Azure PowerShell teglarni qo'llash uchun ikkita buyruqni taklif qiladi - New-AzTag va Update-AzTag. Bizda Az.Resources 1.12.0 yoki undan keyingi moduli bo'lishi kerak. Biz o'zimizning versiyamizni tekshirishimiz kerak. Biz ushbu modulni o'rnatishimiz yoki Azure PowerShell 3.6.1 yoki undan keyingi versiyasini o'rnatishimiz mumkin .
Yangi-AzTag resurs, resurs guruhi, yoki obuna barcha teglar o'rnini bosadi. Buyruqni chaqirganda, belgilashni xohlagan shaxsning resurs identifikatorini kiritishimiz kerak.
Quyidagi misol teglar to'plamini saqlash hisobiga taalluqlidir:
Azure PowerShell
$tags = @{"Dept"="Finance"; "Status"="Normal"}
$resource = Get-AzResource -Name demoStorage - ResourceGroup demoGroup
New-AzTag -ResourceId $resource.id -Tag $tags
Buyruq bajarilgandan so'ng, manbada ikkita teg borligiga e'tibor beramiz.
Chiqish
Properties :
Name Value
====== =======
Dept Finance
Status Normal
Azure PowerShell
$tags = @{"Team"="Compliance"; "Environment"="Production"}
New-AzTag -ResourceId $resource.id -Tag $tags
Chiqish
Properties :
Name Value
=========== ==========
Environment Production
Team Compliance
Do'stlaringiz bilan baham: |