Search code examples
terraform-provider-azureazure-cognitive-search

Terraform Azure Cognitive Search RBAC API Access control


Azure Cognitive Search currently supports RBAC authentication on searches as explained here :

  1. The RBAC support which is in preview as of Aug 2022 needs to be enabled on the subscription.
  2. Azure Search Instance -> Keys -> Enable support for both keys and RBAC

https://learn.microsoft.com/en-us/azure/search/search-security-rbac?tabs=config-svc-portal%2Croles-portal%2Ctest-portal%2Ccustom-role-portal#enable-rbac-preview-for-data-plane-operations

However I could not find support for these API access control via terraform

enter image description here"

Question : How can I terraform these controls ?


Solution

  • Azure Cognitive Search RBAC API Access control is currently in preview. Please ensure you are using the 2021-04-01-preview API version. You can find these controls under the DataPlaneAuthOptions section using "aadOrApiKey".

    https://learn.microsoft.com/en-us/azure/templates/microsoft.search/searchservices?pivots=deployment-language-terraform

    You can find the Azure Cognitive Search RBAC API documentation below: https://learn.microsoft.com/en-us/azure/search/search-security-rbac?tabs=config-svc-rest%2Croles-portal%2Ctest-portal%2Ccustom-role-portal#enable-rbac-preview-for-data-plane-operations