You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This article will go through the requirements for endpoints implementing cache custom resources. If you are unfamiliar with Azure Custom Resource Providers, see [the overview on custom resource providers](overview.md).
12
+
This article will go through the requirements for endpoints implementing cache custom resources. If you're unfamiliar with Azure Custom Resource Providers, see [the overview on custom resource providers](overview.md).
13
13
14
-
## How to define a cache resource endpoint
14
+
## Define a cache resource endpoint
15
15
16
-
A proxy resource can be created by specifying the **routingType** to "Proxy, Cache".
16
+
A proxy resource can be created by specifying the `routingType` to "Proxy, Cache".
An **endpoint** that implements a "Proxy, Cache" resource **endpoint** must handle the request and response for the new API in Azure. In this case, the **resourceType** will generate a new Azure resource API for `PUT`, `GET`, and `DELETE` to perform CRUD on a single resource, as well as `GET` to retrieve all existing resources:
40
+
An endpoint that implements a "Proxy, Cache" resource endpoint must handle the request and response for the new API in Azure. In this case, the **resourceType** will generate a new Azure resource API for `PUT`, `GET`, and `DELETE` to perform CRUD on a single resource, as well as `GET` to retrieve all existing resources.
41
41
42
42
> [!NOTE]
43
-
> The Azure API will generate the request methods `PUT`, `GET`, and `DELETE`, but the cache **endpoint** only needs to handle `PUT` and `DELETE`.
44
-
> We recommended that the **endpoint** also implements `GET`.
43
+
> The Azure API will generate the request methods `PUT`, `GET`, and `DELETE`, but the cache endpoint only needs to handle `PUT` and `DELETE`.
44
+
> We recommended that the endpoint also implements `GET`.
45
45
46
46
### Create a custom resource
47
47
48
-
Azure API Incoming Request:
48
+
**Azure API incoming request**:
49
49
50
50
```HTTP
51
51
PUT https://management.azure.com/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CustomProviders/resourceProviders/{resourceProviderName}/myCustomResources/{myCustomResourceName}?api-version=2018-09-01-preview
@@ -62,7 +62,7 @@ Content-Type: application/json
62
62
}
63
63
```
64
64
65
-
This request will then be forwarded to the **endpoint** in the form:
65
+
This request will then be forwarded to the endpoint in the form:
66
66
67
67
```HTTP
68
68
PUT https://{endpointURL}/?api-version=2018-09-01-preview
Similarly ,the response from the **endpoint** is then forwarded back to the customer. The response from the endpoint should return:
144
+
The response from the endpoint is then forwarded back to the customer. The response should return:
145
145
146
146
- A valid JSON object document. All arrays and strings should be nested under a top object.
147
147
- The `Content-Type` header should be set to "application/json; charset=utf-8".
148
-
- The Azure Custom Resource Provider will only remove the item from its cache if a 200-level response is returned. Even if the resource does not exist, the **endpoint** should return 204.
148
+
- The Azure Custom Resource Provider will only remove the item from its cache if a 200-level response is returned. Even if the resource doesn't exist, the endpoint should return 204.
GET https://management.azure.com/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CustomProviders/resourceProviders/{resourceProviderName}/myCustomResources/{myCustomResourceName}?api-version=2018-09-01-preview
170
170
Authorization: Bearer eyJ0e...
171
171
Content-Type: application/json
172
172
```
173
173
174
-
The request will **not** be forwarded to the **endpoint**.
174
+
The request will **not** be forwarded to the endpoint.
GET https://management.azure.com/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CustomProviders/resourceProviders/{resourceProviderName}/myCustomResources?api-version=2018-09-01-preview
201
201
Authorization: Bearer eyJ0e...
202
202
Content-Type: application/json
203
203
```
204
204
205
-
This request will **not** be forwarded to the **endpoint**.
205
+
The request will **not** be forwarded to the endpoint.
This article will go through the requirements for endpoints implementing proxy custom resources. If you are unfamiliar with Azure Custom Resource Providers, see [the overview on custom resource providers](overview.md).
12
+
This article will go through the requirements for endpoints implementing proxy custom resources. If you're unfamiliar with Azure Custom Resource Providers, see [the overview on custom resource providers](overview.md).
13
13
14
-
## How to define a proxy resource endpoint
14
+
## Define a proxy resource endpoint
15
15
16
-
A proxy resource can be created by specifying the **routingType** to "Proxy".
16
+
A proxy resource can be created by specifying the `routingType` to "Proxy".
An **endpoint** that implements a "Proxy" resource **endpoint** must handle the request and response for the new API in Azure. In this case, the **resourceType** will generate a new Azure resource API for `PUT`, `GET`, and `DELETE` to perform CRUD on a single resource, as well as `GET` to retrieve all existing resources.
40
+
An endpoint that implements a "Proxy" resource endpoint must handle the request and response for the new API in Azure. In this case, the #*resourceType** will generate a new Azure resource API for `PUT`, `GET`, and `DELETE` to perform CRUD on a single resource, as well as `GET` to retrieve all existing resources.
41
41
42
42
> [!NOTE]
43
-
> The `id`, `name`, and `type` fields are not required, but are needed to integrate the custom resource with existing Azure ecosystem.
43
+
> The `id`, `name`, and `type` fields are not required, but they're needed to integrate the custom resource with an existing Azure ecosystem.
44
44
45
-
Sample resource:
45
+
**Sample resource**:
46
46
47
47
```JSON
48
48
{
@@ -58,7 +58,7 @@ Sample resource:
58
58
}
59
59
```
60
60
61
-
Parameter reference:
61
+
**Parameter reference**:
62
62
63
63
Property | Sample | Description
64
64
---|---|---
@@ -68,7 +68,7 @@ id | '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/<br>pro
68
68
69
69
### Create a custom resource
70
70
71
-
Azure API Incoming Request:
71
+
**Azure API incoming request**:
72
72
73
73
```HTTP
74
74
PUT https://management.azure.com/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CustomProviders/resourceProviders/{resource-provider-name}/myCustomResources/{myCustomResourceName}?api-version=2018-09-01-preview
@@ -85,7 +85,7 @@ Content-Type: application/json
85
85
}
86
86
```
87
87
88
-
This request will then be forwarded to the **endpoint** in the form:
88
+
This request will then be forwarded to the endpoint in the form:
89
89
90
90
```HTTP
91
91
PUT https://{endpointURL}/?api-version=2018-09-01-preview
GET https://management.azure.com/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CustomProviders/resourceProviders/{resourceProviderName}/myCustomResources/{myCustomResourceName}?api-version=2018-09-01-preview
191
191
Authorization: Bearer eyJ0e...
192
192
Content-Type: application/json
193
193
```
194
194
195
-
This request will then be forwarded to the **endpoint** in the form:
195
+
This request will then be forwarded to the endpoint in the form:
196
196
197
197
```HTTP
198
198
GET https://{endpointURL}/?api-version=2018-09-01-preview
GET https://management.azure.com/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CustomProviders/resourceProviders/{resourceProviderName}/myCustomResources?api-version=2018-09-01-preview
252
252
Authorization: Bearer eyJ0e...
253
253
Content-Type: application/json
254
254
```
255
255
256
-
This request will then be forwarded to the **endpoint** in the form:
256
+
This request will then be forwarded to the endpoint in the form:
257
257
258
258
```HTTP
259
259
GET https://{endpointURL}/?api-version=2018-09-01-preview
0 commit comments