Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 14 additions & 0 deletions sdk/monitor/Azure.Monitor.Ingestion/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,20 @@ var credential = new DefaultAzureCredential();
var client = new LogsIngestionClient(endpoint, credential);
```

#### Configure client for Azure sovereign cloud

By default, `LogsIngestionClient` is configured to connect to the Azure public cloud. To connect to a sovereign cloud instead, set the `LogsIngestionClientOptions.Audience` property. For example:

```C# Snippet:CreateLogsIngestionClientWithOptions
var endpoint = new Uri("<data_collection_endpoint_uri>");
var credential = new DefaultAzureCredential();
var clientOptions = new LogsIngestionClientOptions
{
Audience = LogsIngestionAudience.AzureChina
};
var client = new LogsIngestionClient(endpoint, credential, clientOptions);
```

### Upload the logs

For examples of logs ingestion, see the [Examples](#examples) section.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,19 @@ public void SetUpClient()
#endregion
}

public void SetUpClientWithOptions()
{
#region Snippet:CreateLogsIngestionClientWithOptions
var endpoint = new Uri("<data_collection_endpoint_uri>");
var credential = new DefaultAzureCredential();
var clientOptions = new LogsIngestionClientOptions
{
Audience = LogsIngestionAudience.AzureChina
};
var client = new LogsIngestionClient(endpoint, credential, clientOptions);
#endregion
}

public void LogData()
{
#region Snippet:UploadCustomLogs
Expand Down