Обучение
Сертифициране
Microsoft Certified: Azure Developer Associate - Certifications
Build end-to-end solutions in Microsoft Azure to create Azure Functions, implement and manage web apps, develop solutions utilizing Azure storage, and more.
Този браузър вече не се поддържа.
Надстройте до Microsoft Edge, за да се възползвате от най-новите функции, актуализации на защитата и техническа поддръжка.
Azure Custom Resource Providers is an extensibility platform to Azure. It allows you to define custom APIs that can be used to enrich the default Azure experience. This documentation describes:
Важно
Custom Resource Providers is currently in public preview. This preview version is provided without a service level agreement, and it's not recommended for production workloads. Certain features might not be supported or might have constrained capabilities. For more information, see Supplemental Terms of Use for Microsoft Azure Previews.
Here are some examples of what you can achieve with Azure Custom Resource Providers:
Azure Custom Resource Providers are made by creating a contract between Azure and an endpoint. This contract defines a list of new resources and actions through a new resource, Microsoft.CustomProviders/resourceProviders. The custom resource provider will then expose these new APIs in Azure. Azure Custom Resource Providers are composed of three parts: custom resource provider, endpoints, and custom resources.
Custom resource providers are a list of contracts between Azure and endpoints. These contracts describe how Azure should interact with their endpoints. The resource providers act like a proxy and will forward requests and responses to and from their specified endpoint. A resource provider can specify two types of contracts: resourceTypes and actions. These are enabled through endpoint definitions. An endpoint definition is comprised of three fields: name, routingType, and endpoint.
Sample Endpoint:
{
"name": "{endpointDefinitionName}",
"routingType": "Proxy",
"endpoint": "https://{endpointURL}/"
}
Property | Required | Description |
---|---|---|
name | yes | The name of the endpoint definition. Azure will expose this name through its API under '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CustomProviders/ resourceProviders/{resourceProviderName}/{endpointDefinitionName}' |
routingType | no | Determines the contract type with the endpoint. If not specified, it will default to "Proxy". |
endpoint | yes | The endpoint to route the requests to. This will handle the response as well as any side effects of the request. |
ResourceTypes describe new custom resources that are added to Azure. These expose basic RESTful CRUD methods. See more about creating custom resources
Sample Custom Resource Provider with resourceTypes:
{
"properties": {
"resourceTypes": [
{
"name": "myCustomResources",
"routingType": "Proxy",
"endpoint": "https://{endpointURL}/"
}
]
},
"location": "eastus"
}
APIs added to Azure for the above sample:
HttpMethod | Sample URI | Description |
---|---|---|
PUT | /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/ providers/Microsoft.CustomProviders/resourceProviders/{resourceProviderName}/ myCustomResources/{customResourceName}?api-version=2018-09-01-preview |
The Azure REST API call to create a new resource. |
DELETE | /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/ providers/Microsoft.CustomProviders/resourceProviders/{resourceProviderName}/ myCustomResources/{customResourceName}?api-version=2018-09-01-preview |
The Azure REST API call to delete an existing resource. |
GET | /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/ providers/Microsoft.CustomProviders/resourceProviders/{resourceProviderName}/ myCustomResources/{customResourceName}?api-version=2018-09-01-preview |
The Azure REST API call to retrieve an existing resource. |
GET | /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/ providers/Microsoft.CustomProviders/resourceProviders/{resourceProviderName}/ myCustomResources?api-version=2018-09-01-preview |
The Azure REST API call to retrieve the list of existing resources. |
Actions describe new actions that are added to Azure. These can be exposed on top of the resource provider or nested under a resourceType. See more about creating custom actions
Sample Custom Resource Provider with actions:
{
"properties": {
"actions": [
{
"name": "myCustomAction",
"routingType": "Proxy",
"endpoint": "https://{endpointURL}/"
}
]
},
"location": "eastus"
}
APIs added to Azure for the above sample:
HttpMethod | Sample URI | Description |
---|---|---|
POST | /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/ providers/Microsoft.CustomProviders/resourceProviders/{resourceProviderName}/ myCustomAction?api-version=2018-09-01-preview |
The Azure REST API call to activate the action. |
If you have questions for Azure Custom Resource Provider development, try asking on Stack Overflow. A similar question may have already been asked and answered, so check first before posting. Add the tag azure-custom-providers
to get a fast response!
In this article, you learned about custom resource providers. Go to the next article to create a custom resource provider.
Обучение
Сертифициране
Microsoft Certified: Azure Developer Associate - Certifications
Build end-to-end solutions in Microsoft Azure to create Azure Functions, implement and manage web apps, develop solutions utilizing Azure storage, and more.