Skip to content

azurerm_cognitive_account data resource update - including new attributes#30778

Merged
catriona-m merged 9 commits intohashicorp:mainfrom
promisinganuj:update-cog-account-data-resource
Dec 8, 2025
Merged

azurerm_cognitive_account data resource update - including new attributes#30778
catriona-m merged 9 commits intohashicorp:mainfrom
promisinganuj:update-cog-account-data-resource

Conversation

@promisinganuj
Copy link
Collaborator

@promisinganuj promisinganuj commented Oct 3, 2025

Community Note

  • Please vote on this PR by adding a 👍 reaction to the original PR to help the community and maintainers prioritize for review
  • Please do not leave comments along the lines of "+1", "me too" or "any updates", they generate extra noise for PR followers and do not help prioritize for review

Description

This change is part of a larger initiative to streamline the deployment of Azure AI Foundry (kind='AIServices') service.
Here is the complete list of proposed changes:

- Update `azurerm_cognitive_account`                     [x] https://github.com/hashicorp/terraform-provider-azurerm/pull/30423 (Merged)
- Update `azurerm_cognitive_account` data source         [x] <---- This PR
- Update `azurerm_cognitive_deployment`                  [ ]
- New `azurerm_cognitive_account_connection`             [ ] https://github.com/hashicorp/terraform-provider-azurerm/pull/30981
- New `azurerm_cognitive_account_capabilityhost`         [ ]
- New `azurerm_cognitive_account_project`                [x] https://github.com/hashicorp/terraform-provider-azurerm/pull/30916 (Merged)
- New `azurerm_cognitive_account_project_connection      [ ]
- New `azurerm_cognitive_account_project_capabilityhost  [ ]
- Update `azurerm_cognitive_account` to use CustomPoller [ ]

PR Checklist

  • I have followed the guidelines in our Contributing Documentation.
  • I have checked to ensure there aren't other open Pull Requests for the same update/change.
  • I have checked if my changes close any open issues. If so please include appropriate closing keywords below.
  • I have updated/added Documentation as required written in a helpful and kind way to assist users that may be unfamiliar with the resource / data source.
  • I have used a meaningful PR title to help maintainers and other users understand this change and help prevent duplicate work.
    For example: “resource_name_here - description of change e.g. adding property new_property_name_here

Changes to existing Resource / Data Source

  • I have added an explanation of what my changes do and why I'd like you to include them (This may be covered by linking to an issue above, but may benefit from additional explanation).
  • I have written new tests for my resource or datasource changes & updated any relevant documentation.
  • I have successfully run tests with my changes locally. If not, please provide details on testing challenges that prevented you running the tests.
  • (For changes that include a state migration only). I have manually tested the migration path between relevant versions of the provider.

Testing

  • My submission includes Test coverage as described in the Contribution Guide and the tests pass. (if this is not possible for any reason, please include details of why you did or could not add test coverage)

Change Log

Below please provide what should go into the changelog (if anything) conforming to the Changelog Format documented here.

  • Data Source: azurerm_cognitive_account - export many new and existing attributes.

This is a (please select all that apply):

  • Bug Fix
  • New Feature (ie adding a service, resource, or data source)
  • Enhancement
  • Breaking Change

Related Issue(s)

Fixes #0000

AI Assistance Disclosure

  • AI Assisted - This contribution was made by, or with the assistance of, AI/LLMs

Rollback Plan

If a change needs to be reverted, we will publish an updated version of the provider.

Changes to Security Controls

Are there any changes to security controls (access controls, encryption, logging) in this pull request? If so, explain.

Note

If this PR changes meaningfully during the course of review please update the title and description as required.

@promisinganuj
Copy link
Collaborator Author

Local acceptance test results. Two tests are failing because of quota issue (fails in TC as well):
image

Copy link
Collaborator

@teowa teowa left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you for the PR. LGTM except for a few documentation issues.

@teowa
Copy link
Collaborator

teowa commented Oct 28, 2025

Thanks @promisinganuj , LGTM!

magodo
magodo previously requested changes Oct 28, 2025
Copy link
Collaborator

@magodo magodo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for this PR!
I've taken a look through and left some comments inline, but this is mostly looking good to me 👍

@promisinganuj
Copy link
Collaborator Author

Review comments incorporated. Latest acceptance tests result from local:
image

@promisinganuj promisinganuj requested a review from magodo October 29, 2025 06:28
@magodo
Copy link
Collaborator

magodo commented Oct 29, 2025

LGTM! Thanks!

WodansSon

This comment was marked as duplicate.

@promisinganuj
Copy link
Collaborator Author

Acc Test Results

image

@promisinganuj
Copy link
Collaborator Author

@WodansSon As discussed, i have skipped the two test cases. Please have a look.

magodo
magodo previously requested changes Nov 25, 2025
@promisinganuj
Copy link
Collaborator Author

Latest Acc Test results:
image

@promisinganuj
Copy link
Collaborator Author

@magodo , I have incorporated the changes. Please have a look.

Copy link
Member

@catriona-m catriona-m left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @promisinganuj I left a couple of minor comments inline, but otherwise this is looking good. Once those are addressed I can take another look. Thanks!

localAuthEnabled = !*props.DisableLocalAuth
d.Set("custom_subdomain_name", pointer.From(props.CustomSubDomainName))

customerManagedKey, err := flattenCognitiveAccountCustomerManagedKey(props.Encryption)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

could we create a separate function here specifically for flattening the customerManagedKey for the datasource?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi @catriona-m , is there any specific reason for this? There are other similar functions which are reused such as "flattenCognitiveAccountNetworkInjection", "flattenCognitiveAccountStorage".

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

it's best practice to separate these out just incase something later changes in the resource

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Got it, I have copied all the three functions within the Data Source. Please have another look.

@promisinganuj
Copy link
Collaborator Author

Thanks @catriona-m for taking time to review the changes. I have addressed all of them accept one. Please take another look.

@promisinganuj
Copy link
Collaborator Author

Hi @catriona-m , I have created separate functions in the data source. Please take another look.

@promisinganuj
Copy link
Collaborator Author

Latest TC results:
image

Copy link
Member

@catriona-m catriona-m left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @promisinganuj LGTM!

@github-actions
Copy link
Contributor

github-actions bot commented Jan 8, 2026

I'm going to lock this pull request because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active contributions.
If you have found a problem that seems related to this change, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants