Skip to content

[AutoPR @azure-arm-security]-generated-from-SDK Generation - JS-6275780#38484

Open
azure-sdk wants to merge 8 commits into
mainfrom
sdkauto/@azure-arm-security-6275780
Open

[AutoPR @azure-arm-security]-generated-from-SDK Generation - JS-6275780#38484
azure-sdk wants to merge 8 commits into
mainfrom
sdkauto/@azure-arm-security-6275780

Conversation

@azure-sdk
Copy link
Copy Markdown
Collaborator

@azure-sdk azure-sdk commented May 10, 2026

Configurations: 'specification/security/resource-manager/Microsoft.Security/Security/tspconfig.yaml', API Version: 2026-04-01-preview, SDK Release Type: beta, and CommitSHA: '41784cfad64229e05cb37b1532a686a0cc3a60a9' in SpecRepo: 'https://github.com/Azure/azure-rest-api-specs' Pipeline run: https://dev.azure.com/azure-sdk/internal/_build/results?buildId=6275780 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://apps.powerapps.com/apps/821ab569-ae60-420d-8264-d7b5d5ef734c?release-plan-id=be88c343-344c-f111-bec7-6045bd05bddf Submitted by: ggoldshtein@microsoft.com

Release Plan Details

…curity/Security/tspconfig.yaml', API Version: 2026-04-01-preview, SDK Release Type: beta, and CommitSHA: '41784cfad64229e05cb37b1532a686a0cc3a60a9' in SpecRepo: 'https://github.com/Azure/azure-rest-api-specs' Pipeline run: https://dev.azure.com/azure-sdk/internal/_build/results?buildId=6275780 Refer to https://eng.ms/docs/products/azure-developer-experience/develop/sdk-release/sdk-release-prerequisites to prepare for SDK release.
Copy link
Copy Markdown
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.

Copilot wasn't able to review this pull request because it exceeds the maximum number of files (300). Try reducing the number of changed files and requesting a review from Copilot again.

@github-actions
Copy link
Copy Markdown
Contributor

Next Steps to Merge

Only failed checks and required actions are listed below.

  • UnitTest windows_22x_browser: Browser test build fails with error TS2305: Module '"../src/models/index.js"' has no exported member 'SecurityContact'. The auto-generated test file test/security_examples.spec.ts imports SecurityContact which was removed in this PR. Action: Remove the broken SecurityContact import and any usage from test/security_examples.spec.ts, then push the fix. Review ADO logs.

Copy link
Copy Markdown
Contributor

@github-actions github-actions Bot left a comment

Choose a reason for hiding this comment

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

Found 2 issues in this PR for @azure/arm-security@6.0.0-beta.7:

  1. Tool Issue (CHANGELOG.md): Changelog compares against 5.0.0 (last stable) instead of 6.0.0-beta.6 (last published beta). This is likely a tooling bug.
  2. Design Concern (API): EventSource type exported from the SDK clashes with the well-known browser EventSource Web API, and the internal EventSource_2 name indicates a naming collision in the spec. The type should be renamed using @clientName in the spec repo.
📊 Structured Report
{"agent":"mgmt-reviewer","pr":38484,"summary":"issues_found","findings":[{"file":"sdk/security/arm-security/CHANGELOG.md","line":4,"issueType":"tool","category":"changelog-comparison-version","description":"CHANGELOG compares 6.0.0-beta.7 against 5.0.0 instead of the last published beta 6.0.0-beta.6"},{"file":"sdk/security/arm-security/review/arm-security-node.api.md","line":2098,"issueType":"design","category":"naming-collision","description":"EventSource type clashes with browser EventSource Web API; EventSource_2 _N suffix indicates naming collision in spec"}]}

Benchmarked by Management Release Assistant

Comment thread sdk/security/arm-security/CHANGELOG.md
Comment thread sdk/security/arm-security/review/arm-security-node.api.md
@kazrael2119 kazrael2119 added the first-typespec-migration first time to migrate to typespec label May 11, 2026
@kazrael2119
Copy link
Copy Markdown
Member

Note

This analysis was generated by AI. Please review the classifications and root causes for accuracy.

Breaking Change Analysis: @azure/arm-security 6.0.0-beta.7

Old SDK (main) New SDK (PR)
Generator Swagger / AutoRest TypeSpec / emitter
Package Version 6.0.0-beta.5 6.0.0-beta.7
Release Type beta beta

API Versions by Sub-Service (old composite -> new single TypeSpec):

The old SDK used package-composite-v3, aggregating 20+ swagger files across many API versions (2015-06-01-preview through 2024-01-01). The new TypeSpec consolidates everything into a single 2026-04-01-preview.

Sub-Service Old API Version (Layer A) New API Version (Layer C) Status
SqlVulnerabilityAssessments 2023-02-01-preview 2026-04-01-preview Upgraded
SecurityConnectors 2023-10-01-preview 2026-04-01-preview Upgraded
Automations 2023-12-01-preview 2026-04-01-preview Upgraded
Alerts 2022-01-01 2026-04-01-preview Upgraded
Assessments 2021-06-01 2026-04-01-preview Upgraded
Pricings 2024-01-01 2026-04-01-preview Upgraded
SubAssessments 2019-01-01-preview 2026-04-01-preview Upgraded
AdaptiveApplicationControls 2020-01-01 (removed from TypeSpec scope) Removed
AdaptiveNetworkHardenings 2020-01-01 (removed from TypeSpec scope) Removed
Connectors 2020-01-01-preview (removed from TypeSpec scope) Removed
CustomAssessmentAutomations 2021-07-01-preview (removed from TypeSpec scope) Removed
CustomEntityStoreAssignments 2021-07-01-preview (removed from TypeSpec scope) Removed
IngestionSettings (various) (removed from TypeSpec scope) Removed
SoftwareInventories 2021-05-01-preview (removed from TypeSpec scope) Removed

Spec References:


Total: 297 breaking changes -- Type 1: 9 | Type 2: 287 | Needs Review: 1


Type 1: API Version Upgrade -- 9 items

All 9 entries are in the SqlVulnerabilityAssessments sub-service (2023-02-01-preview -> 2026-04-01-preview). The workspaceId path parameter was removed from all operations in the new API version, and scan result models were redesigned (Scan -> ScanV2).

# Breaking Change Root Cause
1 Operation SqlVulnerabilityAssessmentBaselineRules.add has a new signature workspaceId: string path parameter removed from 2026-04-01-preview API (old: add(workspaceId, resourceId, ...); new: add(resourceId, ...)).
2 Operation SqlVulnerabilityAssessmentBaselineRules.createOrUpdate has a new signature Same as row 1. workspaceId removed; parameter order changed to (resourceId, ruleId, ...).
3 Operation SqlVulnerabilityAssessmentBaselineRules.delete has a new signature Same as row 1. workspaceId removed.
4 Operation SqlVulnerabilityAssessmentBaselineRules.get has a new signature Same as row 1. workspaceId removed; return type from response wrapper to RuleResults.
5 Operation SqlVulnerabilityAssessmentBaselineRules.list has a new signature Same as row 1. workspaceId removed; return changed from Promise<XxxListResponse> to PagedAsyncIterableIterator<RuleResults> (list now paginated).
6 Operation SqlVulnerabilityAssessmentScanResults.get has a new signature workspaceId: string removed from path (old: get(scanId, scanResultId, workspaceId, resourceId, ...); new: get(scanId, scanResultId, resourceId, ...)). Return type from response wrapper to ScanResult.
7 Operation SqlVulnerabilityAssessmentScanResults.list has a new signature Same as row 6. workspaceId removed; return changed to PagedAsyncIterableIterator<ScanResult>.
8 Operation SqlVulnerabilityAssessmentScans.get has a new signature workspaceId: string removed; return type changed from old scan model to ScanV2 (scan model redesigned in new API version).
9 Operation SqlVulnerabilityAssessmentScans.list has a new signature Same as row 8. workspaceId removed; return changed to PagedAsyncIterableIterator<ScanV2>.

Type 2: TypeSpec / Emitter Migration -- 287 items

# Breaking Change(s) Count Root Cause Accepted
10 Removed operation SecurityContacts.update / Removed Interface SecurityContactsUpdateOptionalParams 2 The TypeSpec ARM template generates only createOrUpdate (PUT); the old AutoRest update (PATCH) endpoint from 2023-12-01-preview/securityContacts.json is not modeled in the new TypeSpec Security project.
11 Type of parameter assessedResourceType of interface AdditionalData is changed from "SqlServerVulnerability" | "ContainerRegistryVulnerability" | "ServerVulnerabilityAssessment" to AssessedResourceType 1 Discriminator property changed from AutoRest inline literal union to TypeSpec named type alias.
12 Type of parameter kind of interface AlertSimulatorRequestProperties is changed from "Bundles" to Kind 1 Same as row 11.
13 Type of parameter actionType of interface AutomationAction is changed from "LogicApp" | "EventHub" | "Workspace" to ActionType 1 Same as row 11.
14 Type of parameter offeringType of interface CloudOffering is changed from "CspmMonitorAws" | "DefenderForContainersAws" | "DefenderForServersAws" | "InformationProtectionAws" to OfferingType 1 Same as row 11.
15 Type of parameter ruleType of interface CustomAlertRule is changed from [long inline union] to string 1 Same as row 11. TypeSpec uses string for extensible enum.
16 Type of parameter source of interface ResourceDetails is changed from "Azure" | "OnPremise" | "OnPremiseSql" to Source 1 Same as row 11.
17 Type of parameter type of interface ResourceIdentifier is changed from "AzureResource" | "LogAnalytics" to ResourceIdentifierType 1 Same as row 11.
18 Type alias "AdditionalDataUnion" has been changed 1 Cascading from row 11: the union alias includes AdditionalData as its discriminator base, and AdditionalData.assessedResourceType changed.
19 Type alias "AlertSimulatorRequestPropertiesUnion" has been changed 1 Cascading from row 12.
20 Type alias "AutomationActionUnion" has been changed 1 Cascading from row 13.
21 Type alias "CloudOfferingUnion" has been changed 1 Cascading from row 14.
22 Type alias "CustomAlertRuleUnion" has been changed / Type alias "ListCustomAlertRuleUnion" has been changed / Type alias "ThresholdCustomAlertRuleUnion" has been changed 3 Cascading from row 15: all three union aliases include CustomAlertRule as their discriminator base.
23 Type alias "OnPremiseResourceDetailsUnion" has been changed / Type alias "ResourceDetailsUnion" has been changed 2 Cascading from row 16.
24 Type alias "ResourceIdentifierUnion" has been changed 1 Cascading from row 17.
25 Operation Alerts.simulate has a new signature 1 Cascading from row 19: Alerts.simulate accepts AlertSimulatorRequestBody.properties?: AlertSimulatorRequestPropertiesUnion, and AlertSimulatorRequestPropertiesUnion changed (row 19). Direct params and options are unchanged; this is entirely cascade-driven.
26 Operation Assessments.createOrUpdate has a new signature / Operation Assessments.get has a new signature 2 Cascading from rows 18 and 16: SecurityAssessment model references additionalData?: AdditionalDataUnion (row 18) and resourceDetails?: ResourceDetailsUnion (row 16), both in broken_models. Return type change (AssessmentsCreateOrUpdateResponse -> SecurityAssessmentResponse) is response wrapper removal.
27 Operation Automations.createOrUpdate has a new signature / Operation Automations.get has a new signature / Operation Automations.validate has a new signature 3 Cascading from row 20: Automation model references actions?: AutomationActionUnion[], and AutomationActionUnion changed (row 20). Additionally, return type response wrappers removed (AutomationsCreateOrUpdateResponse/AutomationsGetResponse/AutomationsValidateResponse -> raw model).
28 Operation SecurityConnectors.createOrUpdate has a new signature / Operation SecurityConnectors.get has a new signature / Operation SecurityConnectors.update has a new signature 3 Cascading from row 21: SecurityConnector model references offerings?: CloudOfferingUnion[], and CloudOfferingUnion changed (row 21). Additionally, return type response wrappers removed (SecurityConnectorsCreateOrUpdateResponse/SecurityConnectorsGetResponse/SecurityConnectorsUpdateResponse -> SecurityConnector).
29 Operation Alerts.getResourceGroupLevel has a new signature / Operation Alerts.getSubscriptionLevel has a new signature 2 Response wrapper removed: old return type AlertsGetResourceGroupLevelResponse / AlertsGetSubscriptionLevelResponse (type aliases for Alert) replaced by Alert directly. Parameters and options are structurally unchanged.
30 Operation Pricings.get has a new signature / Operation Pricings.list has a new signature / Operation Pricings.update has a new signature 3 Response wrappers removed: PricingsGetResponse -> Pricing, PricingsListResponse -> PricingList, PricingsUpdateResponse -> Pricing. Parameters unchanged.
31 Operation SubAssessments.get has a new signature 1 Response wrapper removed: SubAssessmentsGetResponse -> SecuritySubAssessment. Parameters unchanged.
32 Removed Interface AdaptiveApplicationControls + 4 Removed Interface AdaptiveApplicationControls*OptionalParams 5 Operation group and its options interfaces removed because AdaptiveApplicationControls operations are out of TypeSpec scope for the Microsoft.Security/Security project.
33 Removed Interface AdaptiveNetworkHardenings + 4 Removed Interface AdaptiveNetworkHardenings*OptionalParams + Removed Interface AdaptiveNetworkHardeningsList 6 Same as row 32. AdaptiveNetworkHardenings operation group not in TypeSpec scope.
34 Removed Interface Connectors + 4 Removed Interface Connectors*OptionalParams + Removed Interface ConnectorSettingList 6 Same as row 32. Connectors operation group not in TypeSpec scope.
35 Removed Interface CustomAssessmentAutomations + 5 Removed Interface CustomAssessmentAutomations*OptionalParams + Removed Interface CustomEntityStoreAssignmentRequest 7 Same as row 32. CustomAssessmentAutomations and CustomEntityStoreAssignments operation groups not in TypeSpec scope.
36 Removed Interface CustomEntityStoreAssignments + 5 Removed Interface CustomEntityStoreAssignments*OptionalParams 6 Same as row 32.
37 Removed Interface IngestionSettings + 6 Removed Interface IngestionSettings*OptionalParams + Removed Interface IngestionConnectionString + Removed Interface IngestionSettingList + Removed Interface IngestionSettingToken 10 Same as row 32. IngestionSettings operation group not in TypeSpec scope.
38 Removed Interface SoftwareInventories + 3 Removed Interface SoftwareInventories*OptionalParams + Removed Interface SoftwaresList 5 Same as row 32. SoftwareInventories operation group not in TypeSpec scope.
39 35 Removed Interface *List / *Lists paging collection wrappers (e.g., AlertList, AutomationList, AllowedConnectionsList, ComplianceList, etc.) 35 Paging list wrapper interfaces removed; operations now return PagedAsyncIterableIterator<T> directly.
40 All remaining Removed Interface *OptionalParams entries for in-scope operation groups (e.g., AlertsGetResourceGroupLevelOptionalParams was renamed to current name; response wrappers AlertsGetResourceGroupLevelResponse, etc.) ~30 Options interfaces renamed from XxxOptionalParams pattern or response type aliases removed as part of emitter migration.
41 17 Removed Enum KnownXxx entries (e.g., KnownAdaptiveApplicationControlIssue, KnownConfigurationStatus, KnownEnforcementMode, KnownDirection, KnownFileType, etc.) 17 Orphan enums not reachable from any operation in the new TypeSpec SDK; tree-shaken by modular emitter.
42 Enum KnownAuthenticationType no longer has value AwsAssumeRole / AwsCreds / GcpCredentials 3 Cascading from row 34: cloud connector auth types (AwsAssumeRole, AwsCreds, GcpCredentials) were part of the Connectors operation group, which is removed from TypeSpec scope.
43 Enum KnownOfferingType no longer has value InformationProtectionAws 1 The InformationProtectionAws offering type and its associated InformationProtectionAwsOffering model are not included in the 2026-04-01-preview TypeSpec.
44 Remaining Removed Type Alias * entries (126 total): includes discriminator subtype aliases (AadExternalSecuritySolution, Alert, Automation, Pricing, SecurityConnector, etc.) and orphan model aliases from removed-scope operation groups 126 These were AutoRest-generated type aliases (e.g., type intersections, discriminator subtypes) that are now either proper interfaces in the new SDK or no longer reachable from any operation (orphan pruning by modular emitter).
45 Remaining Removed Interface * not covered above (e.g., AuthenticationDetailsProperties, AzureTrackedResourceLocation, ETag, HybridComputeSettingsProperties, KindAutoGenerated, Location_2, PathRecommendation, ProtectionMode, PublisherInfo, Rule, SecureScoreControlScore, ServicePrincipalProperties, UserRecommendation, VmRecommendation, etc.) ~17 Orphan model types or AutoRest-generated utility interfaces not reachable from any operation in the new TypeSpec SDK.
46 Removed Interface DefenderForContainersAwsOfferingKubernetesScubaReader / Removed Interface InformationProtectionAwsOfferingInformationProtection / Removed Interface DefenderForServersAwsOfferingArcAutoProvisioningServicePrincipalSecretMetadata 3 Sub-model interfaces removed: first two because their parent offerings are not in scope (row 43); third because servicePrincipalSecretMetadata property was removed from DefenderForServersAwsOfferingArcAutoProvisioning (see row below).

Items Requiring Review

# Breaking Change Question
R1 Interface DefenderForServersAwsOfferingArcAutoProvisioning no longer has parameter servicePrincipalSecretMetadata This is a SecurityConnectors model property (in scope). Was servicePrincipalSecretMetadata deliberately removed from the 2026-04-01-preview API? If yes -> Type 1. If the TypeSpec omitted it accidentally -> Type 2a. Please verify against the spec PR (#41888).

Verification

  • Type 1 entries: 9
  • Type 2 entries: 287
  • Needs review: 1
  • Total: 297

Workflow phases completed: Phase 1 (context + API version map) -> Phase 2 (CHANGELOG extraction) -> Phase 3 (root cause + cascade detection for all 24 new-signature operations) -> Phase 4 (pattern matching) -> Phase 5 (self-review checklist) -> Phase 6 (counts verified, report built).

Self-review checklist:

  • No cosmetic descriptions used as root causes -- all causes are structural (workspaceId removed, discriminator field type changed, property removed)
  • All "new signature" entries investigated with direct params / options / cascade checks
  • Cascade chain verified for all 9 Type 2 new-signature entries (rows 25-31)
  • broken_models set built before cascade detection
  • Type 1 + Type 2 + review = 9 + 287 + 1 = 297

@kazrael2119
Copy link
Copy Markdown
Member

Azure/azure-rest-api-specs#43108
this pr is to fix sample mismatch issue in tcgc

…curity/Security/tspconfig.yaml', API Version: 2026-04-01-preview, SDK Release Type: beta, and CommitSHA: 'ed1626873c0fd0d50df9538ed2608b4d7eac04f4' in SpecRepo: 'https://github.com/Azure/azure-rest-api-specs' Pipeline run: https://dev.azure.com/azure-sdk/internal/_build/results?buildId=6312077 Refer to https://eng.ms/docs/products/azure-developer-experience/develop/sdk-release/sdk-release-prerequisites to prepare for SDK release.
@kazrael2119
Copy link
Copy Markdown
Member

@GalGoldi72 we find that operation group softwareInventories has been removed and in spec repo side, it doesn't convert to typespec, could you help confirm if this is expected? Is this operation group is deprecated? thanks

@GalGoldi72
Copy link
Copy Markdown

@kazrael2119 thanks for flagging this. We're currently tracking down the current owner of the Microsoft.Security/softwareInventories API to confirm whether it should be migrated to TypeSpec or formally deprecated.

Some context I've gathered so far:

Will post back here once I have a definitive answer from the feature owner. Apologies for the delay — this is blocking release plan #2226.

@GalGoldi72
Copy link
Copy Markdown

@kazrael2119 — confirmed with the API owner: Microsoft.Security/softwareInventories is deprecated and can be dropped from the TypeSpec migration. ✅

Additional verification I ran:

  • GET https://management.azure.com/subscriptions/{subId}/providers/Microsoft.Security/softwareInventories?api-version=2021-05-01-preview returns 404 InvalidResourceType ("The resource type could not be found in the namespace 'Microsoft.Security'...") — so the API is not operationally available through ARM.
  • softwareInventories is not among the 91 resource types registered for Microsoft.Security (verified via az provider show).
  • Zero registration in Rome-Arm-Manifest across all clouds.

Please proceed with the PR — there's no consumer-facing breaking change since the API was never callable. Thanks for catching this and for your patience!

@kazrael2119
Copy link
Copy Markdown
Member

Hi @GalGoldi72 we have two questions we'd like to confirm with you regarding the Security API spec:


Question 1 – ruleType discriminator values for models decorated with @hierarchyBuilding(TimeWindowCustomAlertRule)

In IoTSecurityAPI/models.tsp, several concrete models (e.g., ActiveConnectionsNotInAllowedRange, AmqpC2DMessagesNotInAllowedRange, MqttD2CMessagesNotInAllowedRange, etc.) are annotated with @Azure.ClientGenerator.Core.Legacy.hierarchyBuilding(TimeWindowCustomAlertRule). This causes the generated SDK to surface them under the TimeWindowCustomAlertRule type hierarchy rather than as independent types.

Question: When a caller constructs and sends a TimeWindowCustomAlertRule payload, are the concrete ruleType string values (e.g., "ActiveConnectionsNotInAllowedRange", "AmqpC2DMessagesNotInAllowedRange", etc.) still valid and accepted by the service? Or is "TimeWindowCustomAlertRule" the only accepted value?


Question 2 – Is endTimeUtc in JitNetworkAccessPolicyInitiatePort a required input or a read-only response field?

In SecuritySolutionsAPI/models.tsp, endTimeUtc is currently defined as a required property on JitNetworkAccessPolicyInitiatePort (no ?, no @visibility(Lifecycle.Read)).

However, looking at the example InitiateJitNetworkAccessPolicy_example.json:

  • Request bodyendTimeUtc is absent; only allowedSourceAddressPrefix, duration, and number are provided.
  • Response bodyendTimeUtc is present, returned by the service.

Question: Should endTimeUtc actually be a read-only and optional field — i.e., populated by the service in the response rather than required as a caller-provided input? If so, the spec should be updated to mark it with @visibility(Lifecycle.Read) and ?.

Thanks!

@GalGoldi72
Copy link
Copy Markdown

@kazrael2119 — answers below:

Q1 — ruleType discriminator values

The concrete values (e.g., "ActiveConnectionsNotInAllowedRange", "AmqpC2DMessagesNotInAllowedRange", etc.) are still the valid wire-format values. @hierarchyBuilding(TimeWindowCustomAlertRule) is a client SDK grouping decorator (from Azure.ClientGenerator.Core.Legacy) — it only changes how these types are organized in the generated SDK class hierarchy. It does not change the wire-format ruleType string. "TimeWindowCustomAlertRule" itself is an abstract base and not a valid ruleType discriminator value; callers must always send a concrete value. This matches the original swagger's x-ms-discriminator-value for each model.

Q2 — endTimeUtc on JitNetworkAccessPolicyInitiatePort

We investigated and confirmed this is a pre-existing inconsistency in the spec, not introduced by the TypeSpec migration:

  • The original swagger (stable/2020-01-01) has marked endTimeUtc as required since 2019 (Add jit request API and schema. azure-rest-api-specs#5889).
  • The example InitiateJitNetworkAccessPolicy_example.json has shown endTimeUtc absent from the request body but present in the response for the same period.
  • The TSP migration faithfully reproduces the swagger contract.

This JIT feature hasn't been actively maintained since 2020. We weren't able to confirm with a current feature owner whether the service actually requires endTimeUtc or auto-populates it. Given the existing wire contract is "required", we'd prefer not to relax it without sign-off — changing it to optional/read-only could let bad requests reach the service if the real behavior is "required". Tracking this as a follow-up spec hygiene item.

For this JS migration, can we proceed with the current (faithful) representation? The contract isn't changing vs. the previously published 6.0.0-beta.6, so there's no consumer-side regression. Trying to close release plan #2226.

Thanks!

@kazrael2119
Copy link
Copy Markdown
Member

kazrael2119 commented May 25, 2026

Q1 — ruleType discriminator values

The concrete values (e.g., "ActiveConnectionsNotInAllowedRange", "AmqpC2DMessagesNotInAllowedRange", etc.) are still the valid wire-format values. @hierarchyBuilding(TimeWindowCustomAlertRule) is a client SDK grouping decorator (from Azure.ClientGenerator.Core.Legacy) — it only changes how these types are organized in the generated SDK class hierarchy. It does not change the wire-format ruleType string. "TimeWindowCustomAlertRule" itself is an abstract base and not a valid ruleType discriminator value; callers must always send a concrete value. This matches the original swagger's x-ms-discriminator-value for each model.

Now there's an issue in the sample generation with this model, we will bump a new version for our codegen to fix this and verify if this issue is fixed

Q2 — endTimeUtc on JitNetworkAccessPolicyInitiatePort

We investigated and confirmed this is a pre-existing inconsistency in the spec, not introduced by the TypeSpec migration:

  • The original swagger (stable/2020-01-01) has marked endTimeUtc as required since 2019 (Add jit request API and schema. azure-rest-api-specs#5889).
  • The example InitiateJitNetworkAccessPolicy_example.json has shown endTimeUtc absent from the request body but present in the response for the same period.
  • The TSP migration faithfully reproduces the swagger contract.

This JIT feature hasn't been actively maintained since 2020. We weren't able to confirm with a current feature owner whether the service actually requires endTimeUtc or auto-populates it. Given the existing wire contract is "required", we'd prefer not to relax it without sign-off — changing it to optional/read-only could let bad requests reach the service if the real behavior is "required". Tracking this as a follow-up spec hygiene item.

For this JS migration, can we proceed with the current (faithful) representation? The contract isn't changing vs. the previously published 6.0.0-beta.6, so there's no consumer-side regression. Trying to close release plan #2226.

For this one, endTimeUtc is a required input parameter, but it doesn't exist in the input from InitiateJitNetworkAccessPolicy_example.json
This will also block our build:sample step, could you help add endTimeUtc in this example's input body?
I can manually fix this issue with a commit this time.

@GalGoldi72
Copy link
Copy Markdown

@kazrael2119 — investigated further and confirmed empirically that the service actually accepts either endTimeUtc or duration (mutually exclusive), so the example's use of duration reflects real service behavior. The spec has marked endTimeUtc as required since 2019 and omitted duration entirely — a pre-existing inconsistency.

Test results against POST .../jitNetworkAccessPolicies/{name}/initiate?api-version=2020-01-01 (non-existent policy, so the service validates the body first):

  • Body with only duration → body validation passed (got PolicyNotFound)
  • Body with only endTimeUtc → body validation passed (got PolicyNotFound)
  • Body with neither → 400 InvalidInitiateInput: "Only one of fields 'EndTimeUtc' and 'Duration' can be set."

That said, the JIT Network Access feature isn't owned by our team and the original spec authors have moved on. We don't want to modify a contract we don't own without sign-off from the current owner, especially since the existing (buggy) contract has been in every published JS beta for years and there are no known consumer complaints.

For unblocking this JS PR, please go ahead with your offered commit to add endTimeUtc to the example's request body to match the existing spec contract. We'll file a separate tracking issue for the JIT owner to address the spec discrepancy properly later.

Thanks!

kazrael2119 and others added 4 commits May 26, 2026 14:58
@kazrael2119
Copy link
Copy Markdown
Member

LGTM
cc @JialinHuang803

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

Labels

first-typespec-migration first time to migrate to typespec Mgmt This issue is related to a management-plane library. mgmt-review-in-progress Management SDK review is in progress Self-Service Release PR for self-service release

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants