Skip to content
Closed
Show file tree
Hide file tree
Changes from 5 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,160 @@
{
"parameters": {
"api-version": "2018-08-01",
"subscriptionId": "subid",
"resourceGroupName": "rg1",
"frontDoorName": "frontDoor1",
"routingRuleName": "redirectRoutingRule1",
"routingRuleParameters": {
"name": "redirectRoutingRule1",
"properties": {
"routeType": [
"Redirect"
],
"frontendEndpoints": [
{
"id": "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/frontDoors/frontDoor1/frontendEndpoints/frontendEndpoint1"
},
{
"id": "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/frontDoors/frontDoor1/frontendEndpoints/default"
}
],
"acceptedProtocols": [
"Https"
],
"patternsToMatch": [
"/*"
],
"redirectConfiguration": {
"redirectType": [
"Moved(301)"
],
"destinationProtocol": [
"MatchRequest"
],
"destinationHost": "www.bing.com",
"destinationPath": "/api",
"preservePath": "false",
"preserveQueryString": "true"
},
"enabledState": "Enabled"
}
}
},
"responses": {
"200": {
"body": {
"id": "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/frontDoors/frontDoor1/redirectRoutingRule1",
"name": "redirectRoutingRule1",
"properties": {
"routeType": [
"Redirect"
],
"frontendEndpoints": [
{
"id": "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/frontDoors/frontDoor1/frontendEndpoints/frontendEndpoint1"
},
{
"id": "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/frontDoors/frontDoor1/frontendEndpoints/default"
}
],
"acceptedProtocols": [
"Https"
],
"patternsToMatch": [
"/*"
],
"redirectConfiguration": {
"redirectType": [
"Moved(301)"
],
"destinationProtocol": [
"MatchRequest"
],
"destinationHost": "www.bing.com",
"destinationPath": "/api",
"preservePath": "false",
"preserveQueryString": "true"
},
"enabledState": "Enabled"
}
}
},
"201": {
"body": {
"id": "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/frontDoors/frontDoor1/redirectRoutingRule1",
"name": "redirectRoutingRule1",
"properties": {
"routeType": [
"Redirect"
],
"frontendEndpoints": [
{
"id": "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/frontDoors/frontDoor1/frontendEndpoints/frontendEndpoint1"
},
{
"id": "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/frontDoors/frontDoor1/frontendEndpoints/default"
}
],
"acceptedProtocols": [
"Https"
],
"patternsToMatch": [
"/*"
],
"redirectConfiguration": {
"redirectType": [
"Moved(301)"
],
"destinationProtocol": [
"MatchRequest"
],
"destinationHost": "www.bing.com",
"destinationPath": "/api",
"preservePath": "false",
"preserveQueryString": "true"
},
"enabledState": "Enabled"
}
}
},
"202": {
"body": {
"id": "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/frontDoors/frontDoor1/redirectRoutingRule1",
"name": "redirectRoutingRule1",
"properties": {
"routeType": [
"Redirect"
],
"frontendEndpoints": [
{
"id": "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/frontDoors/frontDoor1/frontendEndpoints/frontendEndpoint1"
},
{
"id": "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/frontDoors/frontDoor1/frontendEndpoints/default"
}
],
"acceptedProtocols": [
"Https"
],
"patternsToMatch": [
"/*"
],
"redirectConfiguration": {
"redirectType": [
"Moved(301)"
],
"destinationProtocol": [
"MatchRequest"
],
"destinationHost": "www.bing.com",
"destinationPath": "/api",
"preservePath": "false",
"preserveQueryString": "true"
},
"enabledState": "Enabled"
}
}
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
{
"parameters": {
"api-version": "2018-08-01",
"subscriptionId": "subid",
"resourceGroupName": "rg1",
"frontDoorName": "frontDoor1",
"routingRuleName": "redirectRoutingRule1"
},
"responses": {
"200": {
"body": {
"id": "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/frontDoors/frontDoor1/redirectRoutingRule1",
"name": "redirectRoutingRule1",
"properties": {
"routeType": [
"Redirect"
],
"frontendEndpoints": [
{
"id": "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/frontDoors/frontDoor1/frontendEndpoints/frontendEndpoint1"
},
{
"id": "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/frontDoors/frontDoor1/frontendEndpoints/default"
}
],
"acceptedProtocols": [
"Https"
],
"patternsToMatch": [
"/*"
],
"redirectConfiguration": {
"redirectType": [
"Moved(301)"
],
"destinationProtocol": [
"Https"
],
"destinationHost": "www.bing.com",
"destinationPath": "/api",
"preservePath": "false",
"preserveQueryString": "true"
},
"enabledState": "Enabled"
}
}
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,42 @@
},
"enabledState": "Enabled"
}
},
{
"id": "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/frontDoors/frontDoor1/redirectRoutingRule1",
"name": "redirectRoutingRule1",
"properties": {
"routeType": [
"Redirect"
],
"frontendEndpoints": [
{
"id": "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/frontDoors/frontDoor1/frontendEndpoints/frontendEndpoint1"
},
{
"id": "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/frontDoors/frontDoor1/frontendEndpoints/default"
}
],
"acceptedProtocols": [
"Https"
],
"patternsToMatch": [
"/*"
],
"redirectConfiguration": {
"redirectType": [
"Moved(301)"
],
"destinationProtocol": [
"Https"
],
"destinationHost": "www.bing.com",
"destinationPath": "/api",
"preservePath": "false",
"preserveQueryString": "true"
},
"enabledState": "Enabled"
}
}
]
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -431,8 +431,11 @@
}
},
"x-ms-examples": {
"Get Routing Rule": {
"Get Forward Routing Rule": {
"$ref": "./examples/FrontdoorRoutingRuleGet.json"
},
"Get Redirect Routing Rule": {
"$ref": "./examples/FrontdoorRedirectRoutingRuleGet.json"
}
}
},
Expand Down Expand Up @@ -495,8 +498,11 @@
}
},
"x-ms-examples": {
"Create or update specific Routing Rule": {
"Create or update specific Forward Routing Rule": {
"$ref": "./examples/FrontdoorRoutingRuleCreate.json"
},
"Create or update specific Rediret Routing Rule": {
"$ref": "./examples/FrontdoorRedirectRoutingRuleCreate.json"
}
},
"x-ms-long-running-operation": true
Expand Down Expand Up @@ -1740,6 +1746,18 @@
"description": "Routing rules to apply to an endpoint",
"type": "object",
"properties": {
"routeType": {
"type": "string",
"enum": [
"Forward",
"Redirect"
],
"x-ms-enum": {
"name": "FrontDoorRouteType",
"modelAsString": true
},
"description": "Route type."
},
"frontendEndpoints": {
"description": "Frontend endpoints associated with this rule",
"type": "array",
Expand Down Expand Up @@ -1808,6 +1826,67 @@
"name": "FrontDoorEnabledState",
"modelAsString": true
}
},
"redirectConfiguration": {
"description": "A reference to the redirect routing configuration. ",
"$ref": "./network.json#/definitions/RedirectConfiguration"
}
}
},
"RedirectConfiguration": {
"description": "The configuration for a redirect routing rule. This object is needed only if the type property of RoutingRule is set to Redirect. ",
"type": "object",
"properties": {
"redirectType": {
"description": "The redirect type the rule will use when redirecting traffic.",
"type": "string",
"enum": [
"Moved(301)",
"Found(302)",
"TemporaryRedirect(307)",
"PermanentRedirect(308)"
],
"x-ms-enum": {
"name": "FrontDoorRedirectProtocol",
"modelAsString": true
}
},
"destinationProtocol": {

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The SharedSchema use "destinationSchema", better to be consistent
the other fields are already consistent

"description": "The protocol of the destination where the traffic is forwarded to",
"type": "string",
"enum": [
"MatchRequest",
"Http",
"Https"
],
"x-ms-enum": {
"name": "FrontDoorDestinationProtocol",
"modelAsString": true
}
},
"destinationHost": {
"type": "string",
"description": "If left blank, then we will use the incoming host as the destination host."
},
"destinationPath": {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: you can use pattern specifiers to enforce this. Not blocking on this.
An example here

"type": "string",
"description": "Path cannot be empty and must start with /."
},
"destinationFragment": {
"type": "string",
"description": "Fragment is the part of the URL that comes after #. Do not include the #."
},
"preservePath": {
"description": "Indicates whether the path is preserved.",
"type": "boolean"
},
"preserveQueryString": {
"description": "Indicates whether the query string is preserved.",
"type": "boolean"
},
"extraQueryString": {
"description": "Any string to be added to the query string in the destination URL. ? and & will be added automatically so do not include them.",
"type": "string"
}
}
},
Expand Down