Skilling tasks
- Create a Log Analytics workspace
- Configure Log Analytics data retention and archive policies
- Enable access to a Log Analytics workspace
Exercise instructions
Create a Log Analytics workspace
- In the Azure Portal Search Bar, enter Log Analytics and select Log Analytics workspaces from the list of results.
- On the Log Analytics workspaces page, choose Create.
-
On the Basics page of the Create Log Analytics workspace wizard, provide the following information and choose Review + Create.
Property Value Subscription Your subscription Resource Group rg-alpha Name LogAnalytics1 Region East US - Review the information and choose Create.
Install and configure the Log Analytics agent on Linux-VM2
- In the Azure Portal Search Bar, enter Virtual Machines and select Virtual Machines from the list of results.
- On the Virtual Machines page, select Linux-VM2.
- On the Linux-VM2 page, choose Extensions + Applications under Settings.
- Choose Add and select the Log Analytics agent for Linux (also known as OmsAgentForLinux). Choose Next.
- For the Workspace ID and Workspace Key, navigate to LogAnalytics1 > Settings > Agents in a separate browser tab or window.
- Copy the Workspace ID and Primary Key from the LogAnalytics1 workspace.
- Return to the Linux-VM2 extension installation page and paste the Workspace ID and Workspace Key. Choose Review and Create, and then choose Create.
- After the installation completes, on the Linux-VM2 Extensions + Applications page, select the AzureNetworkWatcherExtension.
- On the extension details page, ensure that Enable automatic upgrade is set to Yes. If not, enable it and choose Save.
- Return to the Extensions + Applications page and select the OmsAgentForLinux extension.
- On the extension details page, ensure that Enable automatic upgrade is set to Yes. If not, enable it and choose Save.
Configure Log Analytics data retention and archive policies
- In the Azure Portal Search Bar, enter Log Analytics and select Log Analytics workspaces from the list of results.
- On the Log Analytics workspaces page, choose LogAnalytics1.
- On the Log Analytics workspace page for LogAnalytics1, choose Usage and estimated costs.
- Select Data Retention and set the slider to 60 days. Choose OK.
- On the Log Analytics workspace page for LogAnalytics1, choose Usage and estimated costs.
- Select Daily cap. Choose On. Set the daily cap to 10 GB and choose OK.
Enable access to a Log Analytics workspace
- In the Azure Portal Search Bar, enter Log Analytics and select Log Analytics workspaces from the list of results.
- On the Log Analytics workspaces page, choose LogAnalytics1.
- Select Access control (IAM).
- Choose Add and then choose Add role assignment.
- On the list of roles, select Log Analytics Reader and choose Next.
- On the Members page, choose Select Members and choose the App Log Examiners security group. Choose Select.
- On the Members space, choose Review + Assign.