Skip to content

Commit

Permalink
Document sovereign cloud support in LogsIngestionClient
Browse files Browse the repository at this point in the history
  • Loading branch information
scottaddie committed Oct 12, 2023
1 parent 55d9835 commit 4019bf6
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 0 deletions.
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

0 comments on commit 4019bf6

Please sign in to comment.