Skip to content

Commit a76dcaa

Browse files
authored
Merge pull request #102254 from miaojiang/master
Minor update to point to ARM REST API
2 parents 29b9ebd + 6e7d922 commit a76dcaa

File tree

1 file changed

+3
-54
lines changed

1 file changed

+3
-54
lines changed

articles/api-management/api-management-howto-log-event-hubs.md

Lines changed: 3 additions & 54 deletions
Original file line numberDiff line numberDiff line change
@@ -26,60 +26,9 @@ This article is a companion to the [Integrate Azure API Management with Event Hu
2626
For detailed steps on how to create an event hub and get connection strings that you need to send and receive events to and from the Event Hub, see [Create an Event Hubs namespace and an event hub using the Azure portal](https://docs.microsoft.com/azure/event-hubs/event-hubs-create).
2727

2828
## Create an API Management logger
29-
Now that you have an Event Hub, the next step is to configure a [Logger](https://docs.microsoft.com/rest/api/apimanagement/apimanagementrest/azure-api-management-rest-api-logger-entity) in your API Management service so that it can log events to the Event Hub.
29+
Now that you have an Event Hub, the next step is to configure a [Logger](https://docs.microsoft.com/rest/api/apimanagement/2019-01-01/logger) in your API Management service so that it can log events to the Event Hub.
3030

31-
API Management loggers are configured using the [API Management REST API](https://aka.ms/smapi). Before using the REST API for the first time, review the [prerequisites](https://docs.microsoft.com/rest/api/apimanagement/apimanagementrest/api-management-rest) and ensure that you have [enabled access to the REST API](https://docs.microsoft.com/rest/api/apimanagement/apimanagementrest/api-management-rest#EnableRESTAPI).
32-
33-
To create a logger, make an HTTP PUT request using the following URL template:
34-
35-
`https://{your service}.management.azure-api.net/loggers/{new logger name}?api-version=2017-03-01`
36-
37-
* Replace `{your service}` with the name of your API Management service instance.
38-
* Replace `{new logger name}` with the desired name for your new logger. You reference this name when you configure the [log-to-eventhub](/azure/api-management/api-management-advanced-policies#log-to-eventhub) policy
39-
40-
Add the following headers to the request:
41-
42-
* Content-Type : application/json
43-
* Authorization : SharedAccessSignature 58...
44-
* For instructions on generating the `SharedAccessSignature` see [Azure API Management REST API Authentication](https://docs.microsoft.com/rest/api/apimanagement/apimanagementrest/azure-api-management-rest-api-authentication).
45-
46-
Specify the request body using the following template:
47-
48-
```json
49-
{
50-
"loggerType" : "AzureEventHub",
51-
"description" : "Sample logger description",
52-
"credentials" : {
53-
"name" : "Name of the Event Hub from the portal",
54-
"connectionString" : "Endpoint=Event Hub Sender connection string"
55-
}
56-
}
57-
```
58-
59-
* `loggerType` must be set to `AzureEventHub`.
60-
* `description` provides an optional description of the logger and can be a zero length string if desired.
61-
* `credentials` contains the `name` and `connectionString` of your Azure Event Hub.
62-
63-
When you make the request, if the logger is created, a status code of `201 Created` is returned. A sample response based on the above sample request is shown below.
64-
65-
```json
66-
{
67-
"id": "/loggers/{new logger name}",
68-
"loggerType": "azureEventHub",
69-
"description": "Sample logger description",
70-
"credentials": {
71-
"name": "Name of the Event Hub from the Portal",
72-
"connectionString": "{{Logger-Credentials-xxxxxxxxxxxxxxx}}"
73-
},
74-
"isBuffered": true,
75-
"resourceId": null
76-
}
77-
```
78-
79-
> [!NOTE]
80-
> For other possible return codes and their reasons, see [Create a Logger](https://docs.microsoft.com/rest/api/apimanagement/apimanagementrest/azure-api-management-rest-api-logger-entity#PUT). To see how to perform other operations such as list, update, and delete, see the [Logger](https://docs.microsoft.com/rest/api/apimanagement/apimanagementrest/azure-api-management-rest-api-logger-entity) entity documentation.
81-
>
82-
>
31+
API Management loggers are configured using the [API Management REST API](https://aka.ms/apimapi). For detailed request examples, see [how to create Loggers](https://docs.microsoft.com/rest/api/apimanagement/2019-01-01/logger/createorupdate).
8332

8433
## Configure log-to-eventhubs policies
8534

@@ -112,7 +61,7 @@ Click **Save** to save the updated policy configuration. As soon as it is saved
11261
* [Receive messages with EventProcessorHost](../event-hubs/event-hubs-dotnet-standard-getstarted-receive-eph.md)
11362
* [Event Hubs programming guide](../event-hubs/event-hubs-programming-guide.md)
11463
* Learn more about API Management and Event Hubs integration
115-
* [Logger entity reference](https://docs.microsoft.com/rest/api/apimanagement/apimanagementrest/azure-api-management-rest-api-logger-entity)
64+
* [Logger entity reference](https://docs.microsoft.com/rest/api/apimanagement/2019-01-01/logger)
11665
* [log-to-eventhub policy reference](https://docs.microsoft.com/azure/api-management/api-management-advanced-policies#log-to-eventhub)
11766
* [Monitor your APIs with Azure API Management, Event Hubs, and Moesif](api-management-log-to-eventhub-sample.md)
11867
* Learn more about [integration with Azure Application Insights](api-management-howto-app-insights.md)

0 commit comments

Comments
 (0)