Connect Business Central to Azure
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.
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.
Open the Dynamics 365 Business Central dashboard.
On the main search bar, enter Extensions Marketplace.
In the Extensions Marketplace, search for Square Payments, and then choose Get it now to install it.
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.
Log in to your Azure portal.
Navigate to the Azure Active Directory service.
In the left pane, choose App Registration.
Choose New registration.
Enter your chosen Application Name.
Enter the following value for the Redirect URI: https://api.businesscentral.dynamics.com. This is used to send webhook event notifications to Business Central.
In the left pane, choose Certificates & secrets.
Choose New client secret.
Enter a description for the secret and set it to expire in 24 months.
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.
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.
In the left pane, choose API permissions.
On the Request API permissions page, choose Add a permission, and then choose Dynamics 365 Business Central.
In the window that opens, choose the Delegated permissions tile, and then select the user_impersonation and Financials.ReadWrite.All checkboxes.
Choose the Add permissions button.
In the API / Permissions name list, choose Grant admin consent for <your tenant name>. You must have Global Administrator permissions to do this.
In the left pane, choose Overview.
Choose Redirect URIs.
Choose Add URI and then enter the following Redirect URI: https://businesscentral.dynamics.com/OAuthLanding.htm.
Return to the Overview page.
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.
Go to the Azure Home page and choose Subscriptions.
Choose the appropriate subscription to use with this application.
Choose Access Control (IAM).
Choose the Add button, and then choose Add role assignment.
Choose the Contributor role. This allows the subscription to make changes to your application.
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.
Return to the Business Central dashboard.
Open Setups & Extensions, and then choose the Assisted Setup page.
Under Connect with other systems, choose Square Function Deployment Wizard.
Enter your Business Central username and password.
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.
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.
In the Select Location drop-down list, choose a location. This location should correspond to the subscription you chose in the previous step.
In the Select a Resource Group drop-down list, choose a group or name your own. The name cannot include spaces.
The Azure function name is generated automatically, but you can change it if you want.
Choose Next and wait for the deployment task to complete before proceeding.
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.