@@ -20,7 +20,7 @@ I recently wanted to be able to create deep links to a specific query in Applica
20
20
For example, you might want to share a specific query with a colleague or include a link in some system documentation.
21
21
In these scenarios the portal has a built-in Share features that is useful:
22
22
23
- ![ alt text] ( ./deep-linking-to-queries-in-application-insights-with-python/ portal-share.png " 'Copy link to query' option in portal ")
23
+ ![ alt text] ( ./portal-share.png " 'Copy link to query' option in portal ")
24
24
25
25
This gives you a link in this form: `https://portal.azure.com#@ <TENANT_ID>/blade/Microsoft_OperationsManagementSuite_Workspace/
26
26
Logs.ReactView/resourceId/%2Fsubscriptions%2F<SUBSCRIPTION_ID>%2F
@@ -48,15 +48,15 @@ def get_simple_link(
48
48
resource_group_name : str ,
49
49
app_insights_name : str ,
50
50
query : str ,
51
- time_frame : str = " P1D"
51
+ timespan : str = " P1D"
52
52
):
53
53
# Set safe to empty string to ensure slashes are encoded
54
54
encodedQuery = urllib.parse.quote(query, safe = " " )
55
55
return (f " https://portal.azure.com#@ { tenant_id} /blade/Microsoft_Azure_Monitoring_Logs/ " +
56
56
f " LogsBlade/resourceId/%2Fsubscriptions%2F { subscription_id} %2FresourceGroups%2F " +
57
57
f " { resource_group_name} %2Fproviders%2Fmicrosoft.insights%2Fcomponents%2F " +
58
58
f " { app_insights_name} /source/LogsBlade.AnalyticsShareLinkToQuery/query/ { encodedQuery} " +
59
- f " /timespan/ { time_frame } " )
59
+ f " /timespan/ { timespan } " )
60
60
61
61
```
62
62
@@ -104,7 +104,7 @@ def get_compressed_link(
104
104
resource_group_name : str ,
105
105
app_insights_name : str ,
106
106
query : str ,
107
- time_frame : str = " P1D"
107
+ timespan : str = " P1D"
108
108
):
109
109
# Get the UTF8 bytes for the query
110
110
query_bytes = query.encode(' utf-8' )
@@ -125,7 +125,7 @@ def get_compressed_link(
125
125
f " LogsBlade/resourceId/%2Fsubscriptions%2F { subscription_id} %2FresourceGroups%2F " +
126
126
f " { resource_group_name} %2Fproviders%2Fmicrosoft.insights%2Fcomponents%2F " +
127
127
f " { app_insights_name} /source/LogsBlade.AnalyticsShareLinkToQuery/q/ { encodedQuery} " +
128
- f " /timespan/ { time_frame } " )
128
+ f " /timespan/ { timespan } " )
129
129
```
130
130
131
131
We can call this function in the same way as the previous one:
0 commit comments