Skip to content

Rewrite the Front Door sample around a catalog API and test it in CI - #124

Draft
DrisDary wants to merge 1 commit into
mainfrom
feat/front-door-sample
Draft

DrisDary wants to merge 1 commit into
mainfrom
feat/front-door-sample

Conversation

@DrisDary

Copy link
Copy Markdown
Contributor

The sample deployed five endpoints across five scenarios and was the only sample CI never tested, which hid three things that stopped it working against the emulator: it printed the wrong development alias, passed the Function App's host:port straight to --host-name, and forced an HTTPS redirect the emulator does not serve.

Two Function Apps now serve a small catalog API behind one endpoint with two routes, an origin group ordered by priority and a rule set that stamps a response header, rewrites /shop to /catalog and redirects a retired path at the edge. The scripts follow the convention of the other samples (deploy.sh, validate.sh, call-front-door.sh, cleanup.sh), and run-samples.sh now runs the validation: routing, route specificity, origin priority, the three rules, caching with purge, the headers the edge adds to the origin request, an origin error passing through, and the endpoint's enabled state.

deploy.sh supports both spellings of az afd rule create: the flattened arguments of Azure CLI 2.83 and earlier, and the --conditions/--actions shorthand of the cdn extension used from 2.85 on.

run-samples.sh also watches each sample's function/ folder, so a change to a sample's application code re-runs it in changed mode.

The sample deployed five endpoints across five scenarios and was the only sample CI
never tested, which hid three things that stopped it working against the emulator: it
printed the wrong development alias, passed the Function App's host:port straight to
--host-name, and forced an HTTPS redirect the emulator does not serve.

Two Function Apps now serve a small catalog API behind one endpoint with two routes, an
origin group ordered by priority and a rule set that stamps a response header, rewrites
/shop to /catalog and redirects a retired path at the edge. The scripts follow the
convention of the other samples (deploy.sh, validate.sh, call-front-door.sh,
cleanup.sh), and run-samples.sh now runs the validation: routing, route specificity,
origin priority, the three rules, caching with purge, the headers the edge adds to the
origin request, an origin error passing through, and the endpoint's enabled state.

deploy.sh supports both spellings of `az afd rule create`: the flattened arguments of
Azure CLI 2.83 and earlier, and the --conditions/--actions shorthand of the cdn
extension used from 2.85 on.

run-samples.sh also watches each sample's function/ folder, so a change to a sample's
application code re-runs it in changed mode.
@DrisDary DrisDary self-assigned this Sep 18, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant