https://github.com/panoramicdata/microsoftazure.api
A .NET API for Microsoft Azure
https://github.com/panoramicdata/microsoftazure.api
Last synced: about 1 year ago
JSON representation
A .NET API for Microsoft Azure
- Host: GitHub
- URL: https://github.com/panoramicdata/microsoftazure.api
- Owner: panoramicdata
- License: mit
- Created: 2024-04-10T17:06:09.000Z (about 2 years ago)
- Default Branch: main
- Last Pushed: 2024-08-21T14:54:55.000Z (almost 2 years ago)
- Last Synced: 2025-03-06T13:03:36.221Z (over 1 year ago)
- Language: C#
- Homepage:
- Size: 189 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
- Security: SECURITY.md
Awesome Lists containing this project
README
# MicrosoftAzure.Api
[](https://www.nuget.org/packages/MicrosoftAzure.Api/)
[](https://www.nuget.org/packages/MicrosoftAzure.Api/)
[](https://opensource.org/licenses/MIT)
[](https://www.codacy.com?utm_source=github.com&utm_medium=referral&utm_content=panoramicdata/MicrosoftAzureSentinel.Api&utm_campaign=Badge_Grade)
A simple Microsoft Azure API nuget package.
Makes calls to endpoints set out here:
* LogAnalytics Query API:
o https://learn.microsoft.com/en-us/rest/api/loganalytics/query/get?view=rest-loganalytics-2022-10-27-preview&tabs=HTTP
* SecurityInsights API:
o https://learn.microsoft.com/en-us/rest/api/securityinsights/operation-groups?view=rest-securityinsights-2024-03-01
## Example usage
```csharp
using MicrosoftAzure.Api;
var subscriptionId = new Guid("your-subscription-id");
var resourceGroupName = "your-resource-group-name";
var workspaceName = "your-workspace-name";
var workspaceId = getWorkSpaceIdGuid();
var client = new MicrosoftAzureSentinelClient(new MicrosoftAzureSentinelClientOptions
{
TenantId = "your-tenant-id",
ClientId = "your-client-id",
ClientSecret = "your-client-secret"
});
var signInLogs = await Client
.SecurityInsights
.QueryAsync(
workspaceId,
new QueryRequest
{
Query = "SigninLogs | take 5"
},
default
)
.ConfigureAwait(true);
var connectors = await Client
.Sentinel
.GetConnectorsAsync(
subscriptionId,
resourceGroupName,
workspaceName,
default
)
.ConfigureAwait(true);
```