I want to list all my security groups but i want to check if any security group has instances or no, if yes i want to get this instances. How can i do that in code ? I just build function to get all security group.
@Override
public List<LocalSecurityGroupV2> getSecurityGroups(final List<String> securityGroupIds) {
return securityGroupIds
.stream()
.map(this::findSecurityGroupById)
.collect(Collectors.toList());
}
Can you please elaborate what do you mean by instances? Is this you are looking for?
Gets all network security groups in a subscription: https://learn.microsoft.com/en-us/rest/api/virtualnetwork/networksecuritygroups/listall
Gets all network security groups in a resource group: https://learn.microsoft.com/en-us/rest/api/virtualnetwork/networksecuritygroups/list