Skip to content

Conversation

@azure-sdk
Copy link
Collaborator

@azure-sdk azure-sdk commented Jan 8, 2026

Configurations: 'specification/cdn/resource-manager/Microsoft.Cdn/EdgeActions/tspconfig.yaml', API Version: 2025-12-01-preview, SDK Release Type: beta, and CommitSHA: 'ccea12be6cd5e64743499d46f7a9c8b60df52db1' in SpecRepo: 'https://github.com/Azure/azure-rest-api-specs' Pipeline run: https://dev.azure.com/azure-sdk/internal/_build/results?buildId=5730146 Refer to https://eng.ms/docs/products/azure-developer-experience/develop/sdk-release/sdk-release-prerequisites to prepare for SDK release. Release plan link: https://web.powerapps.com/apps/821ab569-ae60-420d-8264-d7b5d5ef734c?release-plan-id=9e03d787-20ec-f011-8544-000d3a5b5a24 Submitted by: [email protected]

Release Plan Details

…eActions/tspconfig.yaml', API Version: 2025-12-01-preview, SDK Release Type: beta, and CommitSHA: 'ccea12be6cd5e64743499d46f7a9c8b60df52db1' in SpecRepo: 'https://github.com/Azure/azure-rest-api-specs' Pipeline run: https://dev.azure.com/azure-sdk/internal/_build/results?buildId=5730146 Refer to https://eng.ms/docs/products/azure-developer-experience/develop/sdk-release/sdk-release-prerequisites to prepare for SDK release.
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This is an auto-generated SDK pull request for the Azure Edge Actions Management service, generated from TypeSpec specifications. The PR introduces a new Python SDK package azure-mgmt-edgeactions (version 1.0.0b1) for managing Edge Actions resources in Azure CDN, targeting API version 2025-12-01-preview.

Key changes:

  • Complete new SDK package with client implementation for sync and async operations
  • Three main operation groups: EdgeActions, EdgeActionVersions, and EdgeActionExecutionFilters
  • Full set of CRUD operations, long-running operations (LRO), and paginated list operations
  • Generated test files and code samples
  • CI/CD pipeline configuration

Reviewed changes

Copilot reviewed 59 out of 61 changed files in this pull request and generated no comments.

Show a summary per file
File Description
sdk/edgeactions/ci.yml Azure Pipelines CI/CD configuration for the edgeactions service
sdk/edgeactions/azure-mgmt-edgeactions/pyproject.toml Package configuration with dependencies and build settings
sdk/edgeactions/azure-mgmt-edgeactions/tsp-location.yaml TypeSpec source location metadata
sdk/edgeactions/azure-mgmt-edgeactions/_metadata.json Generation metadata with API version and commit info
sdk/edgeactions/azure-mgmt-edgeactions/README.md Package documentation and usage examples
sdk/edgeactions/azure-mgmt-edgeactions/CHANGELOG.md Initial release notes for version 1.0.0b1
sdk/edgeactions/azure-mgmt-edgeactions/azure/mgmt/edgeactions/_client.py Sync client implementation for CdnClient
sdk/edgeactions/azure-mgmt-edgeactions/azure/mgmt/edgeactions/aio/_client.py Async client implementation
sdk/edgeactions/azure-mgmt-edgeactions/azure/mgmt/edgeactions/operations/_operations.py Core operations implementations for all three operation groups
sdk/edgeactions/azure-mgmt-edgeactions/azure/mgmt/edgeactions/models/_models.py Model definitions for SDK resources
sdk/edgeactions/azure-mgmt-edgeactions/azure/mgmt/edgeactions/models/_enums.py Enum definitions for SDK
sdk/edgeactions/azure-mgmt-edgeactions/generated_tests/*.py Auto-generated test files for all operations
sdk/edgeactions/azure-mgmt-edgeactions/generated_samples/*.py Auto-generated code samples

…eActions/tspconfig.yaml', API Version: 2025-12-01-preview, SDK Release Type: beta, and CommitSHA: '1864d2ef7798c8d436322c803eb870e9e0bc8680' in SpecRepo: 'https://github.com/Azure/azure-rest-api-specs' Pipeline run: https://dev.azure.com/azure-sdk/internal/_build/results?buildId=5745141 Refer to https://eng.ms/docs/products/azure-developer-experience/develop/sdk-release/sdk-release-prerequisites to prepare for SDK release.
@msyyc
Copy link
Member

msyyc commented Jan 13, 2026

@ChenxiJiang333 We need regenerate again after Azure/azure-rest-api-specs#39517 merged.

@ChenxiJiang333
Copy link
Member

@ChenxiJiang333 We need regenerate again after Azure/azure-rest-api-specs#39517 merged.

got it

azure-sdk and others added 2 commits January 15, 2026 02:53
…eActions/tspconfig.yaml', API Version: 2025-12-01-preview, SDK Release Type: beta, and CommitSHA: '0b05eba33bd579dd10546b02744349f820d31736' in SpecRepo: 'https://github.com/Azure/azure-rest-api-specs' Pipeline run: https://dev.azure.com/azure-sdk/internal/_build/results?buildId=5755327 Refer to https://eng.ms/docs/products/azure-developer-experience/develop/sdk-release/sdk-release-prerequisites to prepare for SDK release.
@ChenxiJiang333
Copy link
Member

@msyyc, pr ready, please help review

…eActions/tspconfig.yaml', API Version: 2025-12-01-preview, SDK Release Type: beta, and CommitSHA: '3fc43b6c80d8fce282a242b1f34fecced80ddcb5' in SpecRepo: 'https://github.com/Azure/azure-rest-api-specs' Pipeline run: https://dev.azure.com/azure-sdk/internal/_build/results?buildId=5759844 Refer to https://eng.ms/docs/products/azure-developer-experience/develop/sdk-release/sdk-release-prerequisites to prepare for SDK release.
…eActions/tspconfig.yaml', API Version: 2025-12-01-preview, SDK Release Type: beta, and CommitSHA: '94163c6500a285791aa985a9b3b61b2157967d2c' in SpecRepo: 'https://github.com/Azure/azure-rest-api-specs' Pipeline run: https://dev.azure.com/azure-sdk/internal/_build/results?buildId=5760861 Refer to https://eng.ms/docs/products/azure-developer-experience/develop/sdk-release/sdk-release-prerequisites to prepare for SDK release.
@ChenxiJiang333
Copy link
Member

@msyyc regenerated, please help review

msyyc and others added 3 commits January 20, 2026 11:56
ChenxiJiang333
ChenxiJiang333 previously approved these changes Jan 20, 2026
@ChenxiJiang333 ChenxiJiang333 self-requested a review January 20, 2026 04:23
@ChenxiJiang333 ChenxiJiang333 dismissed their stale review January 20, 2026 04:23

dismiss for pr might not be ready


cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None)

_request = build_edge_action_versions_swap_default_request(
Copy link
Member

@tundwed tundwed Jan 20, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@ChenxiJiang333 @msyyc. I ran tests locally for all operations and found this issue. POST Actions Fail with HTTP 415 Unsupported Media Type

Issue: get version code and swap default POST operations return HTTP 415 because the SDK sends no body/Content-Type header.

Root cause: These operations take void input in TypeSpec, so the generated SDK sends no body. However:

  1. ARM requires POST operations to have a body (even if empty)
  2. ASP.NET Core middleware requires Content-Type when body is present

Fix (already applied in CLI extension):

# Add header
"Content-Type": "application/json"
# Send empty body
content = b'{}'

Here is the fix i had made on cli

https://github.com/Azure/azure-cli-extensions/pull/9445/files#diff-b0df0ac3bc33b73181a7ce20fd81808cb3fef0cd9ee041f50f7a171e01a8eb57

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@tundwed ARM requires POST operations to have a body (even if empty), could you show the ARM guideline link? I don't know this kind of restriction. For example,

def begin_start(self, resource_group_name: str, cloud_service_name: str, **kwargs: Any) -> LROPoller[None]:
"""Starts the cloud service.
:param resource_group_name: Name of the resource group. Required.
:type resource_group_name: str
:param cloud_service_name: Name of the cloud service. Required.
:type cloud_service_name: str
:return: An instance of LROPoller that returns either None or the result of cls(response)
:rtype: ~azure.core.polling.LROPoller[None]
:raises ~azure.core.exceptions.HttpResponseError:
"""
_headers = kwargs.pop("headers", {}) or {}
_params = case_insensitive_dict(kwargs.pop("params", {}) or {})
api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-11-04"))
cls: ClsType[None] = kwargs.pop("cls", None)
polling: Union[bool, PollingMethod] = kwargs.pop("polling", True)
lro_delay = kwargs.pop("polling_interval", self._config.polling_interval)
cont_token: Optional[str] = kwargs.pop("continuation_token", None)
if cont_token is None:
raw_result = self._start_initial(
resource_group_name=resource_group_name,
cloud_service_name=cloud_service_name,
api_version=api_version,
cls=lambda x, y, z: x,
headers=_headers,
params=_params,
**kwargs
)
raw_result.http_response.read() # type: ignore
kwargs.pop("error_map", None)
def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements
if cls:
return cls(pipeline_response, None, {}) # type: ignore
if polling is True:
polling_method: PollingMethod = cast(PollingMethod, ARMPolling(lro_delay, **kwargs))
elif polling is False:
polling_method = cast(PollingMethod, NoPolling())
else:
polling_method = polling
if cont_token:
return LROPoller[None].from_continuation_token(
polling_method=polling_method,
continuation_token=cont_token,
client=self._client,
deserialization_callback=get_long_running_output,
)
return LROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore
start operation of compute is also POST operation without body, but it could work.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@msyyc i can't seem to find the doc, but I think it was in the lint error or avocado error when creating the spec.

Similar issue was discussed in detail here. ARM accepts a request with void body and considers content type as optional, but on the service side, the ASP.NET core middleware requires content type to be specified.

https://teams.microsoft.com/l/message/19:[email protected]/1734561220774?tenantId=72f988bf-86f1-41af-91ab-2d7cd011db47&groupId=3e17dcb0-4257-4a30-b843-77f47f1d4121&parentMessageId=1734561220774&teamName=Azure%20SDK&channelName=API%20Spec%20Review&createdTime=1734561220774

Copy link
Member

@msyyc msyyc Jan 21, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@tundwed the example of compute shows that your guess may not be right, at least compute service could work in this scenario. So I advise you update the service code to allow empty body and empty content-type for POST.

NOTE:
If it is hard to change service code in short time, there are 2 workarounds and you can choose any one:
(1) python sdk accept users input customized header like client.operation(..., headers={"Content-Type": "xxx"})
(2) you could update tsp definition like

  @post
  op extensibleEnumNewlineDelimited(
    @header("Content-Type") contentType: "application/json",
  ): void;

Then generated Python SDK will set default value for content-type like:
image


response = pipeline_response.http_response

if response.status_code not in [202, 204]:
Copy link
Member

@tundwed tundwed Jan 20, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@ChenxiJiang333 @msyyc Delete Operations Fail with JSONDecodeError

Issue: All (edge actions, versions, execution filters) Delete operations fail with JSONDecodeError: Expecting value: line 1 column 1 (char 0)

Root Cause:

  1. Service returns HTTP 200 with empty body for successful deletes (since this is a synchronous delete). According to ARM docs, we should return 200. See screenshot below.
  2. SDK only accepts 202/204 as success codes (line 1171: if response.status_code not in [202, 204])
  3. When 200 is received, SDK tries to parse empty body as error JSON → JSONDecodeError
image

https://github.com/Azure/azure-resource-manager-rpc/blob/master/v1.0/resource-api-reference.md#delete-resource

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi @tundwed, according to the tsp definition, the delete method here seems to be an asynchronous method.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@ChenxiJiang333 , you are right, we use and async function. At the moment though, the RP service returns 200.

We will look to migrate to return 202. But in the meantime, can we make a change to consider 200 a success and not failure here. We can add it to the array of accepted responses

Copy link
Member

@msyyc msyyc Jan 21, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@tundwed Here is your tsp definition and here is generated swagger. Then we could see only [202,204] is valid. Since SDK is generated from Typespec with codegen tool automatically instead of manually, we can't change the SDK code manually. Now that service returns 200, you should update tsp definition to make it follow service behavior.

NOTE: When the tsp definition is updated, all language SDKs (Java, Python, JavaScript, .NET, Go, etc.) can be updated automatically without requiring manual coding. However, if you update the SDK directly, you must apply the same changes to each language SDK individually, resulting in at least five instances of duplicated effort.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@msyyc @ChenxiJiang333 I have this pr to handle both issues. Please have a look

Azure/azure-rest-api-specs#39806

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@tundwed I will also ping other language owners to take a review for your PR

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants