{"id":18880456,"url":"https://github.com/moimhossain/azure-loganalytics-api","last_synced_at":"2026-05-09T05:34:41.729Z","repository":{"id":75024689,"uuid":"154311498","full_name":"MoimHossain/azure-loganalytics-api","owner":"MoimHossain","description":"A simple API over Azure Log Analytics","archived":false,"fork":false,"pushed_at":"2022-01-05T07:33:38.000Z","size":19,"stargazers_count":0,"open_issues_count":0,"forks_count":1,"subscribers_count":0,"default_branch":"master","last_synced_at":"2025-05-31T07:13:30.452Z","etag":null,"topics":["azure","azure-log-analytics","azure-portal","csharp","docker-container","log-analytics","logging","oms-workspace","rest-api","secret","service-principal"],"latest_commit_sha":null,"homepage":null,"language":"C#","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/MoimHossain.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2018-10-23T10:50:24.000Z","updated_at":"2022-01-05T07:33:41.000Z","dependencies_parsed_at":null,"dependency_job_id":"9fbf4a68-4c47-40bd-9c13-4638a2d1a9a8","html_url":"https://github.com/MoimHossain/azure-loganalytics-api","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/MoimHossain/azure-loganalytics-api","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MoimHossain%2Fazure-loganalytics-api","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MoimHossain%2Fazure-loganalytics-api/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MoimHossain%2Fazure-loganalytics-api/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MoimHossain%2Fazure-loganalytics-api/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/MoimHossain","download_url":"https://codeload.github.com/MoimHossain/azure-loganalytics-api/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MoimHossain%2Fazure-loganalytics-api/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":273287681,"owners_count":25078575,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-09-02T02:00:09.530Z","response_time":77,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["azure","azure-log-analytics","azure-portal","csharp","docker-container","log-analytics","logging","oms-workspace","rest-api","secret","service-principal"],"created_at":"2024-11-08T06:43:57.822Z","updated_at":"2026-05-09T05:34:36.700Z","avatar_url":"https://github.com/MoimHossain.png","language":"C#","funding_links":[],"categories":[],"sub_categories":[],"readme":"\n# What is it?\nA simple API over Azure Log Analytics. The idea is, you can run this as a Docker container anywhere with some basic configuration, and consume log analytics queries via this API.\n\nThis is implemented for a very specific reason that fits a very specific setup. You might consider using Log Analytics APIs directly for less specific scenarios.\n\n# How to build\nThe solution uses a docker container to build the solution. Execute this command in the root to build the solution\n\n```\ndocker build -t repo/name .\n```\n\n# How to run the container?\n\nYou need following variables to deliver during the container startup:\n\n- SharedAccessSignature - An API Key that you can define on your own. You send this in the header of the call\n- TenantId - The Azure AD tenant ID - GUID\n- ClientID - A service principal ID that has RBAC access to OMS workspace\n- ClientSecret - The service principal Secret\n- LogAnalyticsWorkspaceID - The OMS workspace ID - GUID (Get it from Azure Portal)\n- LogAnalyticsPrimaryKey - The OMS workspace Primary Key (Get it from Azure Portal)\n\nOnce you have these secrets:\n\n```bash\ndocker run -d -p 80:80 -e \"SharedAccessSignature=\u003cVALUE\u003e\" -e \"TenantId=\u003cKEY\u003e\" -e \"ClientID=\u003cKEY\u003e\" \n-e \"ClientSecret=\u003cKEY\u003e\" -e \"LogAnalyticsWorkspaceID=\u003cKEY\u003e\" -e  \"LogAnalyticsPrimaryKey=\u003cKEY\u003e\" repository/namecontainer:latest\n```\n\n\n# How to post data to Log Analytics\nStart the container and then execute a POST request to the following url\n\n```\nPOST https://url/api/logs\nContent-type:application/json\nx-api-key: \u003cSharedAccessSignature\u003e\n\nBODY\n{\n\t\"customlogType\":\"Name of the Custom Log Type e.g.\",\n\t\"json\":{\n\t\t\"demo\":\"demo\"\n\t}\n}\n```\n\n# How to query Log Analytics\nStart the container and then execute a GET request to the following url\n```\nPOST https://url/api/logs?query=AzureDiagnostics\nContent-type:application/json\nx-api-key: \u003cSharedAccessSignature\u003e\n```\n\n\n## Thanks\n\nForked from https://github.com/MoimHossain/azure-loganalytics-api","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmoimhossain%2Fazure-loganalytics-api","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmoimhossain%2Fazure-loganalytics-api","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmoimhossain%2Fazure-loganalytics-api/lists"}