This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// https://aka.ms/adx.blog | |
UsagePreliminary | |
| where Date == datetime(2023-08-01) | |
| where MeterId == "2c57ed84-f939-4f5c-ba90-782349a367b8" | |
| where ResourceId == "/subscriptions/9ec51cfd-5ca7-4d76-8101-dd0a4abc5674/resourcegroups/mc_analyticsengine_analyticsengine_eastus/providers/microsoft.compute/virtualmachinescalesets/aks-secretagent-37798712-vmss" | |
UsagePreliminary | |
| summarize Quantity=sum(Quantity) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#connect @MyFreeCluster/MyDatabase | |
let data = dynamic( | |
``` | |
<?xml version="1.0" encoding="UTF-8"?> | |
<duration> | |
<value>118.0</value> | |
<count>5.0</count> | |
<min>100.0</min> | |
<max>150.0</max> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//external | |
#connect cluster('kvc0wyc7zw8bafmkdc1bzv.southcentralus').database('MyDatabase') | |
.set-or-append async OpenAIQnA <| | |
let d= dynamic( | |
{ | |
"statusCode": 200, | |
"headers": { | |
"Transfer-Encoding": "chunked", | |
"Vary": "Accept-Encoding", |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
let series_cosine_similarity_fl=(vec1:dynamic, vec2:dynamic, vec1_size:real=double(null), vec2_size:real=double(null)) | |
{ | |
let dp = series_dot_product(vec1, vec2); | |
let v1l = iff(isnull(vec1_size), sqrt(series_dot_product(vec1, vec1)), vec1_size); | |
let v2l = iff(isnull(vec2_size), sqrt(series_dot_product(vec2, vec2)), vec2_size); | |
dp/(v1l*v2l) | |
}; | |
let s1=pack_array(0, 1); | |
let s2=pack_array(sqrt(2), sqrt(2)); | |
print angle=acos(series_cosine_similarity_fl(s1, s2))/(2*pi())*360 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// PLEASE TRY ON YOUR OWN FIRST! https://aka.ms/adxinaday | |
// Labs are subject to change in the future based on feedback. | |
// SPOILER ALERT: Answers below. | |
//v2 | |
.create-merge table logsRaw(Timestamp:datetime, Source:string, Node:string, Level:string, Component:string, ClientRequestId:string, Message:string, Properties:dynamic) | |
//3.2 | |
logsRaw |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#connect cluster('kvc43f0ee6600e24ef2b0e.southcentralus.kusto.windows.net').database('MyDatabase') | |
// GET | |
let Uri = "https://prices.azure.com/api/retail/prices?$filter=serviceName eq 'Azure Purview' and location eq 'EU West'"; | |
evaluate http_request(Uri) | |
| project ResponseBody.Items | |
| mv-expand ResponseBody_Items | |
| evaluate bag_unpack(ResponseBody_Items) | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#connect cluster('adxpm10774.eastus.kusto.windows.net').database('IoTAnalytics') | |
.set-or-replace PlotlyTemplate <| cluster('help.kusto.windows.net').database('Samples').PlotlyTemplate | |
PlotlyTemplate | |
.create-or-alter function with (folder = "Packages\\Plotly", docstring = "Render 3D scatter chart using plotly template") | |
plotly_scatter3d_fl(tbl:(*), x_col:string, y_col:string, z_col:string, aggr_col:string='', chart_title:string='3D Scatter chart') | |
{ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#connect cluster('https://demo11.westus.kusto.windows.net').database('ML') | |
demo_make_series1 | |
| take 100 | |
demo_make_series1 | |
| summarize count() by bin(TimeStamp, 1h) | |
| render timechart | |
demo_make_series1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#connect cluster('adxpm10774.eastus').database('IoTAnalytics') | |
//Data lands in the StageIoTRaw table so lets look at that first | |
.show table StageIoTRawData | |
StageIoTRawData | |
| limit 10 | |
//We use an update policy to flatten this data and append it to the Thermostat table | |
.show table Thermostats |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#connect cluster('adxpm10774.eastus').database('IoTAnalytics') | |
//Data lands in the StageIoTRaw table so lets look at that first | |
.show table StageIoTRawData | |
StageIoTRawData | |
| limit 10 | |
//We use an update policy to flatten this data and append it to the Thermostat table |