Skip to content

Conversation

@Samhitha-Microsoft
Copy link
Contributor

…ouble hopon authentication issue

Description

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

Copilot AI review requested due to automatic review settings November 25, 2025 15:22
@azure-client-tools-bot-prd
Copy link

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

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 PR addresses a double hop authentication issue in the StackHCI module that occurs when cmdlets are invoked from within remote PowerShell sessions (e.g., via Invoke-Command). The fix prevents creating nested remote sessions by adding a -newSession $false parameter to Get-SetupLoggingDetails calls and making the Confirm-UserAcknowledgmentToUpgradeOS function handle null session parameters gracefully.

Key changes:

  • Modified Confirm-UserAcknowledgmentToUpgradeOS to accept optional session parameters and execute locally when no session is provided
  • Updated 11 functions to call Get-SetupLoggingDetails -newSession $false instead of creating new sessions
  • Added changelog entry documenting the fix

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.

File Description
src/StackHCI/StackHCI/ChangeLog.md Added changelog entry for double hop authentication fix
src/StackHCI/StackHCI.Autorest/custom/stackhci.ps1 Updated Confirm-UserAcknowledgmentToUpgradeOS to handle null sessions; modified 11 functions (VM attestation, remote support, session history cmdlets) to prevent nested session creation

You can also share your feedback on Copilot code review for a chance to win a $100 gift card. Take the survey.

- Additional information about change #1
-->
## Upcoming Release
* Prevention of DoubleHopOn Authentication issue.
Copy link

Copilot AI Nov 25, 2025

Choose a reason for hiding this comment

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

The changelog entry needs improvement for the primary audience (Azure PowerShell users). Current issues:

  1. Technical jargon: "DoubleHopOn Authentication" is developer terminology. Users don't know what this means.
  2. Missing context: The entry doesn't explain what was fixed or how it affects users.
  3. No issue reference: Missing a GitHub issue reference (e.g., [#12345]).

Suggested revision:

* Fixed authentication errors when running cmdlets from within remote PowerShell sessions
    - Resolves issue where certain cmdlets failed with "Access Denied" when invoked via `Invoke-Command`
    - Affects `Add-AzStackHCIVMAttestation`, `Remove-AzStackHCIVMAttestation`, remote support cmdlets, and attestation history cmdlets

This explains what was fixed, how it affects users, and provides specific impacted cmdlets.

Copilot generated this review using guidance from repository custom instructions.
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.

1 participant