Traffic Manager

Overview

The Traffic Manager builder (trafficManager) creates traffic manager profiles and their associated endpoints.

  • Traffic Manager Profiles (Microsoft.Network/trafficManagerProfiles)
  • Traffic Manager Azure Endpoints (Microsoft.Network/trafficManagerProfiles/azureEndpoints)
  • Traffic Manager External Endpoints (Microsoft.Network/trafficManagerProfiles/externalEndpoints)

Builder Keywords

BuilderKeywordPurpose
trafficManagernameSets the name of the Traffic Manager profile.
trafficManagerdns_ttlSets the DNS TTL of the Traffic Manager profile, in seconds (default 30).
trafficManagerdisable_profileDisables the Traffic Manager profile.
trafficManagerenable_profileEnables the Traffic Manager profile.
trafficManagerrouting_methodSets the routing method of the Traffic Manager profile (default Performance).
trafficManagerenable_traffic_viewEnables the Traffic View of the Traffic Manager profile.
trafficManagerdisable_traffic_viewDisables the Traffic View of the Traffic Manager profile.
trafficManagermonitor_protocolSets the monitoring protocol of the Traffic Manager profile (default Https).
trafficManagermonitor_portSets the monitoring port of the Traffic Manager profile (default 443).
trafficManagermonitor_pathSets the monitoring path of the Traffic Manager profile (default /).
trafficManagermonitor_intervalSets the monitoring interval, in seconds, of the Traffic Manager profile (default 30).
trafficManagermonitor_timeoutSets the monitoring timeout, in seconds, of the Traffic Manager profile (default 10).
trafficManagermonitor_tolerated_failuresSets the monitoring tolerated number of failures, of the Traffic Manager profile (default 3).
trafficManageradd_endpointsAdds Endpoints to the Traffic Manager profile.
endpointnameSets the name of the Endpoint.
endpointweightSets the weight of the Endpoint.
endpointprioritySets the priority of the Endpoint.
endpointenable_endpointEnables the Endpoint.
endpointdisable_endpointDisables the Endpoint.
endpointtarget_webappSets the target of the Endpoint to a web app.
endpointtarget_externalSets the target of the Endpoint to an external domain/IP and location.

Example

open Farmer
open Farmer.Builders
open Farmer.TrafficManager

let myTrafficManager = trafficManager {
    name "my-trafficmanager-profile"
    routing_method RoutingMethod.Performance
    add_endpoints [ 
        endpoint {
            name "my-external-endpoint"
            weight 1
            priority 1
            target_external "mydomain.com" Location.WestUS
        }
        endpoint {
            name "my-web-app-endpoint"
            weight 1
            priority 2
            target_webapp (ResourceName "my-web-app")
        }
     ]
    monitor_path "/"
    monitor_port 443
    monitor_protocol Https
    monitor_interval 30<Seconds>
    monitor_timeout 5<Seconds>
    monitor_tolerated_failures 4
    enable_traffic_view
    dns_ttl 30<Seconds>
}

arm {
    location Location.EastUS
    add_resource myTrafficManager
}