Skip to content

Add functionality to convert App to Enterprise Application - #10

Merged
StefH merged 7 commits into
mainfrom
enterprise
Sep 3, 2025
Merged

StefH merged 7 commits into
mainfrom
enterprise

Conversation

@StefH

@StefH StefH commented Sep 3, 2025 •

Copy link
Copy Markdown
Member

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

@StefH StefH added the enhancement New feature or request label Sep 3, 2025
@StefH StefH self-assigned this Sep 3, 2025
@StefH
StefH requested a review from Copilot September 3, 2025 10:59

This comment was marked as outdated.

StefH and others added 3 commits September 3, 2025 13:04
…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>
@StefH
StefH requested a review from Copilot September 3, 2025 11:06

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

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 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.

Comment on lines +30 to +32
if (AppRegInfo != null)
{
AppReg.ApplicationIdUri = value;
OnPropertyChanged(nameof(AppReg));
AppRegInfo?.Application?.ApplicationIdUri = value;

Copilot AI Sep 3, 2025

Copy link

Choose a reason for hiding this comment

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

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.

Copilot uses AI. Check for mistakes.
AppId = AppRegInfo!.AppId,
DisplayName = AppRegInfo.DisplayName
};
AppRegInfo?.EnterpriseApplicationObjectId = await UpdateAppRegAsync(sender, request, AzureCommandsHandler.ConvertToEnterpriseApplication);

Copilot AI Sep 3, 2025

Copy link

Choose a reason for hiding this comment

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

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.

Suggested change
AppRegInfo?.EnterpriseApplicationObjectId = await UpdateAppRegAsync(sender, request, AzureCommandsHandler.ConvertToEnterpriseApplication);
AppRegInfo.EnterpriseApplicationObjectId = await UpdateAppRegAsync(sender, request, AzureCommandsHandler.ConvertToEnterpriseApplication);

Copilot uses AI. Check for mistakes.
Comment on lines +79 to +80
AppRegInfo?.EnterpriseApplicationObjectId = null;
}

Copilot AI Sep 3, 2025

Copy link

Choose a reason for hiding this comment

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

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.

Suggested change
AppRegInfo?.EnterpriseApplicationObjectId = null;
}
if (AppRegInfo != null)
{
AppRegInfo.EnterpriseApplicationObjectId = null;
}

Copilot uses AI. Check for mistakes.
@StefH
StefH merged commit 0233d95 into main Sep 3, 2025
@StefH
StefH deleted the enterprise branch September 3, 2025 19:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants