Logger - Create Or Update
ロガーを作成または更新します。
PUT https://management.azure.com/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/loggers/{loggerId}?api-version=2022-08-01
URI パラメーター
名前 | / | 必須 | 型 | 説明 |
---|---|---|---|---|
logger
|
path | True |
string |
ロガー識別子。 API Management サービス インスタンスで一意である必要があります。 Regex pattern: |
resource
|
path | True |
string |
リソース グループの名前。 名前の大文字と小文字は区別されます。 |
service
|
path | True |
string |
API Management サービスの名前。 Regex pattern: |
subscription
|
path | True |
string |
ターゲット サブスクリプションの ID。 |
api-version
|
query | True |
string |
この操作に使用する API バージョン。 |
要求ヘッダー
名前 | 必須 | 型 | 説明 |
---|---|---|---|
If-Match |
string |
エンティティの ETag。 エンティティを作成する場合は必須ではありませんが、エンティティを更新する場合は必須です。 |
要求本文
名前 | 必須 | 型 | 説明 |
---|---|---|---|
properties.loggerType | True |
ロガーの種類。 |
|
properties.credentials |
object |
azureEventHub ロガーのイベント ハブの名前と SendRule 接続文字列。 applicationInsights ロガーのインストルメンテーション キー。 |
|
properties.description |
string |
ロガーの説明。 |
|
properties.isBuffered |
boolean |
パブリッシュ前にレコードがロガーにバッファーされるかどうか。 既定値は true と見なされます。 |
|
properties.resourceId |
string |
ログ ターゲットの Azure リソース ID (Azure Event Hub リソースまたは Azure アプリケーション Insights リソース)。 |
応答
名前 | 型 | 説明 |
---|---|---|
200 OK |
既存のロガーが正常に更新されました。 Headers ETag: string |
|
201 Created |
ロガーが正常に作成されました。 Headers ETag: string |
|
Other Status Codes |
操作に失敗した理由を説明するエラー応答。 |
セキュリティ
azure_auth
Azure Active Directory OAuth2 フロー。
Type:
oauth2
Flow:
implicit
Authorization URL:
https://login.microsoftonline.com/common/oauth2/authorize
Scopes
名前 | 説明 |
---|---|
user_impersonation | ユーザー アカウントの借用 |
例
Api |
Api |
ApiManagementCreateAILogger
Sample Request
PUT https://management.azure.com/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.ApiManagement/service/apimService1/loggers/loggerId?api-version=2022-08-01
{
"properties": {
"loggerType": "applicationInsights",
"description": "adding a new logger",
"credentials": {
"instrumentationKey": "11................a1"
}
}
}
Sample Response
{
"id": "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.ApiManagement/service/apimService1/loggers/loggerId",
"type": "Microsoft.ApiManagement/service/loggers",
"name": "loggerId",
"properties": {
"loggerType": "applicationInsights",
"description": null,
"credentials": {
"instrumentationKey": "{{5a.......2a}}"
},
"isBuffered": false,
"resourceId": "/subscriptions/subid/resourceGroups/rg1/providers/microsoft.insights/components/airesource"
}
}
{
"id": "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.ApiManagement/service/apimService1/loggers/loggerId",
"type": "Microsoft.ApiManagement/service/loggers",
"name": "loggerId",
"properties": {
"loggerType": "applicationInsights",
"description": null,
"credentials": {
"instrumentationKey": "{{5a.......2a}}"
},
"isBuffered": false
}
}
ApiManagementCreateEHLogger
Sample Request
PUT https://management.azure.com/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.ApiManagement/service/apimService1/loggers/eh1?api-version=2022-08-01
{
"properties": {
"loggerType": "azureEventHub",
"description": "adding a new logger",
"credentials": {
"name": "hydraeventhub",
"connectionString": "Endpoint=sb://hydraeventhub-ns.servicebus.windows.net/;SharedAccessKeyName=RootManageSharedAccessKey;SharedAccessKey=********="
}
}
}
Sample Response
{
"id": "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.ApiManagement/service/apimService1/loggers/eh1",
"type": "Microsoft.ApiManagement/service/loggers",
"name": "eh1",
"properties": {
"loggerType": "azureEventHub",
"description": "adding a new logger",
"credentials": {
"connectionString": "{{Logger-Credentials-5f28745bbebeeb13cc3f7301}}"
},
"isBuffered": true
}
}
{
"id": "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.ApiManagement/service/apimService1/loggers/eh1",
"type": "Microsoft.ApiManagement/service/loggers",
"name": "eh1",
"properties": {
"loggerType": "azureEventHub",
"description": "adding a new logger",
"credentials": {
"connectionString": "{{Logger-Credentials-5f28745bbebeeb13cc3f7301}}"
},
"isBuffered": true
}
}
定義
名前 | 説明 |
---|---|
Error |
エラー フィールド コントラクト。 |
Error |
エラー応答。 |
Logger |
ロガーの詳細。 |
Logger |
ロガーの種類。 |
ErrorFieldContract
エラー フィールド コントラクト。
名前 | 型 | 説明 |
---|---|---|
code |
string |
プロパティ レベルのエラー コード。 |
message |
string |
プロパティ レベルエラーの人間が判読できる表現。 |
target |
string |
プロパティ名。 |
ErrorResponse
エラー応答。
名前 | 型 | 説明 |
---|---|---|
error.code |
string |
サービスによって定義されたエラー コード。 このコードは、応答に指定された HTTP エラー コードのサブステータスとして機能します。 |
error.details |
検証エラーが発生した場合に要求で送信される無効なフィールドの一覧。 |
|
error.message |
string |
人が判読できるエラーの表現。 |
LoggerContract
ロガーの詳細。
名前 | 型 | 説明 |
---|---|---|
id |
string |
リソースの完全修飾リソース ID。 例 - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} |
name |
string |
リソースの名前 |
properties.credentials |
object |
azureEventHub ロガーのイベント ハブの名前と SendRule 接続文字列。 applicationInsights ロガーのインストルメンテーション キー。 |
properties.description |
string |
ロガーの説明。 |
properties.isBuffered |
boolean |
パブリッシュ前にレコードがロガーにバッファーされるかどうか。 既定値は true と見なされます。 |
properties.loggerType |
ロガーの種類。 |
|
properties.resourceId |
string |
ログ ターゲットの Azure リソース ID (Azure Event Hub リソースまたは Azure アプリケーション Insights リソース)。 |
type |
string |
リソースの型。 例: "Microsoft.Compute/virtualMachines" または "Microsoft.Storage/storageAccounts" |
LoggerType
ロガーの種類。
名前 | 型 | 説明 |
---|---|---|
applicationInsights |
string |
ログの宛先として Insights をAzure アプリケーションします。 |
azureEventHub |
string |
ログの宛先としての Azure Event Hub。 |
azureMonitor |
string |
Azure Monitor |