@@ -20,7 +20,7 @@ I recently wanted to be able to create deep links to a specific query in Applica
2020For example, you might want to share a specific query with a colleague or include a link in some system documentation.
2121In these scenarios the portal has a built-in Share features that is useful:
2222
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 ")
2424
2525 This gives you a link in this form: `https://portal.azure.com#@ <TENANT_ID>/blade/Microsoft_OperationsManagementSuite_Workspace/
2626 Logs.ReactView/resourceId/%2Fsubscriptions%2F<SUBSCRIPTION_ID>%2F
@@ -48,15 +48,15 @@ def get_simple_link(
4848 resource_group_name : str ,
4949 app_insights_name : str ,
5050 query : str ,
51- time_frame : str = " P1D"
51+ timespan : str = " P1D"
5252 ):
5353 # Set safe to empty string to ensure slashes are encoded
5454 encodedQuery = urllib.parse.quote(query, safe = " " )
5555 return (f " https://portal.azure.com#@ { tenant_id} /blade/Microsoft_Azure_Monitoring_Logs/ " +
5656 f " LogsBlade/resourceId/%2Fsubscriptions%2F { subscription_id} %2FresourceGroups%2F " +
5757 f " { resource_group_name} %2Fproviders%2Fmicrosoft.insights%2Fcomponents%2F " +
5858 f " { app_insights_name} /source/LogsBlade.AnalyticsShareLinkToQuery/query/ { encodedQuery} " +
59- f " /timespan/ { time_frame } " )
59+ f " /timespan/ { timespan } " )
6060
6161```
6262
@@ -104,7 +104,7 @@ def get_compressed_link(
104104 resource_group_name : str ,
105105 app_insights_name : str ,
106106 query : str ,
107- time_frame : str = " P1D"
107+ timespan : str = " P1D"
108108):
109109 # Get the UTF8 bytes for the query
110110 query_bytes = query.encode(' utf-8' )
@@ -125,7 +125,7 @@ def get_compressed_link(
125125 f " LogsBlade/resourceId/%2Fsubscriptions%2F { subscription_id} %2FresourceGroups%2F " +
126126 f " { resource_group_name} %2Fproviders%2Fmicrosoft.insights%2Fcomponents%2F " +
127127 f " { app_insights_name} /source/LogsBlade.AnalyticsShareLinkToQuery/q/ { encodedQuery} " +
128- f " /timespan/ { time_frame } " )
128+ f " /timespan/ { timespan } " )
129129```
130130
131131We can call this function in the same way as the previous one:
0 commit comments