Forwarding logs to Azure Log Analytics
This guide would cover configuring your app builder application to forward application logs to your Azure Log Analytics workspace.
Prerequisites
- Access to an Azure Log Analytics workspace. If you need to create one, you can follow Azure's guide here.
- Local development setup for your App Builder application.
- The latest version of AIO CLI. Check your version by running
aio --version
. To update runnpm install -g @adobe/aio-cli
.
Steps to configure Log Forwarding
Open Azure Portal and navigate to the Azure Log Analytics workspace you want to use. Go to the workspace overview screen and pick Agent Management from the menu on the left. Copy the
Workspace ID
and thePrimary Key
for later use.Open terminal and navigate to the App Builder project directory on your machine.
Run the following command and supply the values copied in step 1 when prompted.
Copied to your clipboardaio app config set log-forwarding? select log forwarding destination: Azure Log Analytics? customer ID: <Workspace ID>? shared key: <Primary Key>? log type: <table_name_alpha_chars_only>Note:
- Replace the value of
Workspace ID
andPrimary Key
as copied in step 1. - Replace the value of
table_name_alpha_chars_only
with the custom table name that you wish to provide. This field only accepts alpha characters.
- Replace the value of
Verify that the config change has taken effect
Copied to your clipboardaio app config get log-forwardingExecute an action in your App Builder application workspace to generate logs.
Go to Azure Portal, and on the overview screen of your workspace, select Logs on the left menu. Run a query using the table name you provided in step 3. Note the table name that shows up on the Azure portal will have the suffix
_CL
appended to the table name you provided.If you don't see any logs in Azure, please check the log forwarding errors.
Copied to your clipboardaio app config get log-forwarding errorsNote: If you are unable to set up log forwarding correctly, please visit our App Builder forums for support.