Skip to content

[Compute] Bug fix in Invoke-AzVMPatchAssessment #25714

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions src/Compute/Compute/ChangeLog.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
-->
## Upcoming Release
* Renamed parameter `-VmId` to `-SourceId` and added `-VmId` as an alias to `New-AzRestorePointCollection` cmdlet.
* Fixed a bug in `Invoke-AzVMPatchAssessment` to show AvailablePatches correctly.

## Version 8.1.0
* Added parameter `-SourceResourceId` to cmdlet `Add-AzVMDataDisk`.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ public class PSVirtualMachinePatchAssessmentResult
public int? CriticalAndSecurityPatchCount { get; set; }
public int? OtherPatchCount { get; set; }
public DateTime? StartDateTime { get; set; }
Copy link
Contributor

Choose a reason for hiding this comment

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

you need to add a breaking change suppression to this file:
tools/StaticAnalysis/Exceptions/Az.Compute/BreakingChangeIssues.csv

and add a description to this PR describing why you need to do this and it is not really a breaking change.

public IList<VirtualMachineSoftwarePatchProperties> Patches { get; set; }
public IList<VirtualMachineSoftwarePatchProperties> AvailablePatches { get; private set; }
Copy link
Contributor

Choose a reason for hiding this comment

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

So the issue was that the PS object made up a nonexistent Patches property instead of the AvailablePatches property which actually exists on the VirtualMachineAssessPatchesResult.cs object?

public ApiError Error { get; set; }
Copy link
Contributor

Choose a reason for hiding this comment

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

Please write a test for this as the initial functionality seems to have never been tested as this issue would have been caught back then.

}
}
Loading