-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathapimOpenAPI.bicep
More file actions
33 lines (30 loc) · 810 Bytes
/
apimOpenAPI.bicep
File metadata and controls
33 lines (30 loc) · 810 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
param apimName string
param openApiUrl string
param apiName string
param originUrl string
resource apim 'Microsoft.ApiManagement/service@2021-01-01-preview' existing = {
name: apimName
}
resource api 'Microsoft.ApiManagement/service/apis@2021-01-01-preview' = {
parent: apim
name: apiName
properties: {
path: apiName
displayName: apiName
isCurrent: true
subscriptionRequired: false
format: 'swagger-link-json'
value: openApiUrl //'https://name.azurewebsites.net/api/swagger.json'
protocols: [
'https'
]
}
}
resource apiPolicy 'Microsoft.ApiManagement/service/apis/policies@2021-01-01-preview' = {
parent: api
name: 'policy'
properties: {
format: 'rawxml'
value: replace(loadTextContent('../content/cos-policy.xml'),'__ORIGIN__',originUrl)
}
}