Azure-docs: ARM template export missing "routingRules" for Redirect

Created on 6 Nov 2019  Â·  17Comments  Â·  Source: MicrosoftDocs/azure-docs

When I do an export of a Front Door to ARM then it looks like routingRules of type "Redirect" are missing from the export. Furthermore, I cannot find any docs on how to set them in ARM. Please advise.


Document Details

⚠ Do not edit this section. It is required for docs.microsoft.com ➟ GitHub issue linking.

Pri2 assigned-to-author cxp doc-enhancement frontdoosvc triaged

Most helpful comment

Bump. Front Door has been GA for more than a year. It is absolutely bonkers that this is still not fixed. This service is missing support for multiple features through ARM templates.

All 17 comments

@CasperJ Thanks for the feedback! I was able to reproduce this, and I am following up now to get more information.

We just ran into this issue too. I'll add that when you do export the templates it is using an old version of the API that I have been unable to find documentation for. It is using "2018-08-01", but the only versions I see in the Azure Documentation are "2019-03-01" or newer. Documentation: https://docs.microsoft.com/en-us/azure/templates/microsoft.network/frontdoors-allversions

@CasperJ What @AlphaCreative-Mike spoke about is correct, but you can get the JSON schema for redirect rules.

I was able to use Postman to pull the newer API versions, but any API query will work. I used these instructions to get a bearer token for auth.

If you have an existing Front Door with routing rules, you can pull the API: https://management.azure.com/subscriptions/{{subscriptionId}}/providers/Microsoft.Network/frontDoors?api-version=2019-05-01

I had better luck using the 2019-05-01 API.

Here is the routing rule of my test Front Door:

"routingRules": [
{
"id": "/subscriptions/xxxxx-xxxx-xxxx-xxxxx/resourcegroups/travtestfd/providers/Microsoft.Network/Frontdoors/travtesthost/RoutingRules/travrule",
"name": "travrule",
"type": "Microsoft.Network/Frontdoors/RoutingRules",
"properties": {
"frontendEndpoints": [
{
"id": "/subscriptions/xxxxx-xxxxx-xxxxxx-xxx/resourcegroups/travtestfd/providers/Microsoft.Network/Frontdoors/travtesthost/FrontendEndpoints/travtesthost-azurefd-net"
}
],
"acceptedProtocols": [
"Http",
"Https"
],
"patternsToMatch": [
"/*"
],
"enabledState": "Enabled",
"resourceState": "Enabled",
"routeConfiguration": {
"@odata.type": "#Microsoft.Azure.FrontDoor.Models.FrontdoorRedirectConfiguration",
"customFragment": null,
"customHost": "",
"customPath": "/redirect/",
"redirectProtocol": "HttpsOnly",
"customQueryString": null,
"redirectType": "Found"
}
}
}
],

Here is the associated portal configuration:

image

Please let me know if you need any additional information.

Another thing you can do is using the Azure CLI you can get the properties in JSON of the routing rule. You can take the values from what is returned with the command below and match them to the schema in the document here: https://docs.microsoft.com/en-us/azure/templates/microsoft.network/frontdoors-allversions

az network front-door routing-rule list --resource-group myResourceGroup --front-door-name myFrontDoor

@CasperJ We will now proceed to close this thread. If there are further questions regarding this matter, please tag me in your reply. We will gladly continue the discussion and we will reopen the issue.

@TravisCragg-MSFT - Why was this issue closed? I still don't see in the Azure Docs where it shows how to setup an HTTP Redirect. This section should have enough information to show how to define a RouteConfiguration object. https://docs.microsoft.com/en-us/azure/templates/microsoft.network/2019-05-01/frontdoors#routeconfiguration-object

@TravisCragg-MSFT - This issue needs reopened. Though you mentioned in this issue how to implement redirect rules the documentation is not updated.

@AlphaCreative-Mike I am re-opening the issue and assigning to the author to update as appropriate.

Are there any updates on this issue? It really is blocking our adoption of Front Door in my organization.

@nospoon4u - We are trying to implement everything through ARM templates but are routinely running into issues where either the ARM templates don't support what we need or there is no documentation for anything other than the most basic example. Right now we are using a combination of ARM templates, AZ CLI and Azure Powershell to fully deploy our application. Good luck!

By using az cli, I was able to get the correct ARM structure to implement Redirect Rules. This is still missing from the current 2019-05-01 Azure Front Door ARM definition:
{ "name": "HTTPS-Redirect", "properties": { "frontendEndpoints": [ { "id": "[variables('frontEndId')]" } ], "acceptedProtocols": [ "Http" ], "patternsToMatch": [ "/*" ], "enabledState": "Enabled", "resourceState": "Enabled", "routeConfiguration": { "@odata.type": "#Microsoft.Azure.FrontDoor.Models.FrontdoorRedirectConfiguration", "customFragment": null, "customHost": "", "customPath": "", "redirectProtocol": "HttpsOnly", "customQueryString": null, "redirectType": "Found" } } }

reassign: amitsriva

Bump. Front Door has been GA for more than a year. It is absolutely bonkers that this is still not fixed. This service is missing support for multiple features through ARM templates.

Just run into this issue now - please get this sorted

I managed to get this working by using the sample ARM template - make sure to check your "apiVersion" property

https://github.com/Azure/azure-quickstart-templates/blob/b393bdf8ad62a4dcbc92d61d971bb5b78e6a56ca/101-front-door-create-redirect/azuredeploy.json

Get the ARM configuration snippet by ex. using Az PowerShell

Get-AzResource -ResourceId $frontdoorResourceId -debug 5>&1 | clip

This will redirect the debug stream to your clipboard. Paste the content into an editor of your choice.

I got this working using apiVersion 2020-01-01 as in

        ...
        "type": "Microsoft.Network/frontdoors",
        "apiVersion": "2020-01-01",
        "name": "[parameters('frontdoor_name')]",
        "location": "Global",
        ...

Get the ARM configuration snippet by ex. using Az PowerShell

Get-AzResource -ResourceId $frontdoorResourceId -debug 5>&1 | clip

This will redirect the debug stream to your clipboard. Paste the content into an editor of your choice.

I got this working using apiVersion 2020-01-01 as in

        ...
        "type": "Microsoft.Network/frontdoors",
        "apiVersion": "2020-01-01",
        "name": "[parameters('frontdoor_name')]",
        "location": "Global",
        ...

Thanks spaelling - that should come in handy with any ARM template debugging.

Was this page helpful?
0 / 5 - 0 ratings