Skip to content

Exception Handling For AuthZ Issues#14

Merged
Josina20 merged 4 commits intomainfrom
users/josjoy/roleerrormessages
Nov 18, 2025
Merged

Exception Handling For AuthZ Issues#14
Josina20 merged 4 commits intomainfrom
users/josjoy/roleerrormessages

Conversation

@Josina20
Copy link
Contributor

image

Copilot AI review requested due to automatic review settings November 15, 2025 00:16
@Josina20 Josina20 requested a review from a team as a code owner November 15, 2025 00:16
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 enhances exception handling for Azure authorization failures by introducing a centralized ExceptionHandler utility class and implementing specific handling for AuthorizationFailed errors from Azure CLI commands. The changes improve error reporting consistency and user experience when encountering permission issues during setup.

Key Changes:

  • Extracted exception handling logic from Program.cs into a new reusable ExceptionHandler class
  • Added specific detection and handling for Azure authorization failures in setup operations
  • Enhanced error messages to guide users on permission requirements (subscription or resource group level)

Reviewed Changes

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

Show a summary per file
File Description
Exceptions/ExceptionHandler.cs New centralized utility class for handling Agent365Exception with consistent console output and logging
Services/A365SetupRunner.cs Added authorization failure detection in webapp creation and AzWarnAsync method
Program.cs Refactored exception handler to use new utility class; configured logging to exclude Error/Fatal from console
Exceptions/AzureExceptions.cs Updated mitigation message to clarify that Contributor/Owner role can be at resource group level
Commands/SetupCommand.cs Added try-catch block for Agent365Exception with centralized handling

sellakumaran
sellakumaran previously approved these changes Nov 15, 2025
Copilot AI review requested due to automatic review settings November 18, 2025 20:06
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

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

@Josina20 Josina20 merged commit 864219b into main Nov 18, 2025
1 of 2 checks passed
@pontemonti pontemonti deleted the users/josjoy/roleerrormessages branch December 5, 2025 17:27
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.

4 participants