Skip to content

Commit 3721064

Browse files
Merge pull request #211799 from davidsmatlak/ds-ghi-92361
Updates CuRP Quickstart article
2 parents a93fcaf + 37874e2 commit 3721064

File tree

2 files changed

+82
-34
lines changed

2 files changed

+82
-34
lines changed

articles/azure-resource-manager/custom-providers/create-custom-provider.md

Lines changed: 82 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,16 @@
11
---
2-
title: Create resource provider
3-
description: Describes how to create a resource provider and deploy its custom resource types.
4-
author: MSEvanhi
2+
title: Create a custom resource provider
3+
description: Describes how to create a custom resource provider and deploy custom resources.
54
ms.topic: tutorial
6-
ms.date: 06/24/2020
7-
ms.author: evanhi
5+
ms.date: 09/20/2022
6+
ms.author: evanhi
7+
author: MSEvanhi
88
ms.custom: devx-track-azurepowershell, devx-track-azurecli
99
---
1010

11-
# Quickstart: Create a custom provider and deploy custom resources
11+
# Quickstart: Create a custom resource provider and deploy custom resources
1212

13-
In this quickstart, you create your own resource provider and deploy custom resource types for that resource provider. For more information about custom providers, see [Azure Custom Providers Preview overview](overview.md).
13+
In this quickstart, you create a custom resource provider and deploy custom resources for that resource provider. For more information about custom providers, see [Azure Custom Resource Providers Overview](overview.md).
1414

1515
## Prerequisites
1616

@@ -29,22 +29,22 @@ Azure CLI examples use `az rest` for `REST` requests. For more information, see
2929

3030
- The PowerShell commands are run locally using PowerShell 7 or later and the Azure PowerShell modules. For more information, see [Install Azure PowerShell](/powershell/azure/install-az-ps).
3131
- If you don't already have a tool for `REST` operations, install the [ARMClient](https://github.com/projectkudu/ARMClient). It's an open-source command-line tool that simplifies invoking the Azure Resource Manager API.
32-
- After the **ARMClient** is installed you can display usage information from a PowerShell command prompt by typing: `armclient.exe`. Or, go to the [ARMClient wiki](https://github.com/projectkudu/ARMClient/wiki).
32+
- After the **ARMClient** is installed, you can display usage information from a PowerShell command prompt by typing: `armclient.exe`. Or, go to the [ARMClient wiki](https://github.com/projectkudu/ARMClient/wiki).
3333

3434
---
3535

3636
## Deploy custom provider
3737

38-
To set up the custom provider, deploy an [example template](https://github.com/Azure/azure-docs-json-samples/blob/master/custom-providers/customprovider.json) to your Azure subscription.
38+
To set up the custom resource provider, deploy an [example template](https://github.com/Azure/azure-docs-json-samples/blob/master/custom-providers/customprovider.json) to your Azure subscription.
3939

40-
After deploying the template, your subscription has the following resources:
40+
The template deploys the following resources to your subscription:
4141

42-
- Function App with the operations for the resources and actions.
43-
- Storage Account for storing users that are created through the custom provider.
44-
- Custom Provider that defines the custom resource types and actions. It uses the function app endpoint for sending requests.
45-
- Custom resource from the custom provider.
42+
- Function app with the operations for the resources and actions.
43+
- Storage account for storing users that are created through the custom provider.
44+
- Custom resource provider that defines the custom resource types and actions. It uses the function app endpoint for sending requests.
45+
- Custom resource from the custom resource provider.
4646

47-
To deploy the custom provider, use Azure CLI, PowerShell, or the Azure portal:
47+
To deploy the custom resource provider, use Azure CLI, PowerShell, or the Azure portal.
4848

4949
# [Azure CLI](#tab/azure-cli)
5050

@@ -77,17 +77,17 @@ Read-Host -Prompt "Press [ENTER] to continue ..."
7777

7878
---
7979

80-
You can also deploy the solution from the Azure portal. Select the **Deploy to Azure** button to open the template in the Azure portal.
80+
To deploy the template from the Azure portal, select the **Deploy to Azure** button.
8181

8282
[![Deploy to Azure](../../media/template-deployments/deploy-to-azure.svg)](https://portal.azure.com/#create/Microsoft.Template/uri/https%3A%2F%2Fraw.githubusercontent.com%2FAzure%2Fazure-docs-json-samples%2Fmaster%2Fcustom-providers%2Fcustomprovider.json)
8383

84-
## View custom provider and resource
84+
## View custom resource provider and resource
8585

86-
In the portal, the custom provider is a hidden resource type. To confirm that the resource provider was deployed, navigate to the resource group. Select the option to **Show hidden types**.
86+
In the portal, the custom resource provider is a hidden resource type. To confirm that the resource provider was deployed, go to the resource group and select **Show hidden types**.
8787

88-
![Show hidden resource types](./media/create-custom-provider/show-hidden.png)
88+
:::image type="content" source="./media/create-custom-provider/show-hidden.png" alt-text="Screenshot that shows hidden resource types and resources deployed in Azure.":::
8989

90-
To see the custom resource type that you deployed, use the `GET` operation on your resource type.
90+
To see the custom resource that you deployed, use the `GET` operation on your resource type. The resource type `Microsoft.CustomProviders/resourceProviders/users` shown in the JSON response includes the resource that was created by the template.
9191

9292
```http
9393
GET https://management.azure.com/subscriptions/<sub-id>/resourceGroups/<rg-name>/providers/Microsoft.CustomProviders/resourceProviders/<provider-name>/users?api-version=2018-09-01-preview
@@ -107,14 +107,13 @@ You receive the response:
107107
{
108108
"value": [
109109
{
110-
"id": "/subscriptions/<sub-id>/resourceGroups/<rg-name>/providers/Microsoft.CustomProviders/resourceProviders/<provider-name>/users/santa",
111-
"name": "santa",
110+
"id": "/subscriptions/<sub-id>/resourceGroups/<rg-name>/providers/Microsoft.CustomProviders/resourceProviders/<provider-name>/users/ana",
111+
"name": "ana",
112112
"properties": {
113-
"FullName": "Santa Claus",
114-
"Location": "NorthPole",
113+
"FullName": "Ana Bowman",
114+
"Location": "Moon",
115115
"provisioningState": "Succeeded"
116116
},
117-
"resourceGroup": "<rg-name>",
118117
"type": "Microsoft.CustomProviders/resourceProviders/users"
119118
}
120119
]
@@ -138,11 +137,11 @@ You receive the response:
138137
{
139138
"properties": {
140139
"provisioningState": "Succeeded",
141-
"FullName": "Santa Claus",
142-
"Location": "NorthPole"
140+
"FullName": "Ana Bowman",
141+
"Location": "Moon"
143142
},
144-
"id": "/subscriptions/<sub-id>/resourceGroups/<rg-name>/providers/Microsoft.CustomProviders/resourceProviders/<provider-name>/users/santa",
145-
"name": "santa",
143+
"id": "/subscriptions/<sub-id>/resourceGroups/<rg-name>/providers/Microsoft.CustomProviders/resourceProviders/<provider-name>/users/ana",
144+
"name": "ana",
146145
"type": "Microsoft.CustomProviders/resourceProviders/users"
147146
}
148147
]
@@ -153,9 +152,9 @@ You receive the response:
153152

154153
## Call action
155154

156-
Your custom provider also has an action named `ping`. The code that processes the request is implemented in the function app. The `ping` action replies with a greeting.
155+
Your custom resource provider also has an action named `ping`. The code that processes the request is implemented in the function app. The `ping` action replies with a greeting.
157156

158-
To send a `ping` request, use the `POST` operation on your custom provider.
157+
To send a `ping` request, use the `POST` operation on your action.
159158

160159
```http
161160
POST https://management.azure.com/subscriptions/<sub-id>/resourceGroups/<rg-name>/providers/Microsoft.CustomProviders/resourceProviders/<provider-name>/ping?api-version=2018-09-01-preview
@@ -200,9 +199,11 @@ You receive the response:
200199

201200
---
202201

203-
## Create a resource type
202+
## Use PUT to create resource
203+
204+
In this quickstart, the template used the resource type `Microsoft.CustomProviders/resourceProviders/users` to deploy a resource. You can also use a `PUT` operation to create a resource. For example, if a resource isn't deployed with the template, the `PUT` operation will create a resource.
204205

205-
To create the custom resource type, you can deploy the resource in a template. This approach is shown in the template you deployed in this quickstart. You can also send a `PUT` request for the resource type.
206+
In this example, because the template already deployed a resource, the `PUT` operation creates a new resource.
206207

207208
```http
208209
PUT https://management.azure.com/subscriptions/<sub-id>/resourceGroups/<rg-name>/providers/Microsoft.CustomProviders/resourceProviders/<provider-name>/users/<resource-name>?api-version=2018-09-01-preview
@@ -228,7 +229,6 @@ You receive the response:
228229
"Location": "Earth",
229230
"provisioningState": "Succeeded"
230231
},
231-
"resourceGroup": "<rg-name>",
232232
"type": "Microsoft.CustomProviders/resourceProviders/users"
233233
}
234234
```
@@ -259,6 +259,35 @@ You receive the response:
259259

260260
---
261261

262+
You can rerun the `GET` operation from the [view custom resource provider and resource](#view-custom-resource-provider-and-resource) section to show the two resources that were created. This example shows output from the Azure CLI command.
263+
264+
```json
265+
{
266+
"value": [
267+
{
268+
"id": "/subscriptions/<sub-id>/resourceGroups/<rg-name>/providers/Microsoft.CustomProviders/resourceProviders/<provider-name>/users/ana",
269+
"name": "ana",
270+
"properties": {
271+
"FullName": "Ana Bowman",
272+
"Location": "Moon",
273+
"provisioningState": "Succeeded"
274+
},
275+
"type": "Microsoft.CustomProviders/resourceProviders/users"
276+
},
277+
{
278+
"id": "/subscriptions/<sub-id>/resourceGroups/<rg-name>/providers/Microsoft.CustomProviders/resourceProviders/<provider-name>/users/testuser",
279+
"name": "testuser",
280+
"properties": {
281+
"FullName": "Test User",
282+
"Location": "Earth",
283+
"provisioningState": "Succeeded"
284+
},
285+
"type": "Microsoft.CustomProviders/resourceProviders/users"
286+
}
287+
]
288+
}
289+
```
290+
262291
## Custom resource provider commands
263292

264293
Use the [custom-providers](/cli/azure/custom-providers/resource-provider) commands to work with your custom resource provider.
@@ -358,6 +387,25 @@ The `delete` command prompts you and deletes only the custom resource provider.
358387
az custom-providers resource-provider delete --resource-group $rgName --name $funcName
359388
```
360389

390+
## Clean up resources
391+
392+
If you're finished with the resources created in this article, you can delete the resource group. When you delete a resource group, all the resources in that resource group are deleted.
393+
394+
# [Azure CLI](#tab/azure-cli)
395+
396+
```azurecli-interactive
397+
az group delete --resource-group $rgName
398+
```
399+
400+
# [PowerShell](#tab/azure-powershell)
401+
402+
```azurepowershell-interactive
403+
Remove-AzResourceGroup -Name $rgName
404+
```
405+
406+
---
407+
408+
361409
## Next steps
362410

363411
For an introduction to custom providers, see the following article:
38 KB
Loading

0 commit comments

Comments
 (0)