Skip to content
This repository was archived by the owner on Feb 23, 2024. It is now read-only.

Commit 74c67c0

Browse files
Update product template to an inline rawxml policy sample
- Add new template for a rawxml-link policy sample
1 parent 36e4760 commit 74c67c0

File tree

3 files changed

+67
-16
lines changed

3 files changed

+67
-16
lines changed

example/product-starter/product-starter.template.json

Lines changed: 7 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,30 +1,24 @@
11
{
2-
"$schema":
3-
"https://schema.management.azure.com/schemas/2015-01-01/deploymentTemplate.json#",
2+
"$schema": "https://schema.management.azure.com/schemas/2015-01-01/deploymentTemplate.json#",
43
"contentVersion": "1.0.0.0",
54
"parameters": {
65
"ApimServiceName": {
7-
"type": "string"
8-
},
9-
"repoBaseUrl":{
106
"type": "string",
117
"metadata": {
12-
"description": "Base URL of the repository"
8+
"description": "The name of the API Management"
139
}
1410
}
1511
},
1612
"variables": {},
1713
"resources": [
1814
{
1915
"type": "Microsoft.ApiManagement/service/products",
20-
"name":
21-
"[concat(parameters('ApimServiceName'), '/starter')]",
16+
"name": "[concat(parameters('ApimServiceName'), '/starter')]",
2217
"apiVersion": "2018-01-01",
2318
"scale": null,
2419
"properties": {
2520
"displayName": "Starter",
26-
"description":
27-
"Include 3 APIs. Limited to 1 subscription per developer. Throttled at 3 calls per 10 second.",
21+
"description": "Include 3 APIs. Limited to 1 subscription per developer. Throttled at 3 calls per 10 second.",
2822
"terms": null,
2923
"subscriptionRequired": true,
3024
"approvalRequired": true,
@@ -34,12 +28,11 @@
3428
},
3529
{
3630
"type": "Microsoft.ApiManagement/service/products/policies",
37-
"name":
38-
"[concat(parameters('ApimServiceName'), '/starter/policy')]",
31+
"name": "[concat(parameters('ApimServiceName'), '/starter/policy')]",
3932
"apiVersion": "2018-01-01",
4033
"properties": {
41-
"policyContent": "[concat(parameters('repoBaseUrl'), '/product-starter/product-starter.policy.xml')]",
42-
"contentFormat": "rawxml-link"
34+
"policyContent": "<policies><inbound><rate-limit calls=\"3\" renewal-period=\"10\" /><base /></inbound><outbound><base /></outbound><backend><base /></backend><on-error><base /></on-error></policies>",
35+
"contentFormat": "rawxml"
4336
},
4437
"dependsOn": [
4538
"[resourceId('Microsoft.ApiManagement/service/products', parameters('ApimServiceName'), 'starter')]"

example/product-starter/product-starter.policy.xml renamed to example/product-unlimited/product-unlimited.policy.xml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
<policies>
22
<inbound>
3-
<rate-limit calls="3" renewal-period="10" />
43
<base />
54
</inbound>
65
<outbound>
@@ -12,4 +11,4 @@
1211
<on-error>
1312
<base />
1413
</on-error>
15-
</policies>
14+
</policies>
Lines changed: 59 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,59 @@
1+
{
2+
"$schema": "https://schema.management.azure.com/schemas/2015-01-01/deploymentTemplate.json#",
3+
"contentVersion": "1.0.0.0",
4+
"parameters": {
5+
"ApimServiceName": {
6+
"type": "string",
7+
"metadata": {
8+
"description": "The name of the API Management"
9+
}
10+
},
11+
"repoBaseUrl": {
12+
"type": "string",
13+
"metadata": {
14+
"description": "Base URL of the repository"
15+
}
16+
}
17+
},
18+
"variables": {},
19+
"resources": [
20+
{
21+
"type": "Microsoft.ApiManagement/service/products",
22+
"name": "[concat(parameters('ApimServiceName'), '/unlimited')]",
23+
"apiVersion": "2018-01-01",
24+
"scale": null,
25+
"properties": {
26+
"displayName": "Unlimited",
27+
"description": "Subscribers have completely unlimited access to the API. Administrator approval is required.",
28+
"terms": null,
29+
"subscriptionRequired": true,
30+
"approvalRequired": true,
31+
"subscriptionsLimit": 1,
32+
"state": "published"
33+
}
34+
},
35+
{
36+
"type": "Microsoft.ApiManagement/service/products/policies",
37+
"name": "[concat(parameters('ApimServiceName'), '/unlimited/policy')]",
38+
"apiVersion": "2018-01-01",
39+
"properties": {
40+
"policyContent": "[concat(parameters('repoBaseUrl'), '/product-starter/product-starter.policy.xml')]",
41+
"contentFormat": "xml-link"
42+
},
43+
"dependsOn": [
44+
"[resourceId('Microsoft.ApiManagement/service/products', parameters('ApimServiceName'), 'unlimited')]"
45+
]
46+
},
47+
{
48+
"type": "Microsoft.ApiManagement/service/products/groups",
49+
"name": "[concat(parameters('ApimServiceName'), '/unlimited/contosogroup' )]",
50+
"apiVersion": "2017-03-01",
51+
"scale": null,
52+
"properties": {},
53+
"dependsOn": [
54+
"[resourceId('Microsoft.ApiManagement/service/products', parameters('ApimServiceName'), 'unlimited')]"
55+
]
56+
}
57+
],
58+
"outputs": {}
59+
}

0 commit comments

Comments
 (0)