Azure-cli: 'Create a rule for http to https redirect' - Example error.

Created on 6 Feb 2020  Â·  10Comments  Â·  Source: Azure/azure-cli

When testing out the example the following error occurs:

"validation error: Parameter 'UrlPathMatchConditionParameters.operator' can not be None"

azure-cli 2.0.81

The only thing i've changed is the resource-group, profile-name, endpoint-name


Document Details

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

Network - CDN Service Attention

All 10 comments

add to S166

@lsmith130 Hello. Can you take a look or help us find the correct person?

@hytao can you take a look at this?

@sondretj, could you please provide the full command you're executing? Feel free to redact the resource group, profile, and endpoint names from the command.

I see an error here. The --match-values has HTTPS, but you want to match on HTTP. Full example should look more like this:

az cdn endpoint rule add --resource-group xxx --profile-name xxx --name xxx \
    --order 1 --rule-name RedirectToHTTPS --match-variable RequestScheme \
    --operator Equal --match-values HTTP --action-name UrlRedirect \
    --redirect-protocol Https --redirect-type Found

I more or less reconstructed this from a az cdn endpoint rule show against an endpoint I have that I think is working correctly.

@sseveringhaus-newclassrooms Thanks, saved my day!

One question though: why the param value for action-name needs to be given fixed value?

The documentation gives the impression you could define it freely:
https://docs.microsoft.com/en-us/cli/azure/cdn/endpoint/rule?view=azure-cli-latest#required-parameters

True, but I believe the action name is one of the options in the dropdown in the Azure Portal:

  • Cache Expiration
  • Cache Key Query String
  • Modify Request Header
  • Modify Response Header
  • URL Redirect
  • URL Rewrite

Exactly how those translate to action names, I'm not sure, but you could probably make educated guesses. This should be added to the docs, I suppose.

True, but I believe the action name is one of the options in the dropdown in the Azure Portal:

  • Cache Expiration
  • Cache Key Query String
  • Modify Request Header
  • Modify Response Header
  • URL Redirect
  • URL Rewrite

Exactly how those translate to action names, I'm not sure, but you could probably make educated guesses. This should be added to the docs, I suppose.

@sseveringhaus-newclassrooms Thanks again!

@lsmith130 So I guess following detail should be added to documentation

--action-name
Name of the action.

_accepted values: CacheExpiration, CacheKeyQueryString, ModifyRequestHeader, ModifyResponseHeader, UrlRedirect, UrlRewrite_

Issue appears resolved; closing. Please re-comment if there's something we missed.

@KarenHammons, it doesn't look like either of the issues I brought up have been addressed, at least not in the published documentation. Is there a commit somewhere that resolved this, and perhaps it just hasn't been published yet?

Was this page helpful?
0 / 5 - 0 ratings