Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: ApiManagement-Service - Changed loggers to logger #3677

Merged
merged 5 commits into from
Nov 13, 2024
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
4 changes: 2 additions & 2 deletions avm/res/api-management/service/api-version-set/main.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@
"metadata": {
"_generator": {
"name": "bicep",
"version": "0.30.23.60470",
"templateHash": "2492486199367242598"
"version": "0.31.34.60546",
"templateHash": "4169716301128870956"
},
"name": "API Management Service API Version Sets",
"description": "This module deploys an API Management Service API Version Set.",
Expand Down
4 changes: 2 additions & 2 deletions avm/res/api-management/service/api/diagnostics/main.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@
"metadata": {
"_generator": {
"name": "bicep",
"version": "0.30.23.60470",
"templateHash": "2531959928497745895"
"version": "0.31.34.60546",
"templateHash": "5353729184860596208"
},
"name": "API Management Service APIs Diagnostics.",
"description": "This module deploys an API Management Service API Diagnostics.",
Expand Down
17 changes: 7 additions & 10 deletions avm/res/api-management/service/api/main.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@
"metadata": {
"_generator": {
"name": "bicep",
"version": "0.30.23.60470",
"templateHash": "17036957862982683599"
"version": "0.31.34.60546",
"templateHash": "79502668979653596"
},
"name": "API Management Service APIs",
"description": "This module deploys an API Management Service API.",
Expand Down Expand Up @@ -245,10 +245,7 @@
"type": "[parameters('type')]",
"value": "[parameters('value')]",
"wsdlSelector": "[coalesce(parameters('wsdlSelector'), createObject())]"
},
"dependsOn": [
"service"
]
}
},
"policy": {
"copy": {
Expand Down Expand Up @@ -283,8 +280,8 @@
"metadata": {
"_generator": {
"name": "bicep",
"version": "0.30.23.60470",
"templateHash": "5643177447182050438"
"version": "0.31.34.60546",
"templateHash": "7084313641171504315"
},
"name": "API Management Service APIs Policies",
"description": "This module deploys an API Management Service API Policy.",
Expand Down Expand Up @@ -430,8 +427,8 @@
"metadata": {
"_generator": {
"name": "bicep",
"version": "0.30.23.60470",
"templateHash": "2531959928497745895"
"version": "0.31.34.60546",
"templateHash": "5353729184860596208"
},
"name": "API Management Service APIs Diagnostics.",
"description": "This module deploys an API Management Service API Diagnostics.",
Expand Down
4 changes: 2 additions & 2 deletions avm/res/api-management/service/api/policy/main.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@
"metadata": {
"_generator": {
"name": "bicep",
"version": "0.30.23.60470",
"templateHash": "5643177447182050438"
"version": "0.31.34.60546",
"templateHash": "7084313641171504315"
},
"name": "API Management Service APIs Policies",
"description": "This module deploys an API Management Service API Policy.",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@
"metadata": {
"_generator": {
"name": "bicep",
"version": "0.30.23.60470",
"templateHash": "17927787726774417819"
"version": "0.31.34.60546",
"templateHash": "7143680740173420481"
},
"name": "API Management Service Authorization Servers",
"description": "This module deploys an API Management Service Authorization Server.",
Expand Down
9 changes: 3 additions & 6 deletions avm/res/api-management/service/backend/main.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@
"metadata": {
"_generator": {
"name": "bicep",
"version": "0.30.23.60470",
"templateHash": "14706757128951530017"
"version": "0.31.34.60546",
"templateHash": "8388368953433969607"
},
"name": "API Management Service Backends",
"description": "This module deploys an API Management Service Backend.",
Expand Down Expand Up @@ -114,10 +114,7 @@
"tls": "[parameters('tls')]",
"url": "[parameters('url')]",
"protocol": "[parameters('protocol')]"
},
"dependsOn": [
"service"
]
}
}
},
"outputs": {
Expand Down
9 changes: 3 additions & 6 deletions avm/res/api-management/service/cache/main.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@
"metadata": {
"_generator": {
"name": "bicep",
"version": "0.30.23.60470",
"templateHash": "2750555671183513052"
"version": "0.31.34.60546",
"templateHash": "11909687365337883274"
},
"name": "API Management Service Caches",
"description": "This module deploys an API Management Service Cache.",
Expand Down Expand Up @@ -68,10 +68,7 @@
"connectionString": "[parameters('connectionString')]",
"useFromLocation": "[parameters('useFromLocation')]",
"resourceId": "[parameters('resourceId')]"
},
"dependsOn": [
"service"
]
}
}
},
"outputs": {
Expand Down
9 changes: 3 additions & 6 deletions avm/res/api-management/service/identity-provider/main.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@
"metadata": {
"_generator": {
"name": "bicep",
"version": "0.30.23.60470",
"templateHash": "1342690797398622979"
"version": "0.31.34.60546",
"templateHash": "11902978823059118045"
},
"name": "API Management Service Identity Providers",
"description": "This module deploys an API Management Service Identity Provider.",
Expand Down Expand Up @@ -141,10 +141,7 @@
"clientId": "[parameters('clientId')]",
"clientLibrary": "[parameters('clientLibrary')]",
"clientSecret": "[parameters('clientSecret')]"
},
"dependsOn": [
"service"
]
}
}
},
"outputs": {
Expand Down
AlexanderSehr marked this conversation as resolved.
Show resolved Hide resolved
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,8 @@ This module deploys an API Management Service Logger.

| Parameter | Type | Description |
| :-- | :-- | :-- |
| [`loggerType`](#parameter-loggertype) | string | Logger type. |
| [`name`](#parameter-name) | string | Resource Name. |
| [`type`](#parameter-type) | string | Logger type. |

**Conditional parameters**

Expand All @@ -35,10 +35,17 @@ This module deploys an API Management Service Logger.

| Parameter | Type | Description |
| :-- | :-- | :-- |
| [`description`](#parameter-description) | string | Logger description. |
| [`isBuffered`](#parameter-isbuffered) | bool | Whether records are buffered in the logger before publishing. |
| [`loggerDescription`](#parameter-loggerdescription) | string | Logger description. |

### Parameter: `loggerType`
### Parameter: `name`

Resource Name.

- Required: Yes
- Type: string

### Parameter: `type`

Logger type.

Expand All @@ -53,13 +60,6 @@ Logger type.
]
```

### Parameter: `name`

Resource Name.

- Required: Yes
- Type: string

### Parameter: `apiManagementServiceName`

The name of the parent API Management service. Required if the template is used in a standalone deployment.
Expand All @@ -81,6 +81,14 @@ Required if loggerType = applicationInsights or azureEventHub. Azure Resource Id
- Required: Yes
- Type: string

### Parameter: `description`

Logger description.

- Required: No
- Type: string
- Default: `''`

### Parameter: `isBuffered`

Whether records are buffered in the logger before publishing.
Expand All @@ -89,13 +97,6 @@ Whether records are buffered in the logger before publishing.
- Type: bool
- Default: `True`

### Parameter: `loggerDescription`

Logger description.

- Required: Yes
- Type: string

## Outputs

| Output | Type | Description |
Expand Down
55 changes: 55 additions & 0 deletions avm/res/api-management/service/logger/main.bicep
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
metadata name = 'API Management Service Loggers'
metadata description = 'This module deploys an API Management Service Logger.'
metadata owner = 'Azure/module-maintainers'

@sys.description('Conditional. The name of the parent API Management service. Required if the template is used in a standalone deployment.')
param apiManagementServiceName string

@sys.description('Required. Resource Name.')
param name string

@sys.description('Optional. Logger description.')
param description string = ''

@sys.description('Optional. Whether records are buffered in the logger before publishing.')
param isBuffered bool = true

@sys.description('Required. Logger type.')
@allowed([
'applicationInsights'
'azureEventHub'
'azureMonitor'
])
param type string

@sys.description('Conditional. Required if loggerType = applicationInsights or azureEventHub. Azure Resource Id of a log target (either Azure Event Hub resource or Azure Application Insights resource).')
param targetResourceId string

@secure()
@sys.description('Conditional. Required if loggerType = applicationInsights or azureEventHub. The name and SendRule connection string of the event hub for azureEventHub logger. Instrumentation key for applicationInsights logger.')
param credentials object

resource service 'Microsoft.ApiManagement/service@2021-08-01' existing = {
name: apiManagementServiceName
}

resource loggers 'Microsoft.ApiManagement/service/loggers@2022-08-01' = {
name: name
parent: service
properties: {
credentials: credentials
description: description
isBuffered: isBuffered
loggerType: type
resourceId: targetResourceId
}
}

@sys.description('The resource ID of the logger.')
output resourceId string = loggers.id

@sys.description('The name of the logger.')
output name string = loggers.name

@sys.description('The resource group the named value was deployed into.')
output resourceGroupName string = resourceGroup().name
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@
"metadata": {
"_generator": {
"name": "bicep",
"version": "0.30.23.60470",
"templateHash": "12834599511984803283"
"version": "0.31.34.60546",
"templateHash": "11518344218995825129"
},
"name": "API Management Service Loggers",
"description": "This module deploys an API Management Service Logger.",
Expand All @@ -24,8 +24,9 @@
"description": "Required. Resource Name."
}
},
"loggerDescription": {
"description": {
"type": "string",
"defaultValue": "",
"metadata": {
"description": "Optional. Logger description."
}
Expand All @@ -37,7 +38,7 @@
"description": "Optional. Whether records are buffered in the logger before publishing."
}
},
"loggerType": {
"type": {
"type": "string",
"allowedValues": [
"applicationInsights",
Expand Down Expand Up @@ -68,9 +69,9 @@
"name": "[format('{0}/{1}', parameters('apiManagementServiceName'), parameters('name'))]",
"properties": {
"credentials": "[parameters('credentials')]",
"description": "[parameters('loggerDescription')]",
"description": "[parameters('description')]",
"isBuffered": "[parameters('isBuffered')]",
"loggerType": "[parameters('loggerType')]",
"loggerType": "[parameters('type')]",
"resourceId": "[parameters('targetResourceId')]"
}
}
Expand Down
55 changes: 0 additions & 55 deletions avm/res/api-management/service/loggers/main.bicep

This file was deleted.

Loading