Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Failed to import azurerm_cognitive_deployment #27166

Closed
1 task done
magodo opened this issue Aug 23, 2024 · 4 comments
Closed
1 task done

Failed to import azurerm_cognitive_deployment #27166

magodo opened this issue Aug 23, 2024 · 4 comments

Comments

@magodo
Copy link
Collaborator

magodo commented Aug 23, 2024

Is there an existing issue for this?

  • I have searched the existing issues

Community Note

  • Please vote on this issue by adding a 👍 reaction to the original issue to help the community and maintainers prioritize this request
  • Please do not leave comments along the lines of "+1", "me too" or "any updates", they generate extra noise for issue followers and do not help prioritize the request
  • If you are interested in working on this issue or have submitted a pull request, please leave a comment and review the contribution guide to help.

Terraform Version

1.9.0

AzureRM Provider Version

4.0.0

Affected Resource(s)/Data Source(s)

azurerm_cognitive_deployment

Terraform Configuration Files

N/A

Debug Output/Panic Output

stderr=
  | 2024/08/23 16:12:59 profile: cpu profiling enabled, /tmp/profile1197563241/cpu.pprof
  | 2024-08-23T16:13:00.318+0800 [ERROR] terraform-provider-azurerm.terraform-provider-azurerm: [ERROR] setting state: Invalid address to set: []string{"scale"}
  | 2024-08-23T16:13:00.319+0800 [ERROR] terraform-provider-azurerm.terraform-provider-azurerm: Response contains error diagnostic: @caller=/home/magodo/github/terraform-provider-azurerm/vendor/github.com/hashicorp/terraform-plugin-go/tfprotov5/internal/diag/diagnostics.go:58 @module=sdk.proto diagnostic_summary="setting \"scale\": Invalid address to set: []string{\"scale\"}" tf_proto_version=5.6 tf_provider_addr=registry.terraform.io/hashicorp/azurerm tf_req_id=0ba63195-7702-e1b9-e137-b5c84a43f33e diagnostic_detail="setting \"scale\": Invalid address to set: []string{\"scale\"}" diagnostic_severity=ERROR tf_resource_type=azurerm_cognitive_deployment tf_rpc=ReadResource timestamp="2024-08-23T16:13:00.319+0800"
  | 2024-08-23T16:13:00.321+0800 [ERROR] terraform-provider-azurerm: setting "scale": Invalid address to set: []string{"scale"}: setting "scale": Invalid address to set: []string{"scale"}

Expected Behaviour

No response

Actual Behaviour

No response

Steps to Reproduce

terraform import

Important Factoids

This seems to be some missing part when enabling 4.0

References

No response

@fabiendelpierre
Copy link

I haven't tested this, but could it have to do with the change to resource provider registration?

https://registry.terraform.io/providers/hashicorp/azurerm/latest/docs/guides/4.0-upgrade-guide#improved-resource-provider-registration

The doc doesn't say clearly what the default behavior is but it sounds like "legacy" (reference) may be the default. If it were me I'd start troubleshooting by adding this new resource_provider_registrations parameter and make sure Microsoft.CognitiveServices is included in the set of RPs you're using.

@JoshJarabek7
Copy link

I tried 'all' for provider registrations and it was still failing:

Plan: 4 to add, 1 to change, 0 to destroy. ╷ │ Error: setting "scale": Invalid address to set: []string{"scale"} │ │ with azurerm_cognitive_deployment.gpt_4o, │ on main.tf line 306, in resource "azurerm_cognitive_deployment" "gpt_4o": │ 306: resource "azurerm_cognitive_deployment" "gpt_4o" { │ │ setting "scale": Invalid address to set: []string{"scale"} ╵

However, upgrading from 4.0.0 to 4.0.1 seems to have fixed it. 👍

@magodo
Copy link
Collaborator Author

magodo commented Aug 26, 2024

Fixed by #27173

@magodo magodo closed this as completed Aug 26, 2024
Copy link

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

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Sep 25, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

4 participants