- Data Structure
- Networking
- RDBMS
- Operating System
- Java
- MS Excel
- iOS
- HTML
- CSS
- Android
- Python
- C Programming
- C++
- C#
- MongoDB
- MySQL
- Javascript
- PHP
- Physics
- Chemistry
- Biology
- Mathematics
- English
- Economics
- Psychology
- Social Studies
- Fashion Studies
- Legal Studies
- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who
How to get the tags of the availability set using PowerShell?
There are two ways to retrieve the availability set tags. Using the Tags property inside the availability tag and the second by using the Get-AzTag command.
Before running this command make sure that you are connected to the Azure Cloud (if not use ConnectAzAccount) and proper azure subscription (Set-AzContext to set the Azure subscription).
First, we will get the availability set properties and retrieve the tag property as shown below.
$availablityset = Get-AzAvailabilitySet -ResourceGroupName MYRESOURCEGROUPAVAILABILITY -Name myAvailabilitySet $availablityset.Tags
Output
To get the tags using resource ID, we need to retrieve the resource ID using the Get-AvailabilitySet command.
$availablityset = Get-AzAvailabilitySet -ResourceGroupName MYRESOURCEGROUPAVAILABILITY -Name myAvailabilitySet Get-AzTag -ResourceId $availablityset.Id | Select - ExpandProperty Properties
Output
Advertisements