Azure Cognitive Search Data Source: Managed Identity Not Persisting - Always Returns Null

Sean M 0 Reputation points
2025-11-27T10:50:40.28+00:00

I'm unable to configure managed identity authentication for an Azure Cognitive Search data source connecting to Azure Blob Storage. Despite configuring it through both the Azure Portal and REST API, the identity property always remains null, preventing my indexer from reading custom blob metadata.

Environment

  • Region: Australia East
  • Search Service: Standard tier
  • Storage Account: StorageV2 with customer-managed encryption keys
  • Storage Settings:
    • allowSharedKeyAccess: false
    • defaultAction: Deny (firewall enabled)
    • bypass: AzureServices

What I'm Trying to Do

Index documents from Azure Blob Storage with custom metadata. The indexer successfully extracts document content but all custom metadata fields return null.

Blob Metadata Confirmed Present

Using Azure CLI, I've verified all 12 custom metadata fields exist on the blobs:


az storage blob metadata show --account-name myaccount --container-name docs --name "path/to/file.pdf"

Output shows: tenant_id, provider_id, document_id, title, etc. (all correctly set)

Configuration Attempts - All Failed

Attempt 1: Azure Portal (User-Assigned Identity)

  1. Navigate to Search Service → Data sources → Add data source
  2. Select storage account and container
  3. ✅ Check "Authenticate using managed identity"
  4. Select "User-assigned" type
  5. Select managed identity from dropdown
  6. Click Save

Result: Data source created, but when I query it via REST API:


{

  "credentials": {"connectionString": null},

  "identity": null

}

Attempt 2: REST API (Stable Version 2024-07-01)


POST https://{service}.search.windows.net/datasources?api-version=2024-07-01

{

  "name": "my-datasource",

  "type": "azureblob",

  "credentials": {

    "connectionString": "ResourceId=/subscriptions/{sub}/resourceGroups/{rg}/providers/Microsoft.Storage/storageAccounts/{account};"

  },

  "container": {"name": "docs", "query": "path/"},

  "identity": {

    "@odata.type": "#Microsoft.Azure.Search.DataUserAssignedIdentity",

    "userAssignedIdentity": "/subscriptions/{sub}/resourceGroups/{rg}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identity}"

  }

}

Error: "Cannot find nested property 'identity' on the resource type 'Microsoft.Azure.Search.V2024_07_01.DataSource'"

Attempt 3: REST API (Preview Version 2024-11-01-preview)

Same request with preview API version - no error returned, but GET request shows "identity": null

Attempt 4: System-Assigned Identity

  1. Enabled system-assigned identity on search service
  2. Granted "Storage Blob Data Reader" role to search service
  3. Configured data source with system-assigned identity type via Portal

Result: "identity": null

What I've Verified

✅ Managed identity exists and role assignment is correct

✅ Search service has the managed identity attached (visible in Identity blade)

✅ Storage firewall has bypass: AzureServices

✅ Blob metadata is correctly formatted (lowercase with underscores)

✅ Indexer field mappings use correct syntax: metadata_tenant_idtenant_id

✅ Indexer runs successfully: 2/2 documents processed, 0 errors

The Problem

  • ✅ Indexer extracts document content successfully
  • ❌ All custom metadata fields return null
  • This indicates authentication allows content access but not metadata access

Workaround (Not Acceptable for Production)

Setting allowSharedKeyAccess: true and using a connection string with account key works, but violates our security requirements.

Questions

  1. Is there a known compatibility issue between managed identity and storage accounts with customer-managed encryption keys?
  2. What is the correct method to configure managed identity for a data source when the stable API doesn't support the identity property?
  3. Has anyone successfully configured user-assigned managed identity for Azure Cognitive Search data sources in 2024/2025?
  4. Is this a Portal bug where the UI shows the configuration but doesn't actually save it?

Any guidance would be greatly appreciated! I'm blocked from production deployment until this is resolved.

Azure Blob Storage
Azure Blob Storage
An Azure service that stores unstructured data in the cloud as blobs.
{count} votes

Your answer

Answers can be marked as 'Accepted' by the question author and 'Recommended' by moderators, which helps users know the answer solved the author's problem.