CONTENT Introduction What is Azure App Registration? Understanding Client Secrets Real Business Scenario Best Practices for App Registration and Client Secrets Conclusion |
INTRODUCTION
Modern businesses rely on cloud-based applications like Dynamics 365, Power Apps, and various third-party services. To ensure seamless integration, secure authentication, and automated data access, organizations need a structured approach. Azure App Registration, a component of Microsoft Entra ID (formerly Azure Active Directory), plays a crucial role in enabling applications to authenticate securely without manual user intervention.
This article provides a practical understanding of Azure App Registration and Client Secrets, explaining their significance, implementation, and real-world applications. You will learn:
- Why Azure App Registration is a must for modern business apps
- How Client Secrets facilitate secure authentication
- A real-life example demonstrating automation using there technologies
- Best practices to enhance security and operational efficiency
WHAT IS AZURE APP REGISTRATION?
- Client ID: A unique identifier for the registered application, like a driver’s license number.
- Client Secret: A confidential key used for authentication (similar to a password for the application).
- Tenant ID: A unique identifier that associates the application with an organization’s Microsoft Entra ID directory.
- Automated Access – Business applications can retrieve and update data without user intervention.
- Stronger Security – Eliminates the risks of storing user credentials in applications.
- Seamless Integration – Power Apps, Power BI, and third-party tools can connect securely to Microsoft services.
- Regulatory Compliance – Ensures controlled access to sensitive data, supporting SOX and GDPR requirements.
UNDERSTANDING CLIENT SECRETS
- Client ID (to identify the app)
- Client Secret (to prove its identity)
- Tenant ID (to specify the organization’s Azure directory)
- Scope (defining the level of access requested)
- Do not store Client Secrets in source code or environment variables.
- Use Azure Key Vault to store and manage Client Secrets securely.
- Implement token expiration policies and regularly rotate secrets.
- Consider Managed Identities as a more secure alternative for Azure-hosted applications, eliminating the need for Client Secrets altogether.
REAL BUSINESS SCENARIO
- User-role assignments must be reviewed periodically, but manually exporting the data is time-consuming.
- IT cannot grant auditors direct access to sensitive security data.
- Managers require an intuitive way to review and approve access assignments without using complex processes/reports.
- By leveraging Azure App Registration, Power Automate, and Power BI, the company automates user access reviews as follows.
- The company needs an automated process to extract user-role assignments, store them in Power Apps for review, and visualize them in Power BI for compliance reporting.
- Register an App in Azure AD for Secure Access
- Extract User-Role Assignments from D365FO
- Store and Process Data in Power Apps
- Generate Power BI Dashboards for Compliance Teams
- Name: D365FO User Access Review App
- Supported account types: Choose Single Tenant (if internal) or Multi-Tenant (if external users need access). The purpose of this selection is to let a internal or a third party application to communicate. Select Single Tenant for internal use.
- Redirect URI (optional): Leave this field blank, as it is not required for this scenario. It is only needed in user login scenarios where a Power App relies on a human user signing in with their own Microsoft credentials (e.g., their D365FO or Microsoft 365 login) to access data. In contrast, this setup involves the app running independently with its own credentials (Client ID and Secret). Technically, such user-based authentication falls under a “delegated permissions” scenario, where the app acts on behalf of the user by using their identity to authenticate.
- Click Register.
- Go to API Permissions > + Add a permission
- Select Dynamics ERP.
- Choose permission type:
- Application Permissions: Use this if your Power App runs without a user logging in (e.g., a Power Automate flow pulling data automatically). This is “app-only” access, using the Client ID and Secret. This fits best in our scenario.
- Delegated Permissions: Use this if a user signs into the Power App and it pulls data on their behalf (e.g., they click a button to refresh the list). This uses the user’s login.
- Go to API Permissions > + Add a permission
- Select the permission level.
- Click Add permissions.
- Grant admin consent: Azure AD requires an admin to approve these permissions before they’re active. This ensures only authorized apps get access to D365FO.
- If you are admin, click Grant admin consent for <your tenant>.
- Go to Certificates & secrets > Client secrets.
- Click + New client secret.
- Set an expiration date.
- Click Add.
- Copy the Secret Value. It won't be visible later.
- Save Client ID, Tenant ID, and Client Secret in a secure location (Azure Key Vault recommended).
- Use System administration >> Data management workspace in D365FO.
- Locate the entity "Security user role association"(SecurityUserRoleAssociations).
- Use the OAuth 2.0 token obtained from Microsoft Entra ID.
- Call the OData API endpoint to fetch security role data.
- You must construct an OAuth 2.0 access token using your Client ID, Client Secret, and Tenant ID before making API calls to D365FO.
- Extract data in JSON or CSV format for further processing.
- Schedule periodic data extraction using Power Automate or Azure Logic Apps.
- Review user-role assignments (by sending D365FO security data to Power Apps) in an interactive interface.
- Approve or reject access changes based on predefined policies.
- Send alerts when new roles are assigned.
- Flag high-risk role assignments for immediate review.
- Generate audit logs for tracking access reviews.
- Users with excessive roles.
- Pending access approvals by managers.
- Trends in security role assignments over time.
- Set up scheduled reports for audit teams.
- Generate compliance reports with key risk indicators.
BEST PRACTICES FOR APP REGISTRATION AND CLIENT SECRETS
CONCLUSION
No comments:
Post a Comment