@@ -354,6 +354,18 @@ hostBasic=""; hostMulti=""; hostSpec=""; hostRules=""; hostState=""
354354[[ " $DO_RULES " == " true" ]] && hostRules=$( resolve_ep_host " $epRules " )
355355[[ " $DO_STATE " == " true" ]] && hostState=$( resolve_ep_host " $epState " )
356356
357+ # Detect LocalStack environment for local URLs
358+ IS_LOCALSTACK=" false"
359+ ENVIRONMENT=$( az account show --query environmentName --output tsv 2> /dev/null || true)
360+ if [[ " $ENVIRONMENT " == " LocalStack" ]]; then
361+ IS_LOCALSTACK=" true"
362+ epBasicLocal=" ${epBasic} .afd.localhost.localstack.cloud:4566"
363+ epMultiLocal=" ${epMulti} .afd.localhost.localstack.cloud:4566"
364+ epSpecLocal=" ${epSpec} .afd.localhost.localstack.cloud:4566"
365+ epRulesLocal=" ${epRules} .afd.localhost.localstack.cloud:4566"
366+ epStateLocal=" ${epState} .afd.localhost.localstack.cloud:4566"
367+ fi
368+
357369# -------------------------------
358370# Persist environment for cleanup
359371# -------------------------------
@@ -379,20 +391,28 @@ echo "Deployment complete."
379391echo " Resource Group: $RESOURCE_GROUP "
380392if [[ " $DO_BASIC " == " true" ]]; then
381393 echo " [Basic] AFD Endpoint: https://$hostBasic /john"
394+ [[ " $IS_LOCALSTACK " == " true" ]] && echo " Local Endpoint: http://$epBasicLocal /john"
382395fi
383396if [[ " $DO_MULTI " == " true" ]]; then
384397 echo " [Multi] AFD Endpoint: https://$hostMulti /john"
398+ [[ " $IS_LOCALSTACK " == " true" ]] && echo " Local Endpoint: http://$epMultiLocal /john"
385399fi
386400if [[ " $DO_SPEC " == " true" ]]; then
387401 echo " [Spec] AFD Endpoint: https://$hostSpec /john (specific route)"
388402 echo " Also try: https://$hostSpec /jane (catch-all)"
403+ if [[ " $IS_LOCALSTACK " == " true" ]]; then
404+ echo " Local Endpoint: http://$epSpecLocal /john (specific route)"
405+ echo " Also try: http://$epSpecLocal /jane (catch-all)"
406+ fi
389407fi
390408if [[ " $DO_RULES " == " true" ]]; then
391409 echo " [Rules] AFD Endpoint: https://$hostRules /john"
392410 echo " Expect response header: X-CDN: MSFT (once propagation completes)."
411+ [[ " $IS_LOCALSTACK " == " true" ]] && echo " Local Endpoint: http://$epRulesLocal /john"
393412fi
394413if [[ " $DO_STATE " == " true" ]]; then
395414 echo " [State] AFD Endpoint: https://$hostState /john"
415+ [[ " $IS_LOCALSTACK " == " true" ]] && echo " Local Endpoint: http://$epStateLocal /john"
396416 echo " To test enabled-state toggle:"
397417 echo " az afd endpoint update -g $RESOURCE_GROUP --profile-name $profileName --endpoint-name $epState --enabled-state Disabled"
398418 echo " # Then re-enable:"
0 commit comments