It is not possible to succeed with command az cdn profile create. The documentation is saying that we need to run it as follows: az afd profile create -g group --profile-name profile --sku Standard_AzureFrontDoor (without --location parameter). But when running, it is throwing an error The provided location 'polandcentral' is not available for resource type 'Microsoft.Cdn/profiles'. List of available regions for the resource type is 'global,australiaeast,australiasoutheast,brazilsouth,canadacentral,canadaeast,centralindia,centralus,eastasia,eastus,eastus2,japaneast,japanwest,northcentralus,northeurope,southcentralus,southindia,southeastasia,westeurope,westindia,westus,westcentralus'. (from debug I know that the location is taken from resource group). If I put the --location global parameter (which is not documented and not emphasized as required), I'm getting error like this: unrecognized arguments: --location global.
Related command
az cdn profile create
Errors
unrecognized arguments: --location global
Issue script & Debug output
cli.knack.cli: Command arguments: ['cdn', 'profile', 'create', '--resource-group', 'rg-frontend-nonprod-plc', '--name', 'cdn-name', '--sku', 'Standard_Microsoft', '--subscription', 'id', '--location', 'global', '--debug']
cli.knack.cli: init debug log:
Enable color in terminal.
cli.knack.cli: Event: Cli.PreExecute []
cli.knack.cli: Event: CommandParser.OnGlobalArgumentsCreate [<function CLILogging.on_global_arguments at 0x1012e5620>, <function OutputProducer.on_global_arguments at 0x10138c7c0>, <function CLIQuery.on_global_arguments at 0x1013ba2a0>]
cli.knack.cli: Event: CommandInvoker.OnPreCommandTableCreate []
cli.azure.cli.core: Modules found from index for 'cdn': ['azure.cli.command_modules.cdn']
cli.azure.cli.core: Loading command modules:
cli.azure.cli.core: Name Load Time Groups Commands
cli.azure.cli.core: cdn 2.328 14 51
cli.azure.cli.core: Total (1) 2.328 14 51
cli.azure.cli.core: These extensions are not installed and will be skipped: ['azext_ai_examples', 'azext_next']
cli.azure.cli.core: Loading extensions:
cli.azure.cli.core: Name Load Time Groups Commands Directory
cli.azure.cli.core: Total (0) 0.000 0 0
cli.azure.cli.core: Loaded 14 groups, 51 commands.
cli.azure.cli.core: Found a match in the command table.
cli.azure.cli.core: Raw command : cdn profile create
cli.azure.cli.core: Command table: cdn profile create
cli.knack.cli: Event: CommandInvoker.OnPreCommandTableTruncate [<function AzCliLogging.init_command_file_logging at 0x1020e3060>]
cli.azure.cli.core.azlogging: metadata file logging enabled - writing logs to '/Users/michal/.azure/commands/2024-04-24.17-08-50.cdn_profile_create.86532.log'.
az_command_data_logger: command args: cdn profile create --resource-group {} --name {} --sku {} --subscription {} --location {} --debug
cli.knack.cli: Event: CommandInvoker.OnPreArgumentLoad [<function register_global_subscription_argument..add_subscription_parameter at 0x102133ec0>]
cli.knack.cli: Event: CommandInvoker.OnPostArgumentLoad []
cli.knack.cli: Event: CommandInvoker.OnPostCommandTableCreate [<function register_ids_argument..add_ids_arguments at 0x102133f60>, <function register_cache_arguments..add_cache_arguments at 0x10215c0e0>]
cli.knack.cli: Event: CommandInvoker.OnCommandTableLoaded []
cli.knack.cli: Event: CommandInvoker.OnPreParseArgs []
cli.azure.cli.core.command_recommender: "--location" is an invalid parameter for command "cdn profile create".
urllib3.connectionpool: Starting new HTTPS connection (1): app.aladdin.microsoft.com:443
urllib3.connectionpool: https://app.aladdin.microsoft.com:443 "GET /api/v1.0/suggestions?query=%7B%22command%22%3A+%22cdn+profile+create%22%2C+%22parameters%22%3A+%22%22%7D&clientType=AzureCli&context=%7B%22versionNumber%22%3A+%222.59.0%22%2C+%22errorType%22%3A+%22UnrecognizedArguments%22%2C+%22correlationId%22%3A+%229522d614-01e9-4ac2-83e0-74c0cc884b5c%22%2C+%22subscriptionId%22%3A+%2206ee7b2a-5b29-4157-812e-42f98d1b2cbe%22%2C+%22eventId%22%3A+%22b301c087-b63e-463e-b3fa-561c87b8edf1%22%7D HTTP/1.1" 200 None
cli.azure.cli.core.command_recommender: "--location" is an invalid parameter for command "cdn profile create".
cli.azure.cli.core.command_recommender: "--location" is an invalid parameter for command "cdn profile create".
cli.azure.cli.core.azclierror: NoneType: None
cli.azure.cli.core.azclierror: unrecognized arguments: --location global
az_command_data_logger: unrecognized arguments: --location global
Examples from AI knowledge base:
az cdn profile create --resource-group group --name profile --sku Premium_Verizon
Create a CDN profile using Verizon premium CDN.
az cdn profile create --location westus2 --name profile --resource-group group --sku Standard_Verizon
Create a new CDN profile. (autogenerated)
https://docs.microsoft.com/en-US/cli/azure/cdn/profile#az_cdn_profile_create
Read more about the command in reference docs
cli.knack.cli: Event: Cli.PostExecute [<function AzCliLogging.deinit_cmd_metadata_logging at 0x1020e32e0>]
az_command_data_logger: exit code: 2
cli.main: Command ran in 3.832 seconds (init: 1.018, invoke: 2.814)
telemetry.main: Begin splitting cli events and extra events, total events: 1
telemetry.client: Accumulated 0 events. Flush the clients.
telemetry.main: Finish splitting cli events and extra events, cli events: 1
telemetry.save: Save telemetry record of length 4004 in cache
telemetry.main: Begin creating telemetry upload process.
telemetry.process: Creating upload process: "/opt/homebrew/Cellar/azure-cli/2.59.0/libexec/bin/python /opt/homebrew/Cellar/azure-cli/2.59.0/libexec/lib/python3.11/site-packages/azure/cli/telemetry/init.py /Users/michal/.azure"
telemetry.process: Return from creating process
telemetry.main: Finish creating telemetry upload process.
Expected behavior
It should create a CDN profile like when using REST API:
az rest --method put --uri "https://management.azure.com/subscriptions/id/resourceGroups/rg-frontend-nonprod-plc/providers/Microsoft.Cdn/profiles/cdn-name?api-version=2023-05-01" --body '{"location": "global","sku": {"name": "Standard_Microsoft"}}'
where this az rest command works (with location parameter).
Describe the bug
It is not possible to succeed with command
az cdn profile create
. The documentation is saying that we need to run it as follows:az afd profile create -g group --profile-name profile --sku Standard_AzureFrontDoor
(without --location parameter). But when running, it is throwing an error The provided location 'polandcentral' is not available for resource type 'Microsoft.Cdn/profiles'. List of available regions for the resource type is 'global,australiaeast,australiasoutheast,brazilsouth,canadacentral,canadaeast,centralindia,centralus,eastasia,eastus,eastus2,japaneast,japanwest,northcentralus,northeurope,southcentralus,southindia,southeastasia,westeurope,westindia,westus,westcentralus'. (from debug I know that the location is taken from resource group). If I put the--location global
parameter (which is not documented and not emphasized as required), I'm getting error like this: unrecognized arguments: --location global.Related command
az cdn profile create
Errors
unrecognized arguments: --location global
Issue script & Debug output
cli.knack.cli: Command arguments: ['cdn', 'profile', 'create', '--resource-group', 'rg-frontend-nonprod-plc', '--name', 'cdn-name', '--sku', 'Standard_Microsoft', '--subscription', 'id', '--location', 'global', '--debug'] cli.knack.cli: init debug log: Enable color in terminal. cli.knack.cli: Event: Cli.PreExecute [] cli.knack.cli: Event: CommandParser.OnGlobalArgumentsCreate [<function CLILogging.on_global_arguments at 0x1012e5620>, <function OutputProducer.on_global_arguments at 0x10138c7c0>, <function CLIQuery.on_global_arguments at 0x1013ba2a0>] cli.knack.cli: Event: CommandInvoker.OnPreCommandTableCreate [] cli.azure.cli.core: Modules found from index for 'cdn': ['azure.cli.command_modules.cdn'] cli.azure.cli.core: Loading command modules: cli.azure.cli.core: Name Load Time Groups Commands cli.azure.cli.core: cdn 2.328 14 51 cli.azure.cli.core: Total (1) 2.328 14 51 cli.azure.cli.core: These extensions are not installed and will be skipped: ['azext_ai_examples', 'azext_next'] cli.azure.cli.core: Loading extensions: cli.azure.cli.core: Name Load Time Groups Commands Directory cli.azure.cli.core: Total (0) 0.000 0 0.add_subscription_parameter at 0x102133ec0>]
cli.knack.cli: Event: CommandInvoker.OnPostArgumentLoad []
cli.knack.cli: Event: CommandInvoker.OnPostCommandTableCreate [<function register_ids_argument..add_ids_arguments at 0x102133f60>, <function register_cache_arguments..add_cache_arguments at 0x10215c0e0>]
cli.knack.cli: Event: CommandInvoker.OnCommandTableLoaded []
cli.knack.cli: Event: CommandInvoker.OnPreParseArgs []
cli.azure.cli.core.command_recommender: "--location" is an invalid parameter for command "cdn profile create".
urllib3.connectionpool: Starting new HTTPS connection (1): app.aladdin.microsoft.com:443
urllib3.connectionpool: https://app.aladdin.microsoft.com:443 "GET /api/v1.0/suggestions?query=%7B%22command%22%3A+%22cdn+profile+create%22%2C+%22parameters%22%3A+%22%22%7D&clientType=AzureCli&context=%7B%22versionNumber%22%3A+%222.59.0%22%2C+%22errorType%22%3A+%22UnrecognizedArguments%22%2C+%22correlationId%22%3A+%229522d614-01e9-4ac2-83e0-74c0cc884b5c%22%2C+%22subscriptionId%22%3A+%2206ee7b2a-5b29-4157-812e-42f98d1b2cbe%22%2C+%22eventId%22%3A+%22b301c087-b63e-463e-b3fa-561c87b8edf1%22%7D HTTP/1.1" 200 None
cli.azure.cli.core.command_recommender: "--location" is an invalid parameter for command "cdn profile create".
cli.azure.cli.core.command_recommender: "--location" is an invalid parameter for command "cdn profile create".
cli.azure.cli.core.azclierror: NoneType: None
cli.azure.cli.core: Loaded 14 groups, 51 commands. cli.azure.cli.core: Found a match in the command table. cli.azure.cli.core: Raw command : cdn profile create cli.azure.cli.core: Command table: cdn profile create cli.knack.cli: Event: CommandInvoker.OnPreCommandTableTruncate [<function AzCliLogging.init_command_file_logging at 0x1020e3060>] cli.azure.cli.core.azlogging: metadata file logging enabled - writing logs to '/Users/michal/.azure/commands/2024-04-24.17-08-50.cdn_profile_create.86532.log'. az_command_data_logger: command args: cdn profile create --resource-group {} --name {} --sku {} --subscription {} --location {} --debug cli.knack.cli: Event: CommandInvoker.OnPreArgumentLoad [<function register_global_subscription_argument.
cli.azure.cli.core.azclierror: unrecognized arguments: --location global az_command_data_logger: unrecognized arguments: --location global
Examples from AI knowledge base: az cdn profile create --resource-group group --name profile --sku Premium_Verizon Create a CDN profile using Verizon premium CDN.
az cdn profile create --location westus2 --name profile --resource-group group --sku Standard_Verizon Create a new CDN profile. (autogenerated)
https://docs.microsoft.com/en-US/cli/azure/cdn/profile#az_cdn_profile_create Read more about the command in reference docs cli.knack.cli: Event: Cli.PostExecute [<function AzCliLogging.deinit_cmd_metadata_logging at 0x1020e32e0>] az_command_data_logger: exit code: 2 cli.main: Command ran in 3.832 seconds (init: 1.018, invoke: 2.814) telemetry.main: Begin splitting cli events and extra events, total events: 1 telemetry.client: Accumulated 0 events. Flush the clients. telemetry.main: Finish splitting cli events and extra events, cli events: 1 telemetry.save: Save telemetry record of length 4004 in cache telemetry.main: Begin creating telemetry upload process. telemetry.process: Creating upload process: "/opt/homebrew/Cellar/azure-cli/2.59.0/libexec/bin/python /opt/homebrew/Cellar/azure-cli/2.59.0/libexec/lib/python3.11/site-packages/azure/cli/telemetry/init.py /Users/michal/.azure" telemetry.process: Return from creating process telemetry.main: Finish creating telemetry upload process.
Expected behavior
It should create a CDN profile like when using REST API:
az rest --method put --uri "https://management.azure.com/subscriptions/id/resourceGroups/rg-frontend-nonprod-plc/providers/Microsoft.Cdn/profiles/cdn-name?api-version=2023-05-01" --body '{"location": "global","sku": {"name": "Standard_Microsoft"}}'
where this az rest command works (with location parameter).
Environment Summary
azure-cli 2.59.0
core 2.59.0 telemetry 1.1.0
Extensions: account 0.2.5 azure-devops 0.26.0 azure-firewall 1.0.1 bastion 0.2.4 connectedk8s 1.3.16 dataprotection 0.10.0 managementpartner 0.1.3 ml 2.15.1 resource-graph 2.1.0 ssh 1.1.6
Dependencies: msal 1.27.0 azure-mgmt-resource 23.1.0b2
Python (Darwin) 3.11.9 (main, Apr 2 2024, 08:25:04) [Clang 15.0.0 (clang-1500.3.9.4)]
Additional context
When running command without --location parameter, then error is a little bit longer: