Azure Monitor Export to a SQL Server - azure

I need the near real-time front end data from a web app for use in PowerBI. I need to keep this data forever.
I would like to automatically export the App customEvents and pageViews tables for this purpose.
It seems like I need to go from Azure Logs -> Azure Storage Account -> Azure SQL Server -> PowerBI
The steps I'm having trouble with are going from Logs to storage, and then getting the data that's passed into there into a SQL server.

To send logs to Storage Accounts, Event Hubs and Log Analytics, go to the App Service and on the left panel select Diagnostic setting and click on + Diagnostic settings.
Select the options which are shown in below image to store the logs in Storage account and click on Save.
You can now use Azure Data Factory service to copy the logs from Azure Storage account to Azure SQL Database.
Please refer this tutorial from Microsoft – Copy data from Azure Blob storage to a SQL Database by using the Copy Data tool to implement the same.
Once data available in Database, we are good to use Power BI to read the data.
Open the Power BI dashboard and click on Get data from another source ->.
Select Azure -> Azure SQL Database and click on Connect.
Give the server’s name.
In the next step just give the username and password for your account and you will get the access.
Now you can select the data from any table and showcase it in Power BI dashboard as per of your requirement.

Related

Azure SQL storing database logs

For storing Azure SQL database logs, is it necessary to explicitly create blob for logs storage or it is implicitly created. I read this and this post but still not sure about it?
Also, for Java/Spring application deployed in App Services, when using App Insights, Log Analytics and Azure Monitor for Application logs, HTTP and Access logs and DB logs, do I need to explicitly setup blob for storing logs?
No, you do not need to create a blob storage for Azure SQL database logs as they are stored in Azure SQL database transaction logs and can be viewed using Azure Monitor or audited using Azure SQL Auditing.
Steps to check the Logs in SQL DB under Monitor section.
After creating azure SQL database and server.
Go to monitoring tab as mentioned in below screenshot and the logs can be viewed.
Approach 2
Using Log Analytics
Create a Log analytics workspace in Azure.
And go to the SQL Database and choose the Diagnostics from left pane in monitoring tab.
Add a diagnostic setting and choose the created log analytics and choose the log option as mentioned in below screenshot.
You can find the logs as shown below.
To store the Azure SQL Logs explicitly
You need to create 'Storage Account' for storing logs.
And have to enable Azure Monitor Logs from your SQL server and select 'Diagnostic logs' from the Azure Monitor menu and then, turn on the logs and select the storage account you created.
And configure log retention by selecting the Logs tab in the Azure Monitor menu, and then choose 'Retention policy' to configure how long logs will be retained.
To verify logs in the storage account, go to the storage account and select 'Containers.' You should see a container named 'insights-logs-sqlserverauditlog.' You can then browse the logs stored in this container.

Can Synapse Spark connect to a "Log Analytics workspace"?

I need to export from "Log Analytics workspace" to storage account in parquet / delta format. How can I achieve this?
Using the ADX Spark connector in a Notebook, it says that the URL is invalid. I’m using the URL of LAW instead of a cluster of AdX.
With a diffrent appraoch apart from ADX/Notebook, we can run the logic application afterwards and look for logs in the storage.
To learn more about Using a Logic App to archive data from the Log Analytics workspace to Azure storage, consult the Microsoft Documentation..
To do this, we only need access to the Log Analytics Workspace and Storage accounts.
Additionally, we can construct a trigger in the logic app that will run once daily or as frequently as needed to upload all the new data..
After the device has been activated, click Add New step to add an action that runs after the recurring action. Click "Azure Monitor Logs" after typing "azure monitor" into the "Choose an action" box. After setting up the full workflow, make a blob and attach it to the workflow as shown below:
Later, we can execute the logic application and search the log store.
Reference link: Microsoft Documentation
Export data from a Log Analytics workspace to a storage account by using Logic Apps

How to get Users Logging Information Using Log Analytics in Azure SQL Database

I am trying to get Users logged in information in Azure SQL Database Using Log Analytics. Can it be possible if so, can you please help me on this ?
Below are Options available in Diagnostic Settings for Azure SQL Database.
Click 'Add Diagnostic setting' above to configure the collection of the following data:
DmsWorkers
ExecRequests
RequestSteps
SqlRequests
Waits
Basic
InstanceAndAppAdvanced
WorkloadManagement
I want to achieve this without using Sys schemas objects related to Azure SQL Databases.
Thanks,
Brahma
You need to enable Auditing in Azure SQL Server using and then you can check the logs in Azure Log Analytics.
Easiest way to enable auditing is through the Azure Portal. However, it can be easily set up through ARM templates, Azure Powershell, Azure CLI.
Auditing can be enabled either at the individual database level or at the logical server level. If enabled at the server level then it automatically applies to existing databases and any new databases that are created.
However, enabling both at the server and database level leads to duplicate logs.
In the homepage of the desired Azure Sql server, in the left pane there is an option for “Auditing”.
By default, Auditing is off. Enable it. Choose the Log Analytics Workspace where you need to store the logs. Click on Save.
Click on Add diagnostics setting. Let us enable diagnostics for errors and InstanceAndAppAdvanced. Send this data to the log analytics workspace using your subscription and log analytics workspace. Click on Save for the configuration.
To view the logs, open up the Log Analytics workspace that was configured as a sink and choose logs and select the scope.
Summarizing the connection attempts by caller IP addresses
AzureDiagnostics
|summarize count() by client_ip_s
Source: https://www.mssqltips.com/sqlservertip/6782/kusto-query-language-query-audit-data-azure-sql-database/

Different ways to access data from Azure Data Share to Azure SQL Database

We are working on implementing a new project in Azure. The idea is to move out of on-premise systems into the cloud as we have our vendors, partners and clients moving into the cloud. The option we are trying out is to use Azure Data Share and have Azure SQL Database subscribe to the data.
The thing we are now trying to explore is once a new data snapshot is created how do we import this data into Azure SQL Database?
For instance we have Partner information and this information is made available via Azure Data Share and new data snapshot is created daily.
The part that I am not sure of is how to synchronize this data between Azure Data Share and Azure SQL Database.
Also, Is there an api available to expose this data out to external vendors, partners or clients from Azure SQL Database after we have data sync to Azure SQL Database from Azure Data Share?
Azure Data Share -> Azure SQL Database
Yes, Azure SQL Database is a supported.
Azure Data Share -> SQL Server Database (on-prem)? Is this option supported?
No, SQL Server Database (on-prem) is not supported.
Is there an api that could be consumed to read data?
Unfortunately, there is no such API that could be consumed to read data.
Azure Data Share enables organizations to simply and securely share data with multiple customers and partners. In just a few clicks, you can provision a new data share account, add datasets, and invite your customers and partners to your data share. Data providers are always in control of the data that they have shared. Azure Data Share makes it simple to manage and monitor what data was shared, when and by whom.
Azure Data Share helps enhance insights by making it easy to combine data from third parties to enrich analytics and AI scenarios. Easily use the power of Azure analytics tools to prepare, process, and analyze data shared using Azure Data Share.
Which Azure data stores does Data Share support?
Data Share supports data sharing to and from Azure Synapse Analytics, Azure SQL Database, Azure Data Lake Storage, Azure Blob Storage, and Azure Data Explorer. Data Share will support more Azure data stores in the future.
The below table details the supported data sources for Azure Data Share.
How to synchronize this data between Azure Data Share and Azure SQL Database.
You need to choose “Snapshot setting” to refresh data automatically.
A data provider can configure a data share with a snapshot setting. This allows incremental updates to be received on a regular schedule, either daily or hourly. Once configured, the data consumer has the option to enable the schedule.

Azure Cross Directory Data Access

I'm currently developing a Azure solution for one of my managed service clients.
we are developing a power bi service for their Azure backup/ azure recovery.
we are looking to host the whole process in our own azure environment, however we cannot get the data from A) their recovery vault logs into B) our Azure environment.
Anyone have any ideas on how to move data from their environment into our environment storage?
thank you
Power BI based reporting gets the data from storage accounts which store Azure Backup data. Once customer configured diagnostic settings to send data to a storage account(ask him to create a dedicated storage account for this), he can share the access keys with you so that you can connect to customer's storage account to get the required data and run Power Bi report in your environment.
This doc has all the details - with the change being in this case, customer will store data in his storage account and provide you access to that storage account via access key.

Resources