Skip to content

Conversation

@vmarcelli-eng
Copy link
Contributor

Updated output error messages for Debug-AzStorageAccountADDSAuth

  • Previous Verbose messages that were not mentioned have now been added as Warnings
  • Removed Issues section at the bottom of output
  • Added Issues column to the Summary of Checks
  • Reduced message size for hyperlinks to docs via aka.ms

+ "`n`tTo debug connectivity problems, please refer to the following," `
+ "`n`t'AzFileDiagnostics.ps1'($($PSStyle.Foreground.BrightCyan)https://github.com/Azure-Samples/azure-files-samples/tree/master/AzFileDiagnostics/Windows$($PSStyle.Reset))'." `
+ "`n`tFor possible solutions please refer to '$($PSStyle.Foreground.BrightCyan)https://aka.ms/azfiles/entra-port445$($PSStyle.Reset)'"
Write-TestingFailed -Message $errMsg -ErrorAction Stop
Copy link
Collaborator

Choose a reason for hiding this comment

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

I don't think the -ErrorAction Stop is doing anything here, we can remove it. To test this, you can try:

try { Write-Error "test" -ErrorAction Stop } catch { Write-Host "caught write-error" }
try { Write-TestingFailed "test" -ErrorAction Stop } catch { Write-Host "caught write-testingfailed" }

image

$checks["CheckDomainLineOfSight"].Issue = $_
Write-Error "CheckDomainLineOfSight - FAILED"
Write-Error $_
Write-TestingFailed -Message $_ -IsUnexpected $true
Copy link
Collaborator

Choose a reason for hiding this comment

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

I think we may need to make some edits to Debug-DomainLineOfSight to also print in the expected way. Maybe we can make it return a bool saying whether we have line-of-sight or not, and then print what we need to here?

$checks["CheckADObjectPasswordIsCorrect"].Issue = $_
Write-Error "CheckADObjectPasswordIsCorrect - FAILED"
Write-Error $_
Write-TestingFailed -Mesage $_ -IsUnexpected $true
Copy link
Collaborator

Choose a reason for hiding this comment

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

Same thing here, I think it's not necessarily unexpected. This is because Test-AzStorageAccountADObjectPasswordIsKerbKey throws an error when it falis. But I don't love that pattern, doesn't let us distinguish test failures from actual exceptional cases that warrant exceptions.

vmarcelli-eng and others added 23 commits February 11, 2025 12:13
removed verbose messages that were replaced by new output. Messages which were not replaced were not removed.
replaced with new output
@shekharsorot shekharsorot requested a review from MaximeKjaer June 30, 2025 10:02
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.

2 participants