The "az cdn endpoint update" command doesn't allow updating an existing endpoint origin (v2.59.0)
Describe the bug
I used to use the az cdn endpoint update command to update origin path for an existing endpoint. It was working fine for a long time, but in version 2.59.0 it throws InvalidResourceLocation error.
Related command
az cdn endpoint update --resource-group GGG --profile-name PPP --name NNN --origin-path OOO
Errors
(InvalidResourceLocation) The resource 'removed' already exists in location 'global' in resource group 'removed'. A resource with the same name cannot be created in location 'eastus'. Please select a new resource name.
Code: InvalidResourceLocation
Message: The resource 'removed' already exists in location 'global' in resource group 'removed'. A resource with the same name cannot be created in location 'eastus'. Please select a new resource name.
Issue script & Debug output
Uppercase strings are substitutes.
az cdn endpoint update --resource-group RESOURCE_GROUP --profile-name PROFILE_NAME --name ENDPOINT_NAME --origin-path /PATH --debug cli.knack.cli: Command arguments: ['cdn', 'endpoint', 'update', '--resource-group', 'RESOURCE_GROUP', '--profile-name', 'PROFILE_NAME', '--name', 'ENDPOINT_NAME', '--origin-path', '/PATH', '--debug'] cli.knack.cli: __init__ debug log: Enable color in terminal. cli.knack.cli: Event: Cli.PreExecute [] cli.knack.cli: Event: CommandParser.OnGlobalArgumentsCreate [, , ] 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 0.422 14 60 cli.azure.cli.core: Total (1) 0.422 14 60 cli.azure.cli.core: These extensions are not installed and will be skipped: ['azext_next'] cli.azure.cli.core: Loading extensions: cli.azure.cli.core: Name Load Time Groups Commands Directory cli.azure.cli.core: ai-examples 0.107 1 1 /usr/lib/python3.9/site-packages/azure-cli-extensions/ai-examples cli.azure.cli.core: Total (1) 0.107 1 1 cli.azure.cli.core: Loaded 15 groups, 61 commands. cli.azure.cli.core: Found a match in the command table. cli.azure.cli.core: Raw command : cdn endpoint update cli.azure.cli.core: Command table: cdn endpoint update cli.knack.cli: Event: CommandInvoker.OnPreCommandTableTruncate [ ] cli.azure.cli.core.azlogging: metadata file logging enabled - writing logs to '/home/andriy/.azure/commands/2024-04-11.12-59-00.cdn_endpoint_update.989.log'. az_command_data_logger: command args: cdn endpoint update --resource-group {} --profile-name {} --name {} --origin-path {} --debug cli.knack.cli: Event: CommandInvoker.OnPreArgumentLoad [ .add_subscription_parameter at 0x7f85536091f0>] cli.knack.cli: Event: CommandInvoker.OnPostArgumentLoad [] cli.knack.cli: Event: CommandInvoker.OnPostCommandTableCreate [ .add_ids_arguments at 0x7f85536381f0>, .add_cache_arguments at 0x7f85535d90d0>] cli.knack.cli: Event: CommandInvoker.OnCommandTableLoaded [] cli.knack.cli: Event: CommandInvoker.OnPreParseArgs [] cli.knack.cli: Event: CommandInvoker.OnPostParseArgs [ , , .parse_ids_arguments at 0x7f85535d9040>] cli.azure.cli.core.commands.client_factory: Getting management service client client_type=ResourceManagementClient urllib3.connectionpool: Starting new HTTP connection (1): localhost:50342 urllib3.connectionpool: http://localhost:50342 "POST /oauth2/token HTTP/1.1" 200 2274 msrestazure.azure_active_directory: MSI: Retrieving a token from http://localhost:50342/oauth2/token, with payload {'resource': 'https://management.core.windows.net/'} cli.azure.cli.core.auth.adal_authentication: MSIAuthenticationWrapper.get_token: scopes=('https://management.core.windows.net//.default',), kwargs={} urllib3.connectionpool: Starting new HTTP connection (1): localhost:50342 urllib3.connectionpool: http://localhost:50342 "POST /oauth2/token HTTP/1.1" 200 2274 msrestazure.azure_active_directory: MSI: Retrieving a token from http://localhost:50342/oauth2/token, with payload {'resource': 'https://management.core.windows.net/'} cli.azure.cli.core.auth.adal_authentication: Normalize expires_on: '1712845126' -> 1712845126 cli.azure.cli.core.sdk.policies: Request URL: 'https://management.azure.com/subscriptions/SUBSCRIPTION_ID/resourcegroups/RESOURCE_GROUP?api-version=2022-09-01' cli.azure.cli.core.sdk.policies: Request method: 'GET' cli.azure.cli.core.sdk.policies: Request headers: cli.azure.cli.core.sdk.policies: 'Accept': 'application/json' cli.azure.cli.core.sdk.policies: 'x-ms-client-request-id': '4399493e-f803-11ee-9b69-00155d8c83eb' cli.azure.cli.core.sdk.policies: 'CommandName': 'cdn endpoint update' cli.azure.cli.core.sdk.policies: 'ParameterSetName': '--resource-group --profile-name --name --origin-path --debug' cli.azure.cli.core.sdk.policies: 'User-Agent': 'AZURECLI/2.59.0 (RPM) azsdk-python-core/1.28.0 Python/3.9.19 (Linux-5.10.102.2-microsoft-standard-x86_64-with-glibc2.35) cloud-shell/1.0' cli.azure.cli.core.sdk.policies: 'Authorization': '*****' cli.azure.cli.core.sdk.policies: Request body: cli.azure.cli.core.sdk.policies: This request has no body urllib3.connectionpool: Starting new HTTPS connection (1): management.azure.com:443 urllib3.connectionpool: https://management.azure.com:443 "GET /subscriptions/SUBSCRIPTION_ID/resourcegroups/RESOURCE_GROUP?api-version=2022-09-01 HTTP/1.1" 200 227 cli.azure.cli.core.sdk.policies: Response status: 200 cli.azure.cli.core.sdk.policies: Response headers: cli.azure.cli.core.sdk.policies: 'Cache-Control': 'no-cache' cli.azure.cli.core.sdk.policies: 'Pragma': 'no-cache' cli.azure.cli.core.sdk.policies: 'Content-Type': 'application/json; charset=utf-8' cli.azure.cli.core.sdk.policies: 'Expires': '-1' cli.azure.cli.core.sdk.policies: 'x-ms-ratelimit-remaining-subscription-reads': '11999' cli.azure.cli.core.sdk.policies: 'x-ms-request-id': '9df1c027-dd67-49c0-87b7-14a016a8f1e9' cli.azure.cli.core.sdk.policies: 'x-ms-correlation-request-id': '9df1c027-dd67-49c0-87b7-14a016a8f1e9' cli.azure.cli.core.sdk.policies: 'x-ms-routing-request-id': 'WESTEUROPE:20240411T125900Z:9df1c027-dd67-49c0-87b7-14a016a8f1e9' cli.azure.cli.core.sdk.policies: 'Strict-Transport-Security': 'max-age=31536000; includeSubDomains' cli.azure.cli.core.sdk.policies: 'X-Content-Type-Options': 'nosniff' cli.azure.cli.core.sdk.policies: 'Date': 'Thu, 11 Apr 2024 12:59:00 GMT' cli.azure.cli.core.sdk.policies: 'Content-Length': '227' cli.azure.cli.core.sdk.policies: Response content: cli.azure.cli.core.sdk.policies: {"id":"/subscriptions/SUBSCRIPTION_ID/resourceGroups/RESOURCE_GROUP","name":"RESOURCE_GROUP","type":"Microsoft.Resources/resourceGroups","location":"eastus","tags":{},"properties":{"provisioningState":"Succeeded"}} cli.azure.cli.core.aaz._arg_fmt: using location 'eastus' from resource group 'RESOURCE_GROUP' urllib3.connectionpool: Starting new HTTP connection (1): localhost:50342 urllib3.connectionpool: http://localhost:50342 "POST /oauth2/token HTTP/1.1" 200 2274 msrestazure.azure_active_directory: MSI: Retrieving a token from http://localhost:50342/oauth2/token, with payload {'resource': 'https://management.core.windows.net/'} cli.azure.cli.core.auth.adal_authentication: MSIAuthenticationWrapper.get_token: scopes=('https://management.core.windows.net//.default',), kwargs={} urllib3.connectionpool: Starting new HTTP connection (1): localhost:50342 urllib3.connectionpool: http://localhost:50342 "POST /oauth2/token HTTP/1.1" 200 2274 msrestazure.azure_active_directory: MSI: Retrieving a token from http://localhost:50342/oauth2/token, with payload {'resource': 'https://management.core.windows.net/'} cli.azure.cli.core.auth.adal_authentication: Normalize expires_on: '1712845126' -> 1712845126 cli.azure.cli.core.sdk.policies: Request URL: 'https://management.azure.com/subscriptions/SUBSCRIPTION_ID/resourceGroups/RESOURCE_GROUP/providers/Microsoft.Cdn/profiles/PROFILE_NAME/endpoints/ENDPOINT_NAME?api-version=2023-05-01' cli.azure.cli.core.sdk.policies: Request method: 'GET' cli.azure.cli.core.sdk.policies: Request headers: cli.azure.cli.core.sdk.policies: 'Accept': 'application/json' cli.azure.cli.core.sdk.policies: 'x-ms-client-request-id': '4399493e-f803-11ee-9b69-00155d8c83eb' cli.azure.cli.core.sdk.policies: 'CommandName': 'cdn endpoint update' cli.azure.cli.core.sdk.policies: 'ParameterSetName': '--resource-group --profile-name --name --origin-path --debug' cli.azure.cli.core.sdk.policies: 'User-Agent': 'AZURECLI/2.59.0 (RPM) azsdk-python-core/1.28.0 Python/3.9.19 (Linux-5.10.102.2-microsoft-standard-x86_64-with-glibc2.35) cloud-shell/1.0' cli.azure.cli.core.sdk.policies: 'Authorization': '*****' cli.azure.cli.core.sdk.policies: Request body: cli.azure.cli.core.sdk.policies: This request has no body urllib3.connectionpool: Starting new HTTPS connection (1): management.azure.com:443 urllib3.connectionpool: https://management.azure.com:443 "GET /subscriptions/SUBSCRIPTION_ID/resourceGroups/RESOURCE_GROUP/providers/Microsoft.Cdn/profiles/PROFILE_NAME/endpoints/ENDPOINT_NAME?api-version=2023-05-01 HTTP/1.1" 200 3240 cli.azure.cli.core.sdk.policies: Response status: 200 cli.azure.cli.core.sdk.policies: Response headers: cli.azure.cli.core.sdk.policies: 'Cache-Control': 'no-cache' cli.azure.cli.core.sdk.policies: 'Pragma': 'no-cache' cli.azure.cli.core.sdk.policies: 'Content-Length': '3240' cli.azure.cli.core.sdk.policies: 'Content-Type': 'application/json; charset=utf-8' cli.azure.cli.core.sdk.policies: 'Expires': '-1' cli.azure.cli.core.sdk.policies: 'Strict-Transport-Security': 'max-age=31536000; includeSubDomains' cli.azure.cli.core.sdk.policies: 'x-ms-request-id': '311785dd-de65-44fb-9701-a2c2c98093ca' cli.azure.cli.core.sdk.policies: 'x-ms-client-request-id': '4399493e-f803-11ee-9b69-00155d8c83eb' cli.azure.cli.core.sdk.policies: 'Server': 'Kestrel' cli.azure.cli.core.sdk.policies: 'x-ms-ratelimit-remaining-subscription-resource-requests': '499' cli.azure.cli.core.sdk.policies: 'x-ms-correlation-request-id': 'ac3003bc-926c-4a50-929a-6da9f70ba059' cli.azure.cli.core.sdk.policies: 'x-ms-routing-request-id': 'WESTEUROPE:20240411T125900Z:ac3003bc-926c-4a50-929a-6da9f70ba059' cli.azure.cli.core.sdk.policies: 'X-Content-Type-Options': 'nosniff' cli.azure.cli.core.sdk.policies: 'Date': 'Thu, 11 Apr 2024 12:59:00 GMT' cli.azure.cli.core.sdk.policies: Response content: cli.azure.cli.core.sdk.policies: {"id":"/subscriptions/SUBSCRIPTION_ID/resourcegroups/RESOURCE_GROUP/providers/Microsoft.Cdn/profiles/PROFILE_NAME/endpoints/ENDPOINT_NAME","type":"Microsoft.Cdn/profiles/endpoints","name":"ENDPOINT_NAME","location":"Global","tags":{},"properties":{"hostName":"ENDPOINT_NAME.azureedge.net","originHostHeader":"PREFIX.blob.core.windows.net","originPath":"/ORIGIN_PATH","contentTypesToCompress":["application/eot","application/font","application/font-sfnt","application/javascript","application/json","application/opentype","application/otf","application/pkcs7-mime","application/truetype","application/ttf","application/vnd.ms-fontobject","application/xhtml+xml","application/xml","application/xml+rss","application/x-font-opentype","application/x-font-truetype","application/x-font-ttf","application/x-httpd-cgi","application/x-javascript","application/x-mpegurl","application/x-opentype","application/x-otf","application/x-perl","application/x-ttf","font/eot","font/ttf","font/otf","font/opentype","image/svg+xml","text/css","text/csv","text/html","text/javascript","text/js","text/plain","text/richtext","text/tab-separated-values","text/xml","text/x-script","text/x-component","text/x-java-source"],"isCompressionEnabled":true,"isHttpAllowed":true,"isHttpsAllowed":true,"queryStringCachingBehavior":"IgnoreQueryString","optimizationType":"GeneralWebDelivery","probePath":null,"origins":[{"name":"PREFIX-blob-core-windows-net","properties":{"hostName":"PREFIX.blob.core.windows.net","httpPort":null,"httpsPort":null,"originHostHeader":"PREFIX.blob.core.windows.net","priority":1,"weight":1000,"enabled":true,"privateLinkAlias":null,"privateLinkResourceId":null,"privateLinkLocation":null,"privateEndpointStatus":null,"privateLinkApprovalMessage":null}}],"originGroups":[],"defaultOriginGroup":null,"customDomains":[{"name":"DOMAIN_NAME","properties":{"hostName":"HOST_NAME","validationData":null}}],"geoFilters":[],"deliveryPolicy":{"description":"","rules":[{"name":"HttpsRedirection","order":1,"conditions":[{"name":"RequestScheme","parameters":{"typeName":"DeliveryRuleRequestSchemeConditionParameters","matchValues":["HTTP"],"operator":"Equal","negateCondition":false,"transforms":[]}}],"actions":[{"name":"UrlRedirect","parameters":{"typeName":"DeliveryRuleUrlRedirectActionParameters","redirectType":"Found","destinationProtocol":"Https","customQueryString":null,"customPath":null,"customHostname":null,"customFragment":null}}]},{"name":"RewriteUrl","order":2,"conditions":[{"name":"UrlPath","parameters":{"typeName":"DeliveryRuleUrlPathMatchConditionParameters","operator":"Wildcard","negateCondition":true,"matchValues":["/*.*"],"transforms":[]}}],"actions":[{"name":"UrlRewrite","parameters":{"typeName":"DeliveryRuleUrlRewriteActionParameters","sourcePattern":"/","destination":"/index.html","preserveUnmatchedPath":false}},{"name":"CacheExpiration","parameters":{"typeName":"DeliveryRuleCacheExpirationActionParameters","cacheBehavior":"BypassCache","cacheType":"All","cacheDuration":null}}]}]},"urlSigningKeys":null,"webApplicationFirewallPolicyLink":null,"resourceState":"Running","provisioningState":"Succeeded"}} urllib3.connectionpool: Starting new HTTP connection (1): localhost:50342 urllib3.connectionpool: http://localhost:50342 "POST /oauth2/token HTTP/1.1" 200 2274 msrestazure.azure_active_directory: MSI: Retrieving a token from http://localhost:50342/oauth2/token, with payload {'resource': 'https://management.core.windows.net/'} cli.azure.cli.core.auth.adal_authentication: MSIAuthenticationWrapper.get_token: scopes=('https://management.core.windows.net//.default',), kwargs={} urllib3.connectionpool: Starting new HTTP connection (1): localhost:50342 urllib3.connectionpool: http://localhost:50342 "POST /oauth2/token HTTP/1.1" 200 2274 msrestazure.azure_active_directory: MSI: Retrieving a token from http://localhost:50342/oauth2/token, with payload {'resource': 'https://management.core.windows.net/'} cli.azure.cli.core.auth.adal_authentication: Normalize expires_on: '1712845126' -> 1712845126 cli.azure.cli.core.sdk.policies: Request URL: 'https://management.azure.com/subscriptions/SUBSCRIPTION_ID/resourceGroups/RESOURCE_GROUP/providers/Microsoft.Cdn/profiles/PROFILE_NAME/endpoints/ENDPOINT_NAME?api-version=2023-05-01' cli.azure.cli.core.sdk.policies: Request method: 'GET' cli.azure.cli.core.sdk.policies: Request headers: cli.azure.cli.core.sdk.policies: 'Accept': 'application/json' cli.azure.cli.core.sdk.policies: 'x-ms-client-request-id': '4399493e-f803-11ee-9b69-00155d8c83eb' cli.azure.cli.core.sdk.policies: 'CommandName': 'cdn endpoint update' cli.azure.cli.core.sdk.policies: 'ParameterSetName': '--resource-group --profile-name --name --origin-path --debug' cli.azure.cli.core.sdk.policies: 'User-Agent': 'AZURECLI/2.59.0 (RPM) azsdk-python-core/1.28.0 Python/3.9.19 (Linux-5.10.102.2-microsoft-standard-x86_64-with-glibc2.35) cloud-shell/1.0' cli.azure.cli.core.sdk.policies: 'Authorization': '*****' cli.azure.cli.core.sdk.policies: Request body: cli.azure.cli.core.sdk.policies: This request has no body urllib3.connectionpool: Starting new HTTPS connection (1): management.azure.com:443 urllib3.connectionpool: https://management.azure.com:443 "GET /subscriptions/SUBSCRIPTION_ID/resourceGroups/RESOURCE_GROUP/providers/Microsoft.Cdn/profiles/PROFILE_NAME/endpoints/ENDPOINT_NAME?api-version=2023-05-01 HTTP/1.1" 200 3240 cli.azure.cli.core.sdk.policies: Response status: 200 cli.azure.cli.core.sdk.policies: Response headers: cli.azure.cli.core.sdk.policies: 'Cache-Control': 'no-cache' cli.azure.cli.core.sdk.policies: 'Pragma': 'no-cache' cli.azure.cli.core.sdk.policies: 'Content-Length': '3240' cli.azure.cli.core.sdk.policies: 'Content-Type': 'application/json; charset=utf-8' cli.azure.cli.core.sdk.policies: 'Expires': '-1' cli.azure.cli.core.sdk.policies: 'Strict-Transport-Security': 'max-age=31536000; includeSubDomains' cli.azure.cli.core.sdk.policies: 'x-ms-request-id': '9ca76a38-efbb-43e4-b094-75ed562fa215' cli.azure.cli.core.sdk.policies: 'x-ms-client-request-id': '4399493e-f803-11ee-9b69-00155d8c83eb' cli.azure.cli.core.sdk.policies: 'Server': 'Kestrel' cli.azure.cli.core.sdk.policies: 'x-ms-ratelimit-remaining-subscription-resource-requests': '499' cli.azure.cli.core.sdk.policies: 'x-ms-correlation-request-id': '6a8a3738-c521-466e-9179-3fc57b719dbd' cli.azure.cli.core.sdk.policies: 'x-ms-routing-request-id': 'WESTEUROPE:20240411T125901Z:6a8a3738-c521-466e-9179-3fc57b719dbd' cli.azure.cli.core.sdk.policies: 'X-Content-Type-Options': 'nosniff' cli.azure.cli.core.sdk.policies: 'Date': 'Thu, 11 Apr 2024 12:59:01 GMT' cli.azure.cli.core.sdk.policies: Response content: cli.azure.cli.core.sdk.policies: {"id":"/subscriptions/SUBSCRIPTION_ID/resourcegroups/RESOURCE_GROUP/providers/Microsoft.Cdn/profiles/PROFILE_NAME/endpoints/ENDPOINT_NAME","type":"Microsoft.Cdn/profiles/endpoints","name":"ENDPOINT_NAME","location":"Global","tags":{},"properties":{"hostName":"ENDPOINT_NAME.azureedge.net","originHostHeader":"PREFIX.blob.core.windows.net","originPath":"/ORIGIN_PATH","contentTypesToCompress":["application/eot","application/font","application/font-sfnt","application/javascript","application/json","application/opentype","application/otf","application/pkcs7-mime","application/truetype","application/ttf","application/vnd.ms-fontobject","application/xhtml+xml","application/xml","application/xml+rss","application/x-font-opentype","application/x-font-truetype","application/x-font-ttf","application/x-httpd-cgi","application/x-javascript","application/x-mpegurl","application/x-opentype","application/x-otf","application/x-perl","application/x-ttf","font/eot","font/ttf","font/otf","font/opentype","image/svg+xml","text/css","text/csv","text/html","text/javascript","text/js","text/plain","text/richtext","text/tab-separated-values","text/xml","text/x-script","text/x-component","text/x-java-source"],"isCompressionEnabled":true,"isHttpAllowed":true,"isHttpsAllowed":true,"queryStringCachingBehavior":"IgnoreQueryString","optimizationType":"GeneralWebDelivery","probePath":null,"origins":[{"name":"PREFIX-blob-core-windows-net","properties":{"hostName":"PREFIX.blob.core.windows.net","httpPort":null,"httpsPort":null,"originHostHeader":"PREFIX.blob.core.windows.net","priority":1,"weight":1000,"enabled":true,"privateLinkAlias":null,"privateLinkResourceId":null,"privateLinkLocation":null,"privateEndpointStatus":null,"privateLinkApprovalMessage":null}}],"originGroups":[],"defaultOriginGroup":null,"customDomains":[{"name":"DOMAIN_NAME","properties":{"hostName":"HOST_NAME","validationData":null}}],"geoFilters":[],"deliveryPolicy":{"description":"","rules":[{"name":"HttpsRedirection","order":1,"conditions":[{"name":"RequestScheme","parameters":{"typeName":"DeliveryRuleRequestSchemeConditionParameters","matchValues":["HTTP"],"operator":"Equal","negateCondition":false,"transforms":[]}}],"actions":[{"name":"UrlRedirect","parameters":{"typeName":"DeliveryRuleUrlRedirectActionParameters","redirectType":"Found","destinationProtocol":"Https","customQueryString":null,"customPath":null,"customHostname":null,"customFragment":null}}]},{"name":"RewriteUrl","order":2,"conditions":[{"name":"UrlPath","parameters":{"typeName":"DeliveryRuleUrlPathMatchConditionParameters","operator":"Wildcard","negateCondition":true,"matchValues":["/*.*"],"transforms":[]}}],"actions":[{"name":"UrlRewrite","parameters":{"typeName":"DeliveryRuleUrlRewriteActionParameters","sourcePattern":"/","destination":"/index.html","preserveUnmatchedPath":false}},{"name":"CacheExpiration","parameters":{"typeName":"DeliveryRuleCacheExpirationActionParameters","cacheBehavior":"BypassCache","cacheType":"All","cacheDuration":null}}]}]},"urlSigningKeys":null,"webApplicationFirewallPolicyLink":null,"resourceState":"Running","provisioningState":"Succeeded"}} cli.azure.cli.core.sdk.policies: Request URL: 'https://management.azure.com/subscriptions/SUBSCRIPTION_ID/resourceGroups/RESOURCE_GROUP/providers/Microsoft.Cdn/profiles/PROFILE_NAME/endpoints/ENDPOINT_NAME?api-version=2023-05-01' cli.azure.cli.core.sdk.policies: Request method: 'PUT' cli.azure.cli.core.sdk.policies: Request headers: cli.azure.cli.core.sdk.policies: 'Content-Type': 'application/json' cli.azure.cli.core.sdk.policies: 'Accept': 'application/json' cli.azure.cli.core.sdk.policies: 'Content-Length': '1861' cli.azure.cli.core.sdk.policies: 'x-ms-client-request-id': '4399493e-f803-11ee-9b69-00155d8c83eb' cli.azure.cli.core.sdk.policies: 'CommandName': 'cdn endpoint update' cli.azure.cli.core.sdk.policies: 'ParameterSetName': '--resource-group --profile-name --name --origin-path --debug' cli.azure.cli.core.sdk.policies: 'User-Agent': 'AZURECLI/2.59.0 (RPM) azsdk-python-core/1.28.0 Python/3.9.19 (Linux-5.10.102.2-microsoft-standard-x86_64-with-glibc2.35) cloud-shell/1.0' cli.azure.cli.core.sdk.policies: 'Authorization': '*****' cli.azure.cli.core.sdk.policies: Request body: cli.azure.cli.core.sdk.policies: {"location": "eastus", "properties": {"contentTypesToCompress": ["text/plain", "text/html", "text/css", "text/javascript", "application/x-javascript", "application/javascript", "application/json", "application/xml"], "deliveryPolicy": {"description": "", "rules": [{"actions": [{"name": "UrlRedirect", "parameters": {"destinationProtocol": "Https", "redirectType": "Found", "typeName": "DeliveryRuleUrlRedirectActionParameters"}}], "conditions": [{"name": "RequestScheme", "parameters": {"matchValues": ["HTTP"], "negateCondition": false, "operator": "Equal", "transforms": [], "typeName": "DeliveryRuleRequestSchemeConditionParameters"}}], "name": "HttpsRedirection", "order": 1}, {"actions": [{"name": "UrlRewrite", "parameters": {"destination": "/index.html", "preserveUnmatchedPath": false, "sourcePattern": "/", "typeName": "DeliveryRuleUrlRewriteActionParameters"}}, {"name": "CacheExpiration", "parameters": {"cacheBehavior": "BypassCache", "cacheDuration": null, "cacheType": "All", "typeName": "DeliveryRuleCacheExpirationActionParameters"}}], "conditions": [{"name": "UrlPath", "parameters": {"matchValues": ["/*.*"], "negateCondition": true, "operator": "Wildcard", "transforms": [], "typeName": "DeliveryRuleUrlPathMatchConditionParameters"}}], "name": "RewriteUrl", "order": 2}]}, "geoFilters": [], "isCompressionEnabled": true, "isHttpAllowed": true, "isHttpsAllowed": true, "optimizationType": "GeneralWebDelivery", "originGroups": [], "originHostHeader": "PREFIX.blob.core.windows.net", "originPath": "/PATH", "origins": [{"name": "PREFIX-blob-core-windows-net", "properties": {"enabled": true, "hostName": "PREFIX.blob.core.windows.net", "originHostHeader": "PREFIX.blob.core.windows.net", "priority": 1, "weight": 1000}}], "queryStringCachingBehavior": "IgnoreQueryString"}, "tags": {}} urllib3.connectionpool: https://management.azure.com:443 "PUT /subscriptions/SUBSCRIPTION_ID/resourceGroups/RESOURCE_GROUP/providers/Microsoft.Cdn/profiles/PROFILE_NAME/endpoints/ENDPOINT_NAME?api-version=2023-05-01 HTTP/1.1" 409 280 cli.azure.cli.core.sdk.policies: Response status: 409 cli.azure.cli.core.sdk.policies: Response headers: cli.azure.cli.core.sdk.policies: 'Cache-Control': 'no-cache' cli.azure.cli.core.sdk.policies: 'Pragma': 'no-cache' cli.azure.cli.core.sdk.policies: 'Content-Length': '280' cli.azure.cli.core.sdk.policies: 'Content-Type': 'application/json; charset=utf-8' cli.azure.cli.core.sdk.policies: 'Expires': '-1' cli.azure.cli.core.sdk.policies: 'x-ms-failure-cause': 'gateway' cli.azure.cli.core.sdk.policies: 'x-ms-request-id': '8d576797-d3f2-443a-bcb6-05ca2f978e13' cli.azure.cli.core.sdk.policies: 'x-ms-correlation-request-id': '8d576797-d3f2-443a-bcb6-05ca2f978e13' cli.azure.cli.core.sdk.policies: 'x-ms-routing-request-id': 'WESTEUROPE:20240411T125901Z:8d576797-d3f2-443a-bcb6-05ca2f978e13' cli.azure.cli.core.sdk.policies: 'Strict-Transport-Security': 'max-age=31536000; includeSubDomains' cli.azure.cli.core.sdk.policies: 'X-Content-Type-Options': 'nosniff' cli.azure.cli.core.sdk.policies: 'Date': 'Thu, 11 Apr 2024 12:59:01 GMT' cli.azure.cli.core.sdk.policies: Response content: cli.azure.cli.core.sdk.policies: {"error":{"code":"InvalidResourceLocation","message":"The resource 'PROFILE_NAME/ENDPOINT_NAME' already exists in location 'global' in resource group 'RESOURCE_GROUP'. A resource with the same name cannot be created in location 'eastus'. Please select a new resource name."}} cli.azure.cli.core.azclierror: Traceback (most recent call last): File "/usr/lib64/az/lib/python3.9/site-packages/knack/cli.py", line 233, in invoke cmd_result = self.invocation.execute(args) File "/usr/lib64/az/lib/python3.9/site-packages/azure/cli/core/commands/__init__.py", line 664, in execute raise ex File "/usr/lib64/az/lib/python3.9/site-packages/azure/cli/core/commands/__init__.py", line 731, in _run_jobs_serially results.append(self._run_job(expanded_arg, cmd_copy)) File "/usr/lib64/az/lib/python3.9/site-packages/azure/cli/core/commands/__init__.py", line 712, in _run_job result = LongRunningOperation(cmd_copy.cli_ctx, 'Starting {}'.format(cmd_copy.name))(result) File "/usr/lib64/az/lib/python3.9/site-packages/azure/cli/core/commands/__init__.py", line 1048, in __call__ raise exception File "/usr/lib64/az/lib/python3.9/site-packages/azure/cli/core/commands/__init__.py", line 1035, in __call__ result = poller.result() File "/usr/lib64/az/lib/python3.9/site-packages/azure/cli/core/aaz/_poller.py", line 108, in result self.wait(timeout) File "/usr/lib64/az/lib/python3.9/site-packages/azure/core/tracing/decorator.py", line 76, in wrapper_use_tracer return func(*args, **kwargs) File "/usr/lib64/az/lib/python3.9/site-packages/azure/cli/core/aaz/_poller.py", line 130, in wait raise self._exception File "/usr/lib64/az/lib/python3.9/site-packages/azure/cli/core/aaz/_poller.py", line 83, in _start for polling_method in self._polling_generator: File "/usr/lib64/az/lib/python3.9/site-packages/azure/cli/command_modules/cdn/aaz/latest/cdn/endpoint/_update.py", line 1755, in _execute_operations yield self.EndpointsCreate(ctx=self.ctx)() File "/usr/lib64/az/lib/python3.9/site-packages/azure/cli/command_modules/cdn/aaz/latest/cdn/endpoint/_update.py", line 1890, in __call__ return self.on_error(session.http_response) File "/usr/lib64/az/lib/python3.9/site-packages/azure/cli/core/aaz/_operation.py", line 329, in on_error raise error_type(response=response) azure.core.exceptions.ResourceExistsError: (InvalidResourceLocation) The resource 'PROFILE_NAME/ENDPOINT_NAME' already exists in location 'global' in resource group 'RESOURCE_GROUP'. A resource with the same name cannot be created in location 'eastus'. Please select a new resource name. Code: InvalidResourceLocation Message: The resource 'PROFILE_NAME/ENDPOINT_NAME' already exists in location 'global' in resource group 'RESOURCE_GROUP'. A resource with the same name cannot be created in location 'eastus'. Please select a new resource name. cli.azure.cli.core.azclierror: (InvalidResourceLocation) The resource 'PROFILE_NAME/ENDPOINT_NAME' already exists in location 'global' in resource group 'RESOURCE_GROUP'. A resource with the same name cannot be created in location 'eastus'. Please select a new resource name. Code: InvalidResourceLocation Message: The resource 'PROFILE_NAME/ENDPOINT_NAME' already exists in location 'global' in resource group 'RESOURCE_GROUP'. A resource with the same name cannot be created in location 'eastus'. Please select a new resource name. az_command_data_logger: (InvalidResourceLocation) The resource 'PROFILE_NAME/ENDPOINT_NAME' already exists in location 'global' in resource group 'RESOURCE_GROUP'. A resource with the same name cannot be created in location 'eastus'. Please select a new resource name. Code: InvalidResourceLocation Message: The resource 'PROFILE_NAME/ENDPOINT_NAME' already exists in location 'global' in resource group 'RESOURCE_GROUP'. A resource with the same name cannot be created in location 'eastus'. Please select a new resource name. cli.knack.cli: Event: Cli.PostExecute [ ] az_command_data_logger: exit code: 1 cli.__main__: Command ran in 2.074 seconds (init: 0.198, invoke: 1.876) 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 4490 in cache telemetry.main: Begin creating telemetry upload process. telemetry.process: Creating upload process: "/usr/bin/python3.9 /usr/lib/az/lib/python3.9/site-packages/azure/cli/telemetry/__init__.py /home/andriy/.azure" telemetry.process: Return from creating process telemetry.main: Finish creating telemetry upload process.
Expected behavior
This command should be executed successfully.
Environment Summary
azure-cli 2.59.0 core 2.59.0 telemetry 1.1.0 Extensions: ai-examples 0.2.5 azure-devops 1.0.0 ml 2.25.0 ssh 2.0.3 Dependencies: msal 1.27.0 azure-mgmt-resource 23.1.0b2 Python location '/usr/bin/python3.9' Extensions directory '/home/andriy/.azure/cliextensions' Extensions system directory '/usr/lib/python3.9/site-packages/azure-cli-extensions' Python (Linux) 3.9.19 (main, Mar 28 2024, 18:56:59) [GCC 11.2.0]
Additional context
This command works fine in Azure CLI v.2.58.0. There is a difference in the HTTP calls within this command:
- version 2.58.0 uses HTTP PATCH method
- version 2.59.0 uses HTTP PUT method
Please let me know, if I should start using a different command for my purpose.
Thank you for opening this issue, we will look into it.
Thanks for the feedback! We are routing this to the appropriate team for follow-up. cc @aznetsuppgithub.
Thanks for the feedback! We are routing this to the appropriate team for follow-up. cc @t-bzhan, @gxue, @TracyYaoYao.
One month has passed. Any updates on this issue?
Add @Ptnan7 to take a look.
Still no updates? This issue breaks our deployment pipelines and becomes more and more annoying.
Just want to let you know that I dug into the command problem and found the root cause. I opened a corresponding issue here: https://github.com/Azure/aaz/issues/490.