Quantcast
Channel: Azure Networking (DNS, Traffic Manager, VPN, VNET) forum
Viewing all articles
Browse latest Browse all 6513

configure Azure Traffic manager for AzureVirtualMachine

$
0
0

Hello all,

I need some help creating a traffic Manager for 2 virtual machines.

This is the code i have to create it :

$profile = New-AzureRmTrafficManagerProfile -Name $name -RelativeDnsName "$dnsName" -ResourceGroupName $ResourceGroupPrimary -TrafficRoutingMethod "Performance" -Ttl 30 -MonitorProtocol "HTTP" -MonitorPort 80 -MonitorPath $monitorPath
        $cloud01 = Get-AzureRmResource -ResourceName $primaryEndpoint -ResourceGroupName  $ResourceGroupPrimary
        $cloud02 = Get-AzureRmResource -ResourceName $secondaryEndpoint -ResourceGroupName $ResourceGroupSecondary
        Add-AzureRmTrafficManagerEndpointConfig -EndpointName $primaryEndpoint -TrafficManagerProfile $profile -type AzureEndpoints -TargetResourceId $cloud01.ResourceId -EndpointStatus Enabled
        Add-AzureRmTrafficManagerEndpointConfig -EndpointName $secondaryEndpoint -TrafficManagerProfile $profile -type AzureEndpoints -TargetResourceId $cloud02.ResourceId -EndpointStatus Enabled
        Set-AzureRmTrafficManagerProfile –TrafficManagerProfile $profile


But when i set Set-AzureRmTrafficManagerProfile –TrafficManagerProfile $profile i get the following error: 

Set-AzureRmTrafficManagerProfile : BadRequest: The 'resourceTargetId' property of endpoint 'ftp01dasbalas' is invalid or missing. The property must be specified only for the following endpoint types: 
AzureEndpoints, NestedEndpoints. You must have read access to the resource to which it refers.
At line:1 char:1
+ Set-AzureRmTrafficManagerProfile –TrafficManagerProfile $profile
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : CloseError: (:) [Set-AzureRmTrafficManagerProfile], CloudException
    + FullyQualifiedErrorId : Microsoft.Azure.Commands.TrafficManager.SetAzureTrafficManagerProfile

Can anyone help me with this ?

The Virtual machines are created in the new api. 

Regards,

Arestas



Viewing all articles
Browse latest Browse all 6513

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>