azure-cli
azure-cli copied to clipboard
Cannot unset endpoint origin path
Describe the bug
I need to set the origin-path on an endpoint to be "empty". This appears to be possible via the portal but not via the cli. Attempting to clear an origin-path on an endpoint results in a 400 error.
Attempted to set origin-path to "/" and ""
Related command
az cdn endpoint update -g {group} --profile-name {profile} --origin-path "/" -n {name}
Errors
(BadRequest) Property 'Endpoint.OriginPath' cannot be set to '/'. (BadRequest) Property 'Endpoint.OriginPath' cannot be set to ''. Code: BadRequest
Issue script & Debug output
msal.telemetry: Generate or reuse correlation_id: ffd342c8-517d-4bdd-a250-ea85e1f7e5f1 cli.azure.cli.core.sdk.policies: Request URL: 'https://management.azure.com/subscriptions/REDACTED/resourceGroups/REDACTED/providers/Microsoft.Cdn/profiles/REDACTED/endpoints/REDACTED?api-version=2021-06-01' cli.azure.cli.core.sdk.policies: Request method: 'PATCH' cli.azure.cli.core.sdk.policies: Request headers: cli.azure.cli.core.sdk.policies: 'Content-Type': 'application/json' cli.azure.cli.core.sdk.policies: 'Content-Length': '1116' cli.azure.cli.core.sdk.policies: 'Accept': 'application/json' cli.azure.cli.core.sdk.policies: 'x-ms-client-request-id': 'c04ec3ce-8fc5-11ee-9604-669fbac36243' cli.azure.cli.core.sdk.policies: 'CommandName': 'cdn endpoint update' cli.azure.cli.core.sdk.policies: 'ParameterSetName': '-g --profile-name --origin-path -n --debug' cli.azure.cli.core.sdk.policies: 'User-Agent': 'AZURECLI/2.49.0 (HOMEBREW) azsdk-python-mgmt-cdn/12.0.0 Python/3.10.12 (macOS-13.5.2-arm64-arm-64bit)' cli.azure.cli.core.sdk.policies: 'Authorization': '*****' cli.azure.cli.core.sdk.policies: Request body: cli.azure.cli.core.sdk.policies: {"tags": {}, "properties": {"originPath": "/", "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"], "originHostHeader": "REDACTED", "isCompressionEnabled": true, "isHttpAllowed": false, "isHttpsAllowed": true, "queryStringCachingBehavior": "IgnoreQueryString"}} urllib3.connectionpool: Starting new HTTPS connection (1): management.azure.com:443 urllib3.connectionpool: https://management.azure.com:443 "PATCH /subscriptions/REDACTED/resourceGroups/REDACTED/providers/Microsoft.Cdn/profiles/REDACTED/endpoints/REDACTED?api-version=2021-06-01 HTTP/1.1" 400 117 cli.azure.cli.core.sdk.policies: Response status: 400 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': '117' cli.azure.cli.core.sdk.policies: 'Content-Type': 'application/json' cli.azure.cli.core.sdk.policies: 'Expires': '-1' cli.azure.cli.core.sdk.policies: 'x-ms-ratelimit-remaining-subscription-resource-requests': '399' cli.azure.cli.core.sdk.policies: 'Strict-Transport-Security': 'max-age=31536000; includeSubDomains' cli.azure.cli.core.sdk.policies: 'x-ms-request-id': '4f805a12-83c9-4453-bd41-31f0c3150e8f' cli.azure.cli.core.sdk.policies: 'x-ms-client-request-id': 'c04ec3ce-8fc5-11ee-9604-669fbac36243' cli.azure.cli.core.sdk.policies: 'Server': 'Kestrel' cli.azure.cli.core.sdk.policies: 'x-ms-correlation-request-id': '00163a2e-8386-46ef-b809-b6559293aca7' cli.azure.cli.core.sdk.policies: 'x-ms-routing-request-id': 'WESTUS:20231130T211642Z:00163a2e-8386-46ef-b809-b6559293aca7' cli.azure.cli.core.sdk.policies: 'X-Content-Type-Options': 'nosniff' cli.azure.cli.core.sdk.policies: 'Date': 'Thu, 30 Nov 2023 21:16:41 GMT' cli.azure.cli.core.sdk.policies: Response content: cli.azure.cli.core.sdk.policies: { "error": { "code": "BadRequest", "message": "Property 'Endpoint.OriginPath' cannot be set to '/'. " } }
Expected behavior
origin path can be "unset" with a 200 response. Documentation should be updated to reflect examples
Environment Summary
azure-cli 2.49.0 *
core 2.49.0 * telemetry 1.0.8 *
Dependencies: msal 1.20.0 azure-mgmt-resource 22.0.0
Additional context
No response
Hi @provAlyssaKrueger,
2.49.0 is not the latest Azure CLI(2.54.0).
If you haven't already attempted to do so, please upgrade to the latest Azure CLI version by following https://learn.microsoft.com/en-us/cli/azure/update-azure-cli.
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.
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.
I see the same issue using Bicep with Microsoft.Cdn profiles/afdEndpoints/routes api version 2023-05-01. I tried setting originPath to an empty string and commenting out the property altogether. I get this response:
"message":"At least one resource deployment operation failed. Please list deployment operations for details. Please see https://aka.ms/arm-deployment-operations for usage details.","details":[{"code":"BadRequest","message":"Property 'RouteV2.OriginPath' cannot be set to ''. "}]