Azure AI Services Diagnostic Logging Follow Along - Azure AI Engineer Associate (AI-102)
Science & Technology
Introduction
In this article, we will explore how to set up diagnostic settings for Azure AI Services, allowing us to keep track of operations and performance. By integrating logging solutions like Log Analytics and Storage Accounts, we can effectively monitor our services. Below are the detailed steps based on the video tutorial provided.
Setting Up Diagnostic Settings
Access Your Azure AI Service: Begin by navigating to the Azure AI Service you created in a previous session. This can be found in the Azure Portal on the left-hand side.
Add Diagnostic Settings: Within the service, look for the option to add diagnostic settings. Here, you can configure your service to send logs to a Log Analytics workspace and a Storage Account.
Create a New Storage Account:
- Navigate to the Storage Accounts section in the Azure portal.
- Click on "Create" to set up a new storage account for diagnostic settings.
- Assign a unique name, such as
mystorageDsettings
, which ensures there are no naming conflicts. - Select the region (e.g., "West US") and the performance tier (Standard is sufficient).
- Review the configuration and hit "Create."
Create a New Log Analytics Workspace:
- Navigate to the Log Analytics workspaces section.
- Click on "Create" to set up a new workspace.
- Provide a name like
myLogAnalyticsD332
and create it.
Initiate Azure ML Studio: Since starting Azure ML Studio can take some time, navigate to your Azure ML Studio setup created earlier. Launch the workspace to prepare for uploading and processing your datasets.
Configure Diagnostic Settings: Once both the storage account and Log Analytics workspace are created, go back to your Azure AI Service and refresh the page. Now, configure the diagnostic settings to direct logs to the newly created resources.
Trigger Data Events: Using a Jupyter Notebook in Azure ML, trigger some events to generate logs. You can create sample data by running a simple translation task (e.g., translations of common greetings or queries).
Review Generated Data: Once you have triggered enough events, check back on the storage account for logs and metrics. Navigate to metrics to find out how many transactions occurred.
Query Log Analytics: Open the Log Analytics workspace. You can run relevant queries to get insights into the logs generated. Use
Azure Diagnostics
in the query syntax to filter down to the necessary data from Azure AI Services.Troubleshooting Common Issues: Be prepared to wait as certain logs may take time to propagate in Log Analytics. Understanding that Azure services can sometimes behave unpredictably can help manage expectations.
Clean Up Resources: After finishing the diagnostic setup and testing, make sure to delete any unnecessary resources such as the created log analytics group and storage accounts to avoid incurring costs.
Keywords
Azure AI Services, Diagnostic Settings, Log Analytics, Storage Accounts, Azure ML Studio, Jupyter Notebook, Data Events, Metrics, Propagation, Resource Cleanup.
FAQ
Q1: What are diagnostic settings in Azure?
A1: Diagnostic settings in Azure allow users to configure their resources to send logs and metrics to different storage solutions, such as Log Analytics and storage accounts, for monitoring and analysis.
Q2: Why do I need a Log Analytics workspace?
A2: A Log Analytics workspace is used to store log and diagnostic data from Azure services, enabling users to run queries and gain insights from the data.
Q3: How can I check the number of logs generated?
A3: You can check the number of logs by navigating to your storage account's metrics section, where you'll see transaction counts among other data insights.
Q4: Can it take time to see logs in Log Analytics?
A4: Yes, it can take some time for logs to propagate and appear in Log Analytics after the events are triggered.
Q5: What should I do with resources after testing?
A5: It's advisable to delete unused resources such as storage accounts and Log Analytics workspaces to avoid unnecessary charges.