question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Az afd rule create error

See original GitHub issue

This is autogenerated. Please review and update as needed.

Describe the bug

Error occurs when choosing ‘OriginOverride’ as the action-name.

Command Name az afd rule create

Errors:

The command failed with an unexpected error. Here is the traceback:
'NoneType' object has no attribute 'cli_ctx'
Traceback (most recent call last):
  File "D:\a\1\s\build_scripts\windows\artifacts\cli\Lib\site-packages\knack/cli.py", line 231, in invoke
  File "D:\a\1\s\build_scripts\windows\artifacts\cli\Lib\site-packages\azure/cli/core/commands/__init__.py", line 658, in execute
  File "D:\a\1\s\build_scripts\windows\artifacts\cli\Lib\site-packages\azure/cli/core/commands/__init__.py", line 721, in _run_jobs_serially
  File "D:\a\1\s\build_scripts\windows\artifacts\cli\Lib\site-packages\azure/cli/core/commands/__init__.py", line 692, in _run_job
  File "D:\a\1\s\build_scripts\windows\artifacts\cli\Lib\site-packages\azure/cli/core/commands/__init__.py", line 328, in __call__
  File "D:\a\1\s\build_scripts\windows\artifacts\cli\Lib\site-packages\azure/cli/core/commands/command_operation.py", line 121, in handler
  File "D:\a\1\s\build_scripts\windows\artifacts\cli\Lib\site-packages\azure/cli/command_modules/cdn/custom/custom_afdx.py", line 556, in create_afd_rule
  File "D:\a\1\s\build_scripts\windows\artifacts\cli\Lib\site-packages\azure/cli/command_modules/cdn/custom/custom.py", line 354, in create_action
AttributeError: 'NoneType' object has no attribute 'cli_ctx'

To Reproduce:

Steps to reproduce the behavior. Note that argument values have been redacted, as they may contain sensitive information.

  • Put any pre-requisite steps here…
  • az afd rule create --action-name {} --order {} --profile-name {} --resource-group {} --rule-name {} --rule-set-name {}

Expected Behavior

Environment Summary

Windows-10-10.0.22000-SP0
Python 3.8.9
Installer: MSI

azure-cli 2.34.1

Extensions:
front-door 1.0.16

Dependencies:
msal 1.16.0
azure-mgmt-resource 20.0.0

Additional Context

Issue Analytics

  • State:closed
  • Created a year ago
  • Comments:5 (3 by maintainers)

github_iconTop GitHub Comments

2reactions
t-bzhancommented, Apr 7, 2022

Hi @RakeshMohanMSFT and @RakeshMohanMSFT , the action “OriginGroupOverride” is deprecated in the latest release and you should use “RouteConfigurationOverride” instead.

The command grammar is like: az afd rule create --action-name RouteConfigurationOverride --order 1 --profile-name p-bugbash101 --resource-group bogroup --rule-name rule2204071 --rule-set-name rs0407

However this is a defect in the latest CLI release (2.0.35) which prevents the above command from executing successfully, we will fix the issue in next release.

As a workaround, you could use below commands to achieve the same effects with the latest CLI release (2.0.35):

az afd rule create --action-name ModifyResponseHeader --profile-name p-bugbash101 --resource-group bogroup --rule-name rule2204071 --rule-set-name rs0407 --header-action Delete --header-name dummy --order 1

az afd rule action add --action-name RouteConfigurationOverride --profile-name p-bugbash101 --resource-group bogroup --rule-name rule2204071 --rule-set-name rs0407 --origin-group og0407 --forwarding-protocol HttpOnly

az afd rule action remove --index 0 --profile-name p-bugbash101 --resource-group bogroup --rule-name rule2204071 --rule-set-name rs0407

That is what you will observe in the portal: image

1reaction
LotteVoorhorstcommented, Apr 7, 2022

@t-bzhan @RakeshMohanMSFT Thanks for the explanation and the workaround! Greatly appreciated!

Read more comments on GitHub >

github_iconTop Results From Across the Web

az afd rule - Microsoft Learn
az afd rule create. Creates a new delivery rule within the specified rule set. Azure CLI Copy.
Read more >
azure-cli 2.25.0 - PyPI
Fix #11871: AKV10032: Invalid issuer error for operations in nondefault tenant/subscription (#18162). az ... az afd rule create : Fix –help message (#17282)....
Read more >
URL Rewrite in Azure Front Door (Preview) Standard/Premium
Way 1: Use the Origin path in the Route config instead of a Rule. The Origin path overwrites the Pattern to match and...
Read more >
Azure Front Door Standard/Premium - Tips, Tricks, and ...
The error will look something like this: error": {\r\n "code": "Conflict",\r\n ... az afd custom-domain delete --profile-name my-afd ...
Read more >
There was an error when trying to write AFD rules files
Please note, that my installation folder contains no special characters (I have already checked the respective thread) and I have uninstalled and reinstalled...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found