function CheckTrafficManagers() {
    param(
    [Parameter(Mandatory)]
     [Microsoft.Azure.Commands.Profile.Models.Core.PSAzureContext]$subscription,
     [Parameter(Mandatory)]
     [Microsoft.Azure.Commands.TrafficManager.Models.TrafficManagerProfile[]] $trafficManagers,
     [Parameter(Mandatory)]
     [string]$effectoryDomainPattern
    )
    [EffectoryDomainNameCheck[]]$Result = @()
    
    # traffic manager => Assume binding 

    foreach($trafficManager in $trafficManagers) {
        $resource = Get-AzResource -ResourceId $trafficManager.Id
        $domainNameCheck = [EffectoryDomainNameCheck] @{
            SubscriptionId = $subscriptionId; 
            SubscriptionName = $subscription.Name;
            ResourceId = $trafficManager.Id;
            ResourceName = $trafficManager.Name;
            ResourceType = $resource.ResourceType;
            ResourceGroupName = $resource.ResourceGroupName;
            DomainName = $trafficManager.RelativeDnsName;
            Tag_Team = $resource.Tags.team
            Tag_Product = $resource.Tags.product
            Tag_Environment = $resource.Tags.environment
            Tag_Data = $resource.Tags.data
        }
        $Result += $domainNameCheck
    }

    $Result
}