Home

API for creating function in Azure LogAnalytics

%3CLINGO-SUB%20id%3D%22lingo-sub-265670%22%20slang%3D%22en-US%22%3EAPI%20for%20creating%20function%20in%20Azure%20LogAnalytics%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-265670%22%20slang%3D%22en-US%22%3E%3CP%3EHey%2C%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EAs%20mentioned%20in%20the%20documentary%20there%20is%20the%20option%20to%20create%20functions%20above%20my%20OMS%20workspace%20using%20the%20Azure%20Log%20Analytics%20portal.%26nbsp%3B%3C%2FP%3E%0A%3CP%3ERelated%20documentation%3A%3C%2FP%3E%0A%3CP%3E%3CA%20href%3D%22https%3A%2F%2Fdocs.microsoft.com%2Fen-us%2Fazure%2Flog-analytics%2Fquery-language%2Fadvanced-query-writing%3Ftoc%3D%2Fazure%2Fazure-monitor%2Ftoc.json%23functions%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noreferrer%20noopener%20noreferrer%22%3Ehttps%3A%2F%2Fdocs.microsoft.com%2Fen-us%2Fazure%2Flog-analytics%2Fquery-language%2Fadvanced-query-writing%3Ftoc%3D%2Fazure%2Fazure-monitor%2Ftoc.json%23functions%3C%2FA%3E%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EIs%20there%20an%20option%20to%20create%20a%20function%20using%20an%20API%3F%3C%2FP%3E%0A%3CP%3Esame%20as%20the%20API%20that%20is%20used%20for%20querying%3F%20(described%20here%3A%20%3CA%20href%3D%22https%3A%2F%2Fdev.loganalytics.io%2Freference%2Fpost-query%22%20target%3D%22_blank%22%20rel%3D%22nofollow%20noopener%20noreferrer%20noopener%20noreferrer%22%3Ehttps%3A%2F%2Fdev.loganalytics.io%2Freference%2Fpost-query%3C%2FA%3E)%3C%2FP%3E%0A%3CP%3EI%20couldn't%20find%20any%20documentation%20regarding%20this%20issue%20which%20will%20be%20very%20helpful%20for%20me.%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EThanks!%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-LABS%20id%3D%22lingo-labs-265670%22%20slang%3D%22en-US%22%3E%3CLINGO-LABEL%3EAzure%20Log%20Analytics%3C%2FLINGO-LABEL%3E%3C%2FLINGO-LABS%3E%3CLINGO-SUB%20id%3D%22lingo-sub-268268%22%20slang%3D%22en-US%22%3ERe%3A%20API%20for%20creating%20function%20in%20Azure%20LogAnalytics%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-268268%22%20slang%3D%22en-US%22%3E%3CP%3E%3CSPAN%3EWhen%20adding%20the%20functionAlias%20parameter%20to%20a%20savedSearches%20resource%20in%20ARM%20that%20will%20show%20up%20as%20a%20function%20in%20Log%20Analytics.%3C%2FSPAN%3E%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3ESee%20below%20a%20snippet%20from%20a%20powershell%20script%20that%20we%20use%20for%20deploying%20functions%20with%20an%20ARM%20template.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CDIV%3E%3CDIV%3E%3CA%20href%3D%22https%3A%2F%2Fwww.yammer.com%2Fazureadvisors%2F%23%2Fthreads%2Fshow%3FthreadId%3D1042972298%22%20target%3D%22_blank%22%20rel%3D%22nofollow%20noopener%20noreferrer%20noopener%20noreferrer%22%3E%3CSPAN%3E%22properties%22%3A%20%7B%7B%3C%2FSPAN%3E%3C%2FA%3E%3C%2FDIV%3E%3CDIV%3E%3CA%20href%3D%22https%3A%2F%2Fwww.yammer.com%2Fazureadvisors%2F%23%2Fthreads%2Fshow%3FthreadId%3D1042972298%22%20target%3D%22_blank%22%20rel%3D%22nofollow%20noopener%20noreferrer%20noopener%20noreferrer%22%3E%3CSPAN%3E%22etag%22%3A%20%22*%22%2C%3C%2FSPAN%3E%3C%2FA%3E%3C%2FDIV%3E%3CDIV%3E%3CA%20href%3D%22https%3A%2F%2Fwww.yammer.com%2Fazureadvisors%2F%23%2Fthreads%2Fshow%3FthreadId%3D1042972298%22%20target%3D%22_blank%22%20rel%3D%22nofollow%20noopener%20noreferrer%20noopener%20noreferrer%22%3E%3CSPAN%3E%22query%22%3A%20%22%7B1%7D%22%2C%3C%2FSPAN%3E%3C%2FA%3E%3C%2FDIV%3E%3CDIV%3E%3CA%20href%3D%22https%3A%2F%2Fwww.yammer.com%2Fazureadvisors%2F%23%2Fthreads%2Fshow%3FthreadId%3D1042972298%22%20target%3D%22_blank%22%20rel%3D%22nofollow%20noopener%20noreferrer%20noopener%20noreferrer%22%3E%3CSPAN%3E%22displayName%22%3A%20%22%7B0%7D%22%2C%3C%2FSPAN%3E%3C%2FA%3E%3C%2FDIV%3E%3CDIV%3E%3CA%20href%3D%22https%3A%2F%2Fwww.yammer.com%2Fazureadvisors%2F%23%2Fthreads%2Fshow%3FthreadId%3D1042972298%22%20target%3D%22_blank%22%20rel%3D%22nofollow%20noopener%20noreferrer%20noopener%20noreferrer%22%3E%3CSPAN%3E%22category%22%3A%20%22%7B2%7D%22%2C%3C%2FSPAN%3E%3C%2FA%3E%3C%2FDIV%3E%3CDIV%3E%3CSTRONG%3E%3CA%20href%3D%22https%3A%2F%2Fwww.yammer.com%2Fazureadvisors%2F%23%2Fthreads%2Fshow%3FthreadId%3D1042972298%22%20target%3D%22_blank%22%20rel%3D%22nofollow%20noopener%20noreferrer%20noopener%20noreferrer%22%3E%22functionAlias%22%3A%22%7B0%7D%22%3C%2FA%3E%3C%2FSTRONG%3E%3C%2FDIV%3E%3CDIV%3E%3CA%20href%3D%22https%3A%2F%2Fwww.yammer.com%2Fazureadvisors%2F%23%2Fthreads%2Fshow%3FthreadId%3D1042972298%22%20target%3D%22_blank%22%20rel%3D%22nofollow%20noopener%20noreferrer%20noopener%20noreferrer%22%3E%3CSPAN%3E%7D%7D%3C%2FSPAN%3E%3C%2FA%3E%3C%2FDIV%3E%3C%2FDIV%3E%3C%2FLINGO-BODY%3E
Maayan Elgamil
Microsoft

Hey,

 

As mentioned in the documentary there is the option to create functions above my OMS workspace using the Azure Log Analytics portal. 

Related documentation:

https://docs.microsoft.com/en-us/azure/log-analytics/query-language/advanced-query-writing?toc=/azur...

 

Is there an option to create a function using an API?

same as the API that is used for querying? (described here: https://dev.loganalytics.io/reference/post-query)

I couldn't find any documentation regarding this issue which will be very helpful for me.

 

Thanks!

1 Reply

When adding the functionAlias parameter to a savedSearches resource in ARM that will show up as a function in Log Analytics.

 

See below a snippet from a powershell script that we use for deploying functions with an ARM template.