Does this work with Azure Frontdoor? We are using Frontdoor and looking at the MS docs, they seem to be different products Azure CDN & Frontdoor

Command icon Show commands

Start within a Git clone of the project using the version control instructions.

Or, if you do not have SSH keys set up on git.drupalcode.org:

Comments

webfaqtory created an issue. See original summary.

smulvih2’s picture

@webfaqtory I had this conversation with someone else using the module. Apparently we just need to change /endpoints/ to /afdEndpoints/ and it should work. I wanted to add this as a drop-down option in the configuration, with CDN and Frontdoor as the options and change this part of the endpoint accordingly. Hope this helps. I would be interested in getting this update into the module to support both products.

gilesmc’s picture

I have patched this module to work with Frontdoor. As mentioned by @smulvih2 in his comment, it's not a huge change. I will create a fork here as soon as I can.

webfaqtory’s picture

Looking at the Frontdoor purge content API https://docs.microsoft.com/en-us/rest/api/frontdoorservice/frontdoor/endpoints/purge-content?tabs=HTTP, the Endpoint is:
https://management.azure.com/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/frontDoors/{frontDoorName}/purge?api-version=2019-05-01

In the module it is:
"https://management.azure.com/subscriptions/" . $subscription_id . "/resourceGroups/" . $resource_group_name . "/providers/Microsoft.Cdn/profiles/" . $profile_name . "/endpoints/" . $endpoint_name . "/purge?api-version=" . $api_version;

Still waiting for our Infrastruture team to setup access so I can't try it yet.

webfaqtory’s picture

@smulvih2 @gilesmc My Infrastucture team has setup access and I have created a fork so I can make the changes to support Frontdoor

gilesmc’s picture

@webfaqtory you were a bit faster than I was :-) I have pushed up my changes anyway, as I had already made them. I didn't make many of the text changes that you made, which are eminently sensible. One thing to note: I only managed to get the module to play nicely with the API using 2020-09-01 as the API version.

@smulvih2 over to you. I won't be upset if you go with @webfaqtory's changes :-)

smulvih2’s picture

This is great, really appreciate your input here guys! I'll take a look at the MRs and get a new dev version out for testing in the next few days. I still have a project running that uses Azure CDN so I can test to make sure nothing breaks on that end, if you guys can test to make sure Frontdoor works too. Thanks!!!

webfaqtory’s picture

@smulvih2 Hit a bit of a problem. Am getting access denied when trying to get the token via OAuth and the guy who set this up is now on holiday (I don't have access to Azure). Trying to find someone else who can do this. I'll keep you informed.

smulvih2’s picture

@webfaqtory will try to get a new dev release out sometime this week. When your Azure admin gets back then maybe you can test and provide feedback. Thanks!!!

smulvih2’s picture

Status: Active » Fixed

I merged MR #3 and brought other changes from MR #2 into the 1.0.x branch. Thanks for your work on this guys!!!

The only important difference I see between the two MRs was the Azure Frontdoor URL pattern. I have previously looked into the difference between Azure CDN and Frontdoor API URLs with @gilesmc and remember there was only a difference between /endpoints/ being changed to /afdEndpoints/. Please test these changes in the 1.0.x branch and report back. I will push a new release once I get your feedback on this. Thanks!

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.

webfaqtory’s picture

Finally got the correct credentials from the Infrastucture team and it worked 1st time. Sorry about the delay but it is nearly impossible to get them to do anything, even if there are site downs.

One change I made for our implimentation was having 2 permissions. The original "administer azure cdn purge" for Admins and a new "azure cdn purge" for the manual purge form. Didn't want site Editors to have access to the configuration form.

smulvih2’s picture

@webfaqtory glad to hear this is working for you! I'll push a new release shortly with the Azure Frontdoor changes.

I think having two permissions is a good idea, if you get a chance please push your changes to a new ticket and I can look at rolling this into the dev branch for testing. Thanks!