Fix in-flight export of Defender for Storage settings - #3927
Open
sary (sary8) wants to merge 2 commits into
Open
sary (sary8) wants to merge 2 commits into
sary (sary8) wants to merge 2 commits into
Conversation
The collection GET for Microsoft.Security/DefenderForStorageSettings is defined only in api-versions 2025-09-01-preview and 2026-01-01-preview. The version in use, 2022-12-01-preview, and the GA versions 2025-01-01 and 2025-06-01 answer 400 UnsupportedApiVersion, so the sub-resource was dropped from Export-AzRuleData output with a warning per storage account. Fixes Azure#3865
Records requests through IResourceExportContext so the api-version used for the DefenderForStorageSettings collection is asserted without calling Azure.
sary (sary8)
force-pushed
the
fix/defender-for-storage-api-version
branch
from
September 19, 2026 02:59
cc824b6 to
ab923b4
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
PR Summary
Microsoft.Security/DefenderForStorageSettingsduring in-flight storage account export from2022-12-01-previewto2025-09-01-preview. The older version answersUnsupportedApiVersionfor the collection request, so the sub-resource never lands in the export and a warning is written per storage account.2025-09-01-previewis the first version whose REST spec defines the collectionLISToperation. The GA versions2025-01-01and2025-06-01, and the2024-08-01-previewsuggested in the issue, define only.../DefenderForStorageSettings/{settingName}. The versions I tested are in my comment on the issue.Azure.Storage.Defender.MalwareScanandAzure.Storage.Defender.DataScanpass vacuously on in-flight data today and will start failing where the feature is off.Azure.Storage.DefenderCloudmoves the other way.ResourceExpandVisitor.Fixes #3865
Validation
properties.isEnabled,properties.malwareScanning.onUpload.isEnabledandproperties.sensitiveDataDiscovery.isEnabled.dotnet test tests/PSRule.Rules.Azure.Tests/PSRule.Rules.Azure.Tests.csprojPR Checklist