Learn how to connect Business Central to Azure to configure the Square Payments extension.
Square Integrations: Business Central

Connect Business Central to Azure Beta release
This is pre-release documentation for an API in public beta and is subject to change.

This topic walks through the first half of the configuration process for the Dynamics 365 Business Central Square Payments extension, which connects Business Central to an Azure function.

Important

You should fully deploy and test the Square Payments extension in a separate testing environment before deploying it to production. Follow the steps in these topics to configure and test the extension and then repeat the steps in your production environment when you're ready to take payments.

  1. Open the Dynamics 365 Business Central dashboard.

  2. On the main search bar, enter Extensions Marketplace.

  3. In the Extensions Marketplace, search for Square Payments, and then choose Get it now to install it.

    A graphic showing the Square Payments extension in the Business Central App search.

  4. Wait for the installation to complete. To check the status of the installation, go to the Extension Management page, choose Manage, and then choose Deployment Status.

This Azure function is used to initialize your Square application within Business Central in step 3. Before completing this step:

  • You must have either the Application Administrator or Application Developer role in your Azure Active Directory tenant to create an Azure application.

  • Your Azure subscription must have the Owner role to be able to assign roles and deploy the Azure function.

  1. Log in to your Azure portal.

  2. Navigate to the Azure Active Directory service.

  3. In the left pane, choose App Registration.

  4. Choose New registration.

    A graphic showing the Microsoft Azure App registrations page with the "New registration" button emphasized.

  5. Enter your chosen Application Name.

  6. Enter the following value for the Redirect URI: https://api.businesscentral.dynamics.com. This is used to send webhook event notifications to Business Central.

  7. Choose Register.

    A graphic showing the Microsoft Azure page to register an application.

  8. In the left pane, choose Certificates & secrets.

  9. Choose New client secret.

  10. Enter a description for the secret and set it to expire in 24 months.

  11. Copy the Square Payment Plugin secret value and save it in a safe place. This secret value is used later in step 3.5 when you deploy the Azure function in Business Central.

Important

You cannot access this generated secret again after the page is closed. Ensure that it's saved in a safe place before leaving this page.

A graphic showing the Azure certificates and secrets page. The copy button is emphasized next to the Square Payment Plugin secret value.

  1. In the left pane, choose API permissions.

  2. On the Request API permissions page, choose Add a permission, and then choose Dynamics 365 Business Central.

  3. In the window that opens, choose the Delegated permissions tile, and then select the user_impersonation and Financials.ReadWrite.All checkboxes.

  4. Choose the Add permissions button.

    A graphic showing the delegated API permissions for an application in Microsoft Azure.

  5. In the API / Permissions name list, choose Grant admin consent for <your tenant name>. You must have Global Administrator permissions to do this.

    A graphic showing the configured API permissions for an application in Microsoft Azure.

  6. In the left pane, choose Overview.

  7. Choose Redirect URIs.

    A graphic showing the Overview page for an application in Microsoft Azure, with the Redirect URIs link emphasized.

  8. Choose Add URI and then enter the following Redirect URI: https://businesscentral.dynamics.com/OAuthLanding.htm.

  9. Choose Save.

    A graphic showing the Business Central Redirect URI for an application in Microsoft Azure

  10. Return to the Overview page.

  11. Copy the Application (client) ID value and save it for later. This value is used in step 3.5 to deploy the Azure function in Business Central.

    A graphic showing the Overview page for an application in Microsoft Azure, with the Application (client) ID emphasized.

  12. Go to the Azure Home page and choose Subscriptions.

  13. Choose the appropriate subscription to use with this application.

  14. Choose Access Control (IAM).

  15. Choose the Add button, and then choose Add role assignment.

  16. Choose the Contributor role. This allows the subscription to make changes to your application.

  17. Search for the name of your application in the text field, and then select it under Selected members. Your application has the name you gave it in step 2.5.

  18. Choose Save.

  1. Return to the Business Central dashboard.

  2. Open Setups & Extensions, and then choose the Assisted Setup page.

  3. Under Connect with other systems, choose Square Function Deployment Wizard.

    A graphic showing a list of extensions in Business Central with "Square Function Deployment Wizard" emphasized.

  4. Enter your Business Central username and password.

  5. Enter your client ID and client secret. These are the values saved in step 2.11 and step 2.22 of Register an Application in Azure Active Directory.

  6. Choose Next.

  7. In the Select Subscription drop-down list, choose the same subscription you used in step 2.24. Only subscriptions with the Contributor role are displayed in this list.

  8. In the Select Location drop-down list, choose a location. This location should correspond to the subscription you chose in the previous step.

  9. In the Select a Resource Group drop-down list, choose a group or name your own. The name cannot include spaces.

  10. The Azure function name is generated automatically, but you can change it if you want.

  11. Choose Next and wait for the deployment task to complete before proceeding.

    A graphic showing the Square function deployment wizard in Business Central.

  12. When the deployment is successful, copy the link to the Azure function to use in step 5 as a callback URL and webhook URL. This link is also available in the Square Settings page in Business Central under the Webhook URL property. You can navigate to the Square Settings page by searching for it on the Business Central search bar.

After the Azure function is deployed, you're ready to connect Business Central to your Square account.