{"title":"Security Guide: How to Secure Business Central","url":"https://jonas-paprotka.de/docs/dev-itpro/security/security-scenarios-guide/","by":"JOP-AL","license":"Copyright (c) Microsoft Corporation. CC BY 4.0, https://creativecommons.org/licenses/by/4.0/; code samples MIT. From https://learn.microsoft.com/en-us/dynamics365/business-central/dev-itpro/security/security-scenarios-guide, MicrosoftDocs/dynamics365smb-devitpro-pb at 828b6ee (2026-11-19). Changed: includes filled in, links to this site, and for agents shortened without dropping a fact.","credit":"Microsoft Corporation, CC BY 4.0","origin":"https://learn.microsoft.com/en-us/dynamics365/business-central/dev-itpro/security/security-scenarios-guide","source":{"name":"Business Central developer and IT pro docs","repo":"https://github.com/MicrosoftDocs/dynamics365smb-devitpro-pb","commit":"828b6ee72fcd75755627cd6011f3d20899217ab2","date":"2026-11-19"},"checked":"2026-11-19","description":"Practical security scenarios and best practices for partners, administrators, auditors, and developers working with Dynamics 365 Business Central.","date":"2025-12-16","meta":{"topic":"how-to"},"outline":[{"level":1,"title":"Security Guide: How to Secure Business Central","slug":"security-guide-how-to-secure-business-central","at":0,"chars":34090},{"level":2,"title":"Partner scenarios","slug":"partner-scenarios","at":259,"chars":7463},{"level":3,"title":"Ensure consultants don't have persistent access to all customers you manage","slug":"ensure-consultants-dont-have-persistent-access-to-all-customers-you-manage","at":280,"chars":3507},{"level":3,"title":"Secure API access for automation tools you build for customers","slug":"secure-api-access-for-automation-tools-you-build-for-customers","at":3787,"chars":3935},{"level":2,"title":"Administrator scenarios","slug":"administrator-scenarios","at":7722,"chars":13951},{"level":3,"title":"Restrict access to externals services from Business Central calls","slug":"restrict-access-to-externals-services-from-business-central-calls","at":7749,"chars":2931},{"level":3,"title":"Monitor and respond to suspicious sign-in attempts","slug":"monitor-and-respond-to-suspicious-sign-in-attempts","at":10680,"chars":3735},{"level":3,"title":"Enforce multifactor authentication for all users","slug":"enforce-multifactor-authentication-for-all-users","at":14415,"chars":3968},{"level":3,"title":"Implement separation of duties for financial transactions","slug":"implement-separation-of-duties-for-financial-transactions","at":18383,"chars":3290},{"level":2,"title":"Developer scenarios","slug":"developer-scenarios","at":21673,"chars":4379},{"level":3,"title":"Secure API calls from your Business Central extension to external services","slug":"secure-api-calls-from-your-business-central-extension-to-external-services","at":21696,"chars":4356},{"level":2,"title":"Auditor scenarios","slug":"auditor-scenarios","at":26052,"chars":7639},{"level":3,"title":"Verify that appropriate security controls are in place","slug":"verify-that-appropriate-security-controls-are-in-place","at":26073,"chars":3870},{"level":3,"title":"Track and report on data access patterns","slug":"track-and-report-on-data-access-patterns","at":29943,"chars":3748},{"level":2,"title":"Related information","slug":"related-information","at":33691,"chars":399}],"text":"# Security Guide: How to Secure Business Central\nThis guide provides scenario-based security recommendations organized by persona. Each best practice includes context, solution, guidance, benefits, and trade-offs to help you make informed security decisions.\n## Partner scenarios\n### Ensure consultants don't have persistent access to all customers you manage\nContext and problem:\nPartners managing multiple customers through GDAP (Granular Delegated Admin Privileges) face a security risk when consultants have persistent, always-on administrative access to customer environments. A compromised consultant account could lead to unauthorized access across all customers. Compliance requirements and customer trust demand minimizing standing privileges.\nSolution:\nImplement time-bound privileged access using Microsoft Entra ID Privileged Identity Management (PIM) combined with granular delegated admin privileges (GDAP) group-based access control.\nSee Microsoft Entra Privileged Identity Management<https://learn.microsoft.com/entra/id-governance/privileged-identity-management/pim-configure> and Granular delegated admin privileges<https://learn.microsoft.com/partner-center/gdap-introduction>.\nGuidance:\n1. Set up GDAP with groups:\n 1. In your partner's Microsoft Entra ID tenant, create one security group per customer you have a GDAP relationship with (for example, `GDAP-CustomerA-Admins`, `GDAP-CustomerB-Admins`). See Manage Microsoft Entra groups and group membership<https://learn.microsoft.com/entra/fundamentals/how-to-manage-groups>.\n  Don't directly assign consultants to these groups permanently.\n 1. Establish the GDAP relationship with each customer, linking the relevant security group to the appropriate Microsoft Entra roles. See Manage Microsoft Entra groups and group membership<https://learn.microsoft.com/entra/fundamentals/how-to-manage-groups>.\n1. Configure PIM for time-bound access:\n 1. Enable Microsoft Entra ID Privileged Identity Management (requires Microsoft Entra ID P2 or Microsoft Entra ID Governance license). See Start using Privileged Identity Management<https://learn.microsoft.com/entra/id-governance/privileged-identity-management/pim-getting-started>.\n 1. Make the GDAP customer groups eligible for activation in PIM rather than permanently assigned. See Assign eligibility for a group in Privileged Identity Management<https://learn.microsoft.com/entra/id-governance/privileged-identity-management/groups-assign-member-owner>.\n 1. Configure activation requirements (for example, justification, approval workflow, maximum duration).\n 1. Set appropriate activation duration limits (for example, 4-8 hours).\nConsultant workflow:\nHere's the workflow for consultants when PIM is configured:\n When a consultant needs to work on a specific customer, they request activation of the relevant customer group in PIM.\n They provide business justification (for example, ticket number, task description).\n Access is granted for the specified time window only.\n Access automatically expires after the configured duration.\nBenefits:\n Reduced attack surface: Compromised credentials have limited blast radius and time window\n Audit trail: Complete logging of who accessed what customer, when, and why\n Compliance: Meets regulatory requirements for just-in-time access and least privilege\n Customer trust: Demonstrates commitment to security best practices\n Competitive advantage: Can be marketed as a security differentiator\nTrade-offs:\n Licensing cost: Requires Microsoft Entra ID P2 or Governance licenses\n Initial setup complexity: Requires configuring PIM and GDAP groups for each customer\n User friction: Consultants must request access before working, adding 1-5 minutes overhead\n Administrative overhead: Might require approval workflows and monitoring\n### Secure API access for automation tools you build for customers\nContext and problem:\nPartners often build automation tools, integrations, or monitoring solutions that need to call Business Central APIs across multiple customer tenants. Using personal admin accounts or long-lived secrets creates security risks and operational fragility.\nSolution:\nUse managed identities with Federated Identity Credentials (FIC) when running in Azure, or implement secure credential management for non-Azure scenarios.\nSee Business Central Administration Center API<../administration/administration-center-api>, ../administration/itpro-introduction-to-automation-apis, and What are managed identities for Azure resources?<https://learn.microsoft.com/entra/identity/managed-identities-azure-resources/overview>.\nGuidance:\nIf running in Azure (recommended):\n1. Deploy your automation as an Azure resource (Function App, Logic App, or Azure Container Instance). See Azure Functions<https://learn.microsoft.com/azure/azure-functions/functions-overview>, Azure Logic Apps<https://learn.microsoft.com/azure/logic-apps/logic-apps-overview>, or Azure Container Instances<https://learn.microsoft.com/azure/container-instances/container-instances-overview>.\n1. Enable system-assigned or user-assigned managed identity on the Azure resource. See https://learn.microsoft.com/entra/identity/managed-identities-azure-resources/how-manage-user-assigned-managed-identities.\n1. Register an app in your partner's Microsoft Entra ID. See Register an application with the Microsoft identity platform<https://learn.microsoft.com/entra/identity-platform/quickstart-register-app>.\n1. Configure Federated Identity Credential on the app registration, linking it to the Azure resource's managed identity. See Configure an application to trust a managed identity<https://learn.microsoft.com/entra/workload-id/workload-identity-federation-config-app-trust-managed-identity> and https://learn.microsoft.com/entra/workload-id/workload-identity-federation.\n1. Grant consent to the app in customer tenants as a partner or direct as a customer. See Manage Access to Environments<../administration/tenant-admin-center-manage-access>.\nYour code acquires tokens automatically using the managed identity-no secrets to manage. See https://learn.microsoft.com/entra/identity-platform/v2-oauth2-client-creds-grant-flow#third-case-access-token-request-with-a-federated-credential.\nIf not running in Azure:\n1. Create a dedicated app registration per integration/tool. See Register an application with the Microsoft identity platform<https://learn.microsoft.com/entra/identity-platform/quickstart-register-app>.\n1. Use certificate-based authentication instead of client secrets. See Microsoft identity platform application authentication certificate credentials<https://learn.microsoft.com/entra/identity-platform/certificate-credentials>.\n1. Store certificates securely in Azure Key Vault or hardware security modules. See About Azure Key Vault certificates<https://learn.microsoft.com/azure/key-vault/certificates/about-certificates>.\n1. Implement certificate rotation procedures (every 12 months minimum). See Automate the rotation of a secret for resources that have two sets of authentication credentials<https://learn.microsoft.com/azure/key-vault/secrets/tutorial-rotation-dual>.\n Use separate credentials per customer environment when possible.\n1. Monitor API usage through telemetry. See Monitoring and Analyzing Telemetry<../administration/telemetry-overview>.\nBenefits:\n No credential theft risk (managed identity scenario)\n Fine-grained access control per customer\n Complete audit trail of API calls\n Compliance with zero-trust principles\nTrade-offs:\n Azure dependency for optimal security (managed identities)\n Complexity in multitenant scenarios\n Learning curve for FIC and managed identity concepts\n Cost of Azure resources (minimal-Function Apps can run on consumption plan)\n## Administrator scenarios\n### Restrict access to externals services from Business Central calls\nContext and problem:\nYour Business Central environment (Marketplace apps or per-tenant extensions) calls external services (APIs, Azure Storage, databases). You want to ensure only legitimate traffic from Business Central reaches these services. Business Central is an online (SaaS) solution where environments are regularly rebalanced and upgraded across application services with changing IP addresses. So you need a solution that works with Business Central's dynamic infrastructure.\nSolution:\nUse Azure service tags and network access controls to create allow lists based on Business Central's IP ranges.\nSee Use Azure security service tags<security-service-tags> and Azure service tags overview<https://learn.microsoft.com/azure/virtual-network/service-tags-overview>.\nGuidance:\nScenario A: Destination service supports service tags natively\n(only Azure functions or web apps (in Azure App Services) support service tags natively in firewall rules)\n1. Navigate to your Azure resource's networking settings.\n1. Configure firewall rules or network access controls.\n1. Add a rule allowing traffic from the Dynamics365BusinessCentral service tag.\n1. Remove any overly permissive rules (for example, \"Allow all Azure services\").\nScenario B: Destination is Azure Storage Account\n(Special case due to internal routing)\n1. Create an Azure Function as a proxy in the same region as Business Central.\n1. Restrict Azure Function access using service tag-based access restriction: allow Dynamics365BusinessCentral.\n1. Create a private endpoint or virtual network integration from Azure Function to Storage Account.\n1. Configure your Business Central extension to call the Azure Function instead of Storage directly.\n1. Azure Function proxies requests to Storage Account.\nScenario C: Destination supports IP allowlisting only\n(On-premises systems, non-Microsoft SaaS, custom APIs)\n1. Retrieve current Business Central IP ranges:\n ```powershell\n $serviceTags = Get-AzNetworkServiceTag -Location eastus2\n $bcTag = $serviceTags.Values | Where-Object { $_.Name -eq \"Dynamics365BusinessCentral\" }\n $bcTag.Properties.AddressPrefixes\n ```\n1. Configure firewall/network rules on destination to allow these IP ranges.\n1. Monitor the ChangeNumber property and update rules when Microsoft updates the ranges.\n1. Consider automating updates using Azure Automation or scheduled scripts.\nBenefits:\n Prevents unauthorized access from non-Business Central sources\n Reduces attack surface significantly\n Compliance with network segmentation requirements\nTrade-offs:\n No per-environment granularity: Service tag includes all Business Central environments globally\n Maintenance overhead: IP ranges change over time (though infrequently)\n Proxy complexity: Storage Account scenario requires extra Azure Function\n Regional limitations: Must be in supported Azure regions for some scenarios\n### Monitor and respond to suspicious sign-in attempts\nContext and problem:\nAttackers might attempt credential stuffing, password spraying, or brute-force attacks against your Business Central users. Integration accounts might use incorrect credentials. You need visibility into authentication failures to detect threats early and respond appropriately.\nSolution:\nImplement comprehensive monitoring of authentication events using Microsoft Entra sign-in logs and Business Central telemetry.\nSee Monitoring and Analyzing Telemetry<../administration/telemetry-overview> and Sign-in logs in Microsoft Entra ID<https://learn.microsoft.com/entra/identity/monitoring-health/concept-sign-ins>.\nGuidance:\n1. Set up Microsoft Entra ID sign-in logging:\n 1. In Microsoft Entra admin center<https://entra.microsoft.com>, open the Sign-in Logs. See https://learn.microsoft.com/entra/identity/monitoring-health/howto-access-activity-logs#view-logs-through-the-microsoft-entra-admin-center.\n 1. Configure diagnostic settings to route logs to:\n   Azure Monitor Log Analytics workspace<https://learn.microsoft.com/azure/azure-monitor/logs/log-analytics-workspace-overview> (recommended for querying)\n   Azure Storage<https://learn.microsoft.com/azure/storage/common/storage-account-overview> (for long-term retention)\n   Azure Event Hubs<https://learn.microsoft.com/azure/event-hubs/event-hubs-about> (for Security Information and Event Management (SIEM) integration)\n   Retention: Set to at least 90 days for security investigations\n    See https://learn.microsoft.com/entra/identity/monitoring-health/howto-configure-diagnostic-settings.\n1. Create alert rules for suspicious patterns:\n  Multiple failed sign-ins: Alert when user has >5 failures in 10 minutes\n  Impossible travel: Alert when sign-ins occur from geographically distant locations within short timeframes\n  Unfamiliar locations: Alert when sign-ins come from countries/regions where you don't operate\n  Disabled accounts: Alert on any authentication attempt to disabled accounts\n See https://learn.microsoft.com/azure/azure-monitor/alerts/alerts-create-new-alert-rule.\n Sample KQL query for Log Analytics:\n ```kusto\n SigninLogs\n | where AppDisplayName contains \"Business Central\"\n | where ResultType != 0  // Failed sign-ins\n | summarize FailureCount=count() by UserPrincipalName, IPAddress, bin(TimeGenerated, 10m)\n | where FailureCount > 5\n ```\n1. Monitor Business Central telemetry:\n 1. Enable Business Central telemetry to Azure Application Insights. See Turn environment telemetry on or off<../administration/telemetry-enable-application-insights>.\n 1. Monitor authorization failures and permission errors and API authentication failures for service accounts. See ../administration/telemetry-authorization-trace ../administration/telemetry-permission-error-trace, and Web Services telemetry<../administration/telemetry-webservices-trace>.\n1. Establish response procedures:\n  Investigate high-priority alerts within 1 hour\n  For confirmed attacks: Reset credentials, enable Conditional Access if not already active\n  For integration failures: Check service principal certificates/secrets expiration\n  Document incidents for trend analysis\nBenefits:\n Early threat detection before damage occurs\n Forensic capability for security incidents\n Operational insights (for example, expiring integration credentials)\n Compliance evidence for audit requirements\n Reduced MTTR (mean time to respond)\nTrade-offs:\n Alert fatigue: Too many alerts can desensitize teams\n Cost: Log Analytics charges based on data ingestion and retention\n Expertise required: Creating effective KQL queries requires learning curve\n False positives: Legitimate scenarios (for example, VPN users) might trigger alerts\n### Enforce multifactor authentication for all users\nContext and problem:\nPassword-only authentication is vulnerable to phishing, credential theft, and account takeover. Regulatory requirements and security best practices mandate multifactor authentication (MFA), but enabling it requires balancing security with user experience.\nSolution:\nImplement Microsoft Entra Conditional Access policies to require MFA for Business Central access with modern authentication methods.\nSee Setting up Multifactor Authentication for Business Central<multifactor-authentication>, Conditional Access overview<https://learn.microsoft.com/entra/identity/conditional-access/overview>, and Authentication and Credential Types<../administration/users-credential-types>.\nGuidance:\n1. Assess current authentication methods:\n  Review authentication methods report in Microsoft Entra ID.\n  Identify users still using SMS/voice call (less secure).\n  Plan migration to Microsoft Authenticator app or FIDO2 security keys.\n1. Configure Conditional Access policy:\n 1. In Microsoft Entra admin center<https://entra.microsoft.com>, navigate to Protection > Conditional Access.\n 1. Create new policy. See Create a Conditional Access policy<https://learn.microsoft.com/entra/identity/conditional-access/how-to-policy-mfa-admin-portals>.\n 1. Set assignments:\n   Users: Include \"All users\" or specific Business Central user groups\n   Target Resources: Select \"Dynamics 365 Business Central\". Learn more Conditional Access: Target resources<https://learn.microsoft.com/entra/identity/conditional-access/concept-conditional-access-cloud-apps>\n   Access controls: Grant access, but require multifactor authentication\n   Session controls: Consider sign-in frequency (for example, require reauth every seven days)\n1. Enable modern authentication methods:\n  In Microsoft Entra admin center<https://entra.microsoft.com>, select Authentication methods > Policies. See Authentication methods in Microsoft Entra ID<https://learn.microsoft.com/entra/identity/authentication/concept-authentication-methods>.\n  Enable Microsoft Authenticator (push notifications and passwordless)\n  Enable Passkey (FIDO2)\n  Enable Temporary Access Pass for new user onboarding\n  Disable less secure methods (SMS, voice) after transition period\n See Manage authentication methods for Microsoft Entra ID<https://learn.microsoft.com/entra/identity/authentication/concept-authentication-methods-manage>.\n1. Plan rollout:\n  Phase 1 (report-only mode): Monitor impact without enforcing.\n  Phase 2 (pilot group): Enable for IT and early adopters.\n  Phase 3 (broad deployment): Roll out to all users with communication plan.\n  Provide user training and help desk preparation.\n1. Handle service accounts:\n  Use certificate-based authentication for automated processes. See https://learn.microsoft.com/entra/identity-platform/certificate-credentials.\n  Never exempt service accounts from security policies.\n  Consider managed identities for Azure-hosted integrations. See What are managed identities for Azure resources?<https://learn.microsoft.com/entra/identity/managed-identities-azure-resources/overview>.\nBenefits:\n Reduction in account compromise risk\n Compliance with regulations\n User trust in platform security\n Passwordless future: Foundation for eliminating passwords entirely\n Conditional flexibility: Can exempt trusted locations if needed\nTrade-offs:\n User friction: Extra authentication step at sign-in\n Support burden: Initial increase in help desk calls during rollout\n License requirements: Conditional Access requires Microsoft Entra ID P1 minimum\n Legacy app challenges: Some integrations might not support modern auth\n Offline scenarios: Users need device access for authenticator app\n> IMPORTANT\n> Introducing new CA policies prompts users to reauthenticate. Plan changes during maintenance windows and communicate clearly to minimize disruption. Update background job credentials and service accounts before enforcement.\n### Implement separation of duties for financial transactions\nContext and problem:\nA single user with unrestricted access can create fraudulent transactions, approve their own payments, or modify critical master data without oversight. Regulatory frameworks (SOX, internal controls) require separation of duties to prevent fraud and errors.\nSolution:\nImplement Business Central's Approval Workflows combined with role-based permissions to enforce multi-person authorization for sensitive operations.\nSee Assign Permissions to Users and Groups</ui-define-granular-permissions> and /across-how-use-approval-workflows.\nGuidance:\n1. Identify sensitive operations requiring approval:\n  Payment journals exceeding threshold (for example, >$10,000)\n  Vendor master data changes (bank account modifications)\n  User permission changes or role assignments\n  Fixed asset disposals\n  Inventory adjustments above threshold\n  Customer credit limit increases\n1. Configure Approval Workflows:\n  In Business Central, go to Workflows.\n  Create approval workflow for each sensitive operation type.\n  Define approval hierarchy (for example, manager approval, finance director for large amounts).\n  Set threshold amounts where applicable.\n  Configure notifications (email, in-app).\n  Enable delegation for approver absence scenarios.\n See /across-how-use-approval-workflows.\n1. Design segregated permission sets:\n  Requester role: Can create payment journals but can't post\n  Approver role: Can approve but can't create their own requests\n  Posting role: Can only post preapproved transactions\n  Ensure no single user has all three capabilities\n  Use security groups for easier management\n See Assign Permissions to Users and Groups</ui-define-granular-permissions>.\n1. Implement audit logging:\n  Monitor sensitive fields tables (like Vendor Bank Account or company's IBAN number). See /across-log-changes#monitor-sensitive-fields\n  Monitor approval workflow telemetry.\n  Regular review of who approved what (monthly reconciliation).\n1. Handle exceptions:\n  Document emergency override procedures (requires C-level approval). See Manage emergency access accounts in Microsoft Entra ID<https://learn.microsoft.com/entra/identity/role-based-access-control/security-emergency-access>.\n  Temporary permission elevation should be logged and time-limited.\n  Post-incident review of all emergency actions.\nBenefits:\n Fraud prevention: Reduces risk of unauthorized transactions by 80%+ (industry data)\n Error reduction: Second review catches mistakes before posting\n Regulatory compliance: Meets SOX, GDPR accountability requirements\n Audit trail: Complete history of approval decisions\n Cultural impact: Reinforces accountability and control consciousness\nTrade-offs:\n Process delays: Approvals add time to transaction completion (hours to days)\n User resistance: Perceived as bureaucratic or lack of trust\n Complex setup: Requires careful workflow design and testing\n Approver availability: Vacation/absence can block operations (mitigate with delegation)\n Overhead for small transactions: Might need threshold-based rules\nBest practice:\nStart with high-risk, high-value transactions only. Expand separation of duties gradually based on risk assessment and user feedback. Balance control with operational efficiency.\n## Developer scenarios\n### Secure API calls from your Business Central extension to external services\nContext and problem:\nYour extension needs to call external APIs (payment gateways, shipping providers, tax services) and requires credentials or API keys. Hardcoding secrets in code or storing them in plain text creates severe security vulnerabilities.\nSolution:\nUse Azure Key Vault for secret storage, accessed via secure authentication patterns from AL code.\nSee What is Azure Key Vault?<https://learn.microsoft.com/azure/key-vault/general/overview> and ../developer/methods-auto/httpclient/httpclient-data-type.\nGuidance:\n1. Set up Azure Key Vault:\n  Create Azure Key Vault in same region as Business Central for optimal performance. See Quickstart: Create a key vault using the Azure portal<https://learn.microsoft.com/azure/key-vault/general/quick-create-portal>.\n  Store API keys, connection strings, certificates in a Key Vault.\n  Enable Key Vault logging to monitor secret access. See Azure Key Vault logging<https://learn.microsoft.com/azure/key-vault/general/logging>.\n  Configure access policies or use Azure role-based access control (RBAC). See Assign a Key Vault access policy<https://learn.microsoft.com/azure/key-vault/general/assign-access-policy> or Azure Key Vault RBAC guide<https://learn.microsoft.com/azure/key-vault/general/rbac-guide>.\n1. Access from Business Central:\n  Create app registration in customer's Microsoft Entra ID. See Register an application with the Microsoft identity platform<https://learn.microsoft.com/entra/identity-platform/quickstart-register-app>.\n  Upload certificate to app registration (do NOT use client secrets). See https://learn.microsoft.com/entra/identity-platform/certificate-credentials.\n  Grant app registration \"Get Secret\" permission on Key Vault. See Assign a Key Vault access policy<https://learn.microsoft.com/azure/key-vault/general/assign-access-policy>.\n1. AL code pattern: Use AL ../developer/methods-auto/httpclient/httpclient-data-type with certificate authentication.\n> NOTE\n> The following example is conceptual and shows the general pattern. For complete implementation details including OAuth token acquisition, certificate management, and error handling, see Azure Key Vault REST API<https://learn.microsoft.com/rest/api/keyvault/secrets/get-secret> and ../developer/methods-auto/httpclient/httpclient-addcertificate-string-string-method.\n```al\nlocal procedure GetApiKey(): Text\nvar\n    Client: HttpClient;\n    Headers: HttpHeaders;\n    Response: HttpResponseMessage;\n    Certificate: SecretText;\n    AccessToken: SecretText;\n    KeyVaultUrl: Text;\nbegin\n    // Retrieve certificate from Azure Key Vault\n    Certificate := GetCertificateFromKeyVault();\n\n    // Add certificate for authentication\n    Client.AddCertificate(Certificate);\n\n    // Acquire OAuth token using certificate (implementation required)\n    AccessToken := AcquireTokenWithCertificate();\n\n    // Add authorization header\n    Client.DefaultRequestHeaders(Headers);\n    Headers.Add('Authorization', SecretStrSubstNo('Bearer %1', AccessToken));\n\n    KeyVaultUrl := 'https://mykeyvault.vault.azure.net/secrets/api-key?api-version=7.3';\n\n    if not Client.Get(KeyVaultUrl, Response) then\n        Error('Failed to retrieve secret from Key Vault');\n\n    // Parse JSON response and return secret value (implementation required)\n    exit(ParseSecretFromResponse(Response));\nend;\n```\n1. Implement secret rotation:\n  Rotate secrets every 90 days minimum.\n  Use Key Vault secret versions.\n  Update references in Business Central setup tables without code changes.\n  Monitor Key Vault access using Business Central telemetry to track secret retrieval patterns and troubleshoot failures. See App Key Vault Secrets Telemetry<../administration/telemetry-extension-key-vault-trace>.\nBenefits:\n Centralized secret management: Single source of truth\n No secrets in code: Source control remains clean\n Audit trail: All secret access logged\n Rotation without deployment: Update secrets without recompiling extension\n Compliance: Meets encryption key management standards\nTrade-offs:\n Azure dependency: Requires Azure subscription\n Latency: Extra network call to Key Vault (cache appropriately)\n Complexity: More complex than hardcoded values\n Cost: Key Vault operations are metered\n Error handling: Need robust retry logic for Key Vault unavailability\n## Auditor scenarios\n### Verify that appropriate security controls are in place\nContext and problem:\nAs an auditor (internal or external), you need to verify that Business Central deployments meet security standards, compliance requirements, and internal policies. Manual verification is time-consuming and incomplete.\nSolution:\nUse a checklist-based approach combining automated queries and manual verification procedures.\nSee security-and-protection, Business Central Online Security<security-online>, and Microsoft Dynamics 365 Cloud Services Compliance<https://aka.ms/d365-compliance-list>.\nGuidance:\nAuthentication controls verification:\n1. Confirm MFA is enforced:\n  Review Microsoft Entra Conditional Access policies.\n  Verify \"Require MFA\" is enabled for Business Central app.\n  Check for exemptions or exclusions (should be minimal/none).\n  Sample authentication logs to confirm MFA claims in tokens.\n1. Check for legacy authentication blocks:\n  Review sign-in logs for BasicAuth protocol usage.\n  Confirm Conditional Access blocks legacy auth protocols.\n  Verify no app passwords are enabled.\nAuthorization controls verification:\n1. Review separation of duties:\n  Export user permission sets.\n  Verify no user has both \"Create Payment\" and \"Approve Payment\".\n  Check approval workflow configurations.\n  Review override/emergency access logs.\n1. Audit privileged access:\n  List all users with SUPER permission set.\n  Verify justification for each (should be minimal).\n  Check if PIM is used for admin access (time-bound).\n  Review admin action logs.\n See Assign Permissions to Users and Groups</ui-define-granular-permissions>.\nData protection verification:\n1. Confirm encryption at rest:\n  Verify TDE is enabled on database (online: automatic; on-premises: check SQL Server).\n  For on-premises: Confirm backup encryption enabled.\n  Check for customer-managed key (CMK) if required by policy.\n See transparent-data-encryption and Data Encryption at Rest<security-online#data-isolation-and-encryption>.\n1. Verify network encryption:\n  Confirm HTTPS/TLS 1.2+ for all client connections.\n  Check certificate validity and strength.\n  Review network service tag configurations.\n See Using Security Certificates with Business Central on-premises<../deployment/implement-security-certificates-production-environment>.\nMonitoring and detection:\n1. Verify logging is enabled:\n  Confirm Microsoft Entra sign-in logs retention (90+ days).\n  Verify Business Central telemetry is flowing to Application Insights.\n  Check change log is enabled for sensitive tables.\n  Review alert configurations.\n1. Test incident response:\n  Verify security runbooks exist.\n  Confirm contact procedures are documented.\n  Review past security incident reports.\nCompliance artifacts:\n1. Collect evidence:\n  Export Conditional Access policies (JSON).\n  Screenshot approval workflow configurations.\n  Export user permission reports with dates.\n  Collect security alert reports from last quarter.\n1. Document findings:\n  Use standardized control testing templates.\n  Rate controls: Effective / Needs Improvement / Ineffective.\n  Provide remediation recommendations with priority.\nBenefits:\n Standardized assessment: Consistent audit approach\n Evidence-based: Objective verification vs. self-attestation\n Comprehensive coverage: Technical and process controls\n Remediation roadmap: Clear action items from audit\nTrade-offs:\n Technical expertise required: Auditor needs Azure/Business Central knowledge\n Time investment: Thorough audit takes 8-16 hours per environment\n Access requirements: Needs elevated privileges to review all settings\n Point-in-time: Snapshot of controls, not continuous assurance\nAudit frequency recommendation:\n External compliance audits: Annual (SOC 2, ISO 27001)\n Internal security reviews: Quarterly\n Privileged access review: Monthly\n Automated control testing: Continuous (where possible)\n### Track and report on data access patterns\nContext and problem:\nFor compliance and security investigations, you need to understand who accessed what data, when, and from where. Business Central doesn't enable comprehensive data access logging by default.\nSolution:\nImplement multi-layered audit logging using Business Central change log, sensistive field monitoring, database auditing, and telemetry.\nSee Auditing Changes in Business Central</across-log-changes>, Monitoring and Analyzing Telemetry<../administration/telemetry-overview>, and transparent-data-encryption.\nGuidance:\n1. Enable Business Central change log and/or sensitive field monitoring.\n> NOTE\n> Change logging and sensitive field monitoring add overhead, which impacts performance. Sensitive field monitoring has significantly less performance impact than the change log feature, making it a recommended alternative.\nEnable change logging:\n1. In Business Central, go to Change Log Setup.\n1. Enable change logging for sensitive tables:\n  Customer, Vendor, Bank Account\n  G/L Entry, Customer Ledger Entry, Vendor Ledger Entry\n  User, User Group, Permission Set\n1. Select fields to track: All fields versus critical fields only.\nEnable sensitive field monitoring:\n1. In Business Central, go to Monitor Field Change Setup.\n1. Specify the fields that you want to monitor based on filter criteria, such as the data sensitivity classification for the fields.\n1. After you finish the guide, you can manage settings for field monitoring on the Field Monitoring Setup page.\nSee Auditing Changes in Business Central</across-log-changes>.\n1. Configure SQL Server Auditing (on-premises). See https://learn.microsoft.com/sql/relational-databases/security/auditing/create-a-server-audit-and-server-audit-specification.\n1. Use Business Central telemetry (online):\n 1. Enable environment telemetry to Application Insights. See Turn environment telemetry on or off<../administration/telemetry-enable-application-insights>.\n 1. Monitor custom telemetry events:\n   ../administration/telemetry-long-running-sql-query-trace (data access patterns)\n   ../administration/telemetry-permission-error-trace (unauthorized access attempts)\n   ../administration/telemetry-company-lifecycle-trace (cross-company access)\n1. Create access reports using KQL queries in Application Insights:\n  Daily access summary:\n    Who accessed which companies\n    Failed permission checks\n    After-hours access (outside 7am-7pm)\n  Sensitive data access:\n    Bank account field reads\n    Salary information views\n    Customer credit card data (if stored)\n See Kusto Query Language (KQL) overview<https://learn.microsoft.com/azure/data-explorer/kusto/query/> and Create a report in Business Central</ui-work-report>.\n1. Retention and archival:\n  Change log: Archive monthly to separate table and retain 13 months.\n  SQL Audit files: Retain 90 days active, 7 years archive.\n  Telemetry: Application Insights defaults 90 days. Export to storage for long-term.\nBenefits:\n Forensic capability: Investigate security incidents with complete history\n Compliance evidence: Demonstrate data access controls for audits\n Insider threat detection: Identify unusual access patterns\n Performance insights: Identify inefficient data access\nTrade-offs:\n Performance impact: Logging adds 5-15% overhead depending on scope\n Storage costs: Audit logs can be substantial (GB per month)\n Analysis complexity: Raw logs require queries/tools to extract insights\n Privacy considerations: Logging employee activity requires policy disclosure\nBest practice for auditors:\nDon't enable logging reactively after an incident. Implement comprehensive audit trails proactively. The data you didn't log yesterday can't be retrieved for today's investigation.\n## Related information\nsecurity-and-protection\nBusiness Central online security<security-online>\nBusiness Central on-premises security<security-onpremises>\nSecurity tips for business users<security-users>\nUse Azure Service Tags<security-service-tags>\nSetting up multifactor authentication<multifactor-authentication>\nManage access to environments<../administration/tenant-admin-center-manage-access>"}