Prerequisites: A completed scenario 2, an AAD App, and an online sandbox environment called QA with the setup for S2S as specified in task 1 and 2 here Using Service to Service Authentication - Business Central | Microsoft Docs completed. You will also need the BcContainerHelper PowerShell
module installed on your computer.
Note: Environments are only supported in public repositories or with GitHub Enterprise license (see https://docs.github.com/en/actions/deployment/targeting-different-environments/using-environments-for-deployment). We are considering adding a secondary option for listing environments.
- On github.com, open Settings and Environments in your project. Click New Environment and specify the name of the environment you have created in your tenant.
- Under Environment secrets, choose the Add Secret action. Create a secret called AUTHCONTEXT, and enter a COMPRESSED JSON construct with 3 values: TenantID (where the environment lives), ClientID, and ClientSecret (from the pre-requisites), like:
{"TenantID":"<TenantID>","ClientID":"<theClientID>","ClientSecret":"<theClientSecret>"}
- Navigate to Actions, select the Publish To Environment workflow and choose Run workflow. Enter latest in the App version field and the name of your environment or keep the * in the environment to receive the new version field. Click Run workflow.
- When the workflow completes, you can inspect the output of the workflow.
- And/or you can open the QA environment, navigate to Customers and see that your very own Hello World message appears.