Az afd rule create error
See original GitHub issueThis 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:
- Created a year ago
- Comments:5 (3 by maintainers)
Top 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 >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
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):
That is what you will observe in the portal:
@t-bzhan @RakeshMohanMSFT Thanks for the explanation and the workaround! Greatly appreciated!