How to use the Management REST API (Azure Cognitive Search)
The Management REST API of Azure Cognitive Search provides programmatic access to much of the functionality available through the portal, allowing administrators to automate the following operations:
- Create or delete an Azure Cognitive Search service
- Create, regenerate, or retrieve
api-keysfor routine changes to the administrative keys used for authenticating data operations
- Adjust the scale of an Azure Cognitive Search service in response to changes in query volume or storage requirements
To fully administer your service programmatically, you will need two APIs: the Management REST API of Azure Cognitive Search, plus the common Azure Resource Manager REST API.
The Resource Manager API is used for general-purpose operations that are not service specific, such as querying subscription data, listing geo-locations, and so forth. To create and manage Azure Cognitive Search services in your subscription, make sure your HTTP request includes the Resource Manager endpoint, subscription ID, provider (in this case, Azure Cognitive Search), and the search service-specific operation.
The endpoint for service administration operations is the URL of Azure Resource Manager:
Note that all management API calls must include the subscription ID.
The current version of the Management REST API is
Authentication and Access Control
The Azure Cognitive Search Management REST API is an extension of the Azure Resource Manager and shares its dependencies. As such, Active Directory is a prerequisite to service administration of Azure Cognitive Search. All administrative requests from client code must be authenticated using Azure Active Directory before the request reaches the Resource Manager.
Note that if your application code handles service administration operations as well as data operations on search indexes or documents, you'll be using two authentication approaches for each of the Azure Cognitive Search service APIs:
Service and key administration, due to the dependency on Resource Manager, relies on Active Directory for authentication.
Data requests against the Azure Cognitive Search service endpoint, such as Create Index (Azure Cognitive Search REST API) or Search Documents (Azure Cognitive Search REST API), use an
api-keyin the request header. See Azure Cognitive Search REST APIs for information about authenticating a data request.
Authentication documentation for Resource Manager can be found at Use Resource Manager authentication API to access subscriptions.
Access control for Azure Resource Manager uses the built-in Owner, Contributor, and Reader roles. By default, all service administrators are members of the Owner role. For details, see Role-based access control in the Azure portal.
Visit these links for more information about service and index administration: