Skip to content

Add azure_rm_searchdatasource and _info modules - #2384

Draft
p3ck wants to merge 3 commits into
ansible-collections:devfrom
p3ck:aca-5882-searchdatasource
Draft

p3ck wants to merge 3 commits into
ansible-collections:devfrom
p3ck:aca-5882-searchdatasource

Conversation

@p3ck

@p3ck p3ck commented Oct 9, 2026

Copy link
Copy Markdown
Collaborator
SUMMARY

Adds two new modules to manage data source connections in an Azure AI Search
service (data plane), the next piece of the Azure AI Search module set after
azure_rm_searchindex (#2377):

  • azure_rm_searchdatasource — create, update, and delete a data source
    connection (Blob, Azure SQL, Cosmos DB, ADLS Gen2, Table). Idempotent and
    check-mode aware.
  • azure_rm_searchdatasource_info — get a specific data source or list all data
    sources in a service.

Built on the azure-search-documents SDK via the shared
AzureRMSearchDataPlaneMixin (SearchIndexerClient), mirroring the merged
azure_rm_searchindex.

Implementation notes:

  • create_or_update_data_source_connection is a full-replace PUT, so an update
    merges the user-supplied keys onto the existing data source to preserve settings
    that were not resupplied.
  • Azure redacts credentials.connectionString on read, so it is excluded from the
    drift comparison, and the <unchanged> sentinel is sent when the connection
    string is omitted on update (so other fields can be changed without resupplying
    the secret).
  • type and connection_string are required only when creating.

Validated with ansible-test sanity --docker and a live integration run in eastus
(ok=31 failed=0): create / idempotent re-create / info get+list / description-only
update (which asserts the PUT preserves type and container) / idempotent update
/ delete / idempotent delete.

ISSUE TYPE

New Module Pull Request

COMPONENT NAME

azure_rm_searchdatasource
azure_rm_searchdatasource_info

ADDITIONAL INFORMATION

The CI service principal needs Microsoft.Authorization/roleAssignments/write; the
integration test grants the test principal the Search Service Contributor role
to manage data-plane object definitions.

Assisted-by: Claude Opus 4.8 (Anthropic)

p3ck and others added 3 commits October 9, 2026 09:07
Add azure_rm_searchdatasource and azure_rm_searchdatasource_info to manage data
source connections in an Azure AI Search service (data plane), built on the
azure-search-documents SDK via the shared AzureRMSearchDataPlaneMixin
(SearchIndexerClient), mirroring the merged azure_rm_searchindex pattern.

Idempotent and check-mode aware. Azure redacts credentials.connectionString on
read, so it is dropped from the drift comparison; on a full-replace PUT update
the module merges user-supplied keys onto the existing data source to preserve
unsupplied settings, and sends the <unchanged> sentinel when the connection
string is not resupplied. type and connection_string are required only on create.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Stands up a search service (AAD data-plane auth + Search Service Contributor)
and a storage account, then exercises create/idempotent/info/update/delete. The
update changes only the description (omitting type, connection_string and
container) to verify the PUT merge preserves the other fields and the connection
string.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ready-for-review The PR is ready to be reviewed and merged.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant