Repository navigation
Add functionality to convert App to Enterprise Application - #10
Conversation
…ntrol.xaml.cs Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
…trol.xaml.cs Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
There was a problem hiding this comment.
Pull Request Overview
This PR adds functionality to convert App Registrations to Enterprise Applications and enhances the UI to support this feature. The changes refactor the data model to centralize application data within an enhanced AppRegInfo structure while adding new service methods for Enterprise Application management.
- Centralizes application data structure to include both app registration and enterprise application information
- Adds new service methods to create and remove Enterprise Applications
- Updates UI components to work with the refactored data model and display enterprise application status
Reviewed Changes
Copilot reviewed 16 out of 18 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| README.md | Updates image reference from .png to .jpg format |
| AzureCommandsHandler.cs | Adds enterprise application conversion methods and updates app info population logic |
| AppRegInfo.cs | Extends model to include enterprise application data and Microsoft Graph imports |
| MainWindow.xaml.cs | Refactors to use centralized AppRegInfo model instead of separate Application properties |
| MainWindow.xaml | Updates data bindings to use AppRegInfo and adds enterprise application column |
| Multiple UserControl files | Updates all feature controls to use AppRegInfo instead of direct Application objects |
| BaseUserControl.cs | Changes base class to work with AppRegInfo model and updates extension method usage |
| ButtonExtensions.cs | Adds new method to get child controls in addition to text boxes |
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
| if (AppRegInfo != null) | ||
| { | ||
| AppReg.ApplicationIdUri = value; | ||
| OnPropertyChanged(nameof(AppReg)); | ||
| AppRegInfo?.Application?.ApplicationIdUri = value; |
There was a problem hiding this comment.
Null conditional operator used after null check. The assignment will have no effect if AppRegInfo.Application is null. Consider adding a null check or initializing the Application property if needed.
| AppId = AppRegInfo!.AppId, | ||
| DisplayName = AppRegInfo.DisplayName | ||
| }; | ||
| AppRegInfo?.EnterpriseApplicationObjectId = await UpdateAppRegAsync(sender, request, AzureCommandsHandler.ConvertToEnterpriseApplication); |
There was a problem hiding this comment.
Assignment using null conditional operator will have no effect if AppRegInfo is null. The method should handle the case where AppRegInfo is null or ensure it's not null before this assignment.
| AppRegInfo?.EnterpriseApplicationObjectId = await UpdateAppRegAsync(sender, request, AzureCommandsHandler.ConvertToEnterpriseApplication); | |
| AppRegInfo.EnterpriseApplicationObjectId = await UpdateAppRegAsync(sender, request, AzureCommandsHandler.ConvertToEnterpriseApplication); |
| AppRegInfo?.EnterpriseApplicationObjectId = null; | ||
| } |
There was a problem hiding this comment.
Assignment using null conditional operator will have no effect if AppRegInfo is null. The method should handle the case where AppRegInfo is null or ensure it's not null before this assignment.
| AppRegInfo?.EnterpriseApplicationObjectId = null; | |
| } | |
| if (AppRegInfo != null) | |
| { | |
| AppRegInfo.EnterpriseApplicationObjectId = null; | |
| } |
https://oauth.pstmn.io/v1/callback#error=invalid_client&error_description=AADSTS650052: The app is trying to access a service '7c4213b2-a373-4cf0-a002-93bd19a3d683'(Alfa1.ExactDataPlatform.Dev) that your organization '49445e6c-4079-4692-8349-8bb3853f22fc' lacks a service principal for. Contact your IT Admin to review the configuration of your service subscriptions or consent to the application in order to create the required service principal. Trace ID: 50b1aafa-1257-4493-bcbf-0f7f6d913900 Correlation ID: df93ae12-911e-464e-878e-271e62f29019 Timestamp: 2025-09-02 05:16:44Z&error_uri=https://login.microsoftonline.com/error?code=650052