Skip to content

[SecurityInsights] Re-record tests, fix setup scripts, and resolve issues for AutoRest v4 migration#29316

Merged
JiaSeng-v merged 2 commits intoAzure:joyer/SecurityInsights-migrate-v4from
hadasi6:hadas/securityinsights-v4-recordings
Mar 26, 2026
Merged

[SecurityInsights] Re-record tests, fix setup scripts, and resolve issues for AutoRest v4 migration#29316
JiaSeng-v merged 2 commits intoAzure:joyer/SecurityInsights-migrate-v4from
hadasi6:hadas/securityinsights-v4-recordings

Conversation

@hadasi6
Copy link
Copy Markdown

@hadasi6 hadasi6 commented Mar 25, 2026

Description

This PR adds test recording updates and fixes for the SecurityInsights AutoRest v3→v4 migration (PR #28447).

The v4 migration invalidated some test recordings. This PR re-records all tests and fixes several issues
discovered during the process.

Recordings: Re-recorded all test recordings with v4 HTTP patterns. All 103 tests pass in
Playback (24 skipped, 0 failed).

AutoRest config (README.md): Added UserInfo directive — v4 excludes readOnly fields from PUT body, which
caused Update-AzSentinelBookmark to send a partial createdBy object (400 error). The directive makes email/name
writable in Update requests.

Setup scripts (utils.ps1, common.ps1):

  • New-AzDeployment → New-AzResourceGroupDeployment in 16 places (Az.Resources v9+ removed -Mode from
    subscription-level cmdlet)
  • Fixed workspace and playbook output reading for the new cmdlet
  • Added playbook deployment retry for API connection propagation delay
  • Fixed UTF-8 byte count for log ingestion Content-Length header
  • Fixed dataConnectorId save on partial deployment failure (AzureSecurityCenter connector succeeds even when
    Office365 fails)
  • Added ThreatIntelligence indicator retry on transient errors

Test logic changes:

  • Update-AzSentinelIncidentRelation: Changed to assert 409 Conflict — the incidents/relations endpoint does
    not support updating an existing relation's target.
  • Remove-AzSentinelDataConnector: Changed from MicrosoftCloudAppSecurity to GenericUI (MCAS connector requires
    a service license not available in test environment).

Bug fix (custom/New-AzSentinelDataConnector.ps1): Fixed GenericUI PermissionResourceProvider and
PermissionCustom assignment — was incorrectly assigned to AvailabilityStatus.

Mandatory Checklist

  • SHOULD update ChangeLog.md file(s) appropriately
    • Update src/{{SERVICE}}/{{SERVICE}}/ChangeLog.md.
      • A snippet outlining the change(s) made in the PR should be written under the ## Upcoming Release header in the past tense.
    • Should not change ChangeLog.md if no new release is required, such as fixing test case only.
  • SHOULD regenerate markdown help files if there is cmdlet API change. Instruction
  • SHOULD have proper test coverage for changes in pull request.
  • SHOULD NOT adjust version of module manually in pull request

@azure-client-tools-bot-prd
Copy link
Copy Markdown

Thanks for your contribution! The pull request validation has started. Please revisit this comment for updated status.

@hadasi6 hadasi6 force-pushed the hadas/securityinsights-v4-recordings branch from a8b9233 to e6fffbd Compare March 25, 2026 21:45
@JiaSeng-v JiaSeng-v merged commit b758056 into Azure:joyer/SecurityInsights-migrate-v4 Mar 26, 2026
1 check was pending
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants