-
Notifications
You must be signed in to change notification settings - Fork 4.7k
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
Update the Cognitive SDK to use API Version 2024-10-01
from 2023-05-01
#27851
Changes from all commits
e02eb7c
923d54a
763ef10
4fad96b
12ead07
cc96d09
f24a708
ab29b17
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -15,7 +15,7 @@ import ( | |
"github.com/hashicorp/go-azure-helpers/resourcemanager/identity" | ||
"github.com/hashicorp/go-azure-helpers/resourcemanager/location" | ||
"github.com/hashicorp/go-azure-helpers/resourcemanager/tags" | ||
"github.com/hashicorp/go-azure-sdk/resource-manager/cognitive/2023-05-01/cognitiveservicesaccounts" | ||
"github.com/hashicorp/go-azure-sdk/resource-manager/cognitive/2024-10-01/cognitiveservicesaccounts" | ||
search "github.com/hashicorp/go-azure-sdk/resource-manager/search/2022-09-01/services" | ||
"github.com/hashicorp/terraform-provider-azurerm/helpers/azure" | ||
"github.com/hashicorp/terraform-provider-azurerm/helpers/tf" | ||
|
@@ -518,17 +518,6 @@ func resourceCognitiveAccountRead(d *pluginsdk.ResourceData, meta interface{}) e | |
return fmt.Errorf("retrieving %s: %+v", *id, err) | ||
} | ||
|
||
keys, err := client.AccountsListKeys(ctx, *id) | ||
if err != nil { | ||
// note for the resource we shouldn't gracefully fail since we have permission to CRUD it | ||
return fmt.Errorf("listing the Keys for %s: %+v", *id, err) | ||
} | ||
|
||
if model := keys.Model; model != nil { | ||
d.Set("primary_access_key", model.Key1) | ||
d.Set("secondary_access_key", model.Key2) | ||
} | ||
|
||
d.Set("name", id.AccountName) | ||
d.Set("resource_group_name", id.ResourceGroupName) | ||
|
||
|
@@ -591,6 +580,19 @@ func resourceCognitiveAccountRead(d *pluginsdk.ResourceData, meta interface{}) e | |
} | ||
d.Set("local_auth_enabled", localAuthEnabled) | ||
|
||
if localAuthEnabled { | ||
keys, err := client.AccountsListKeys(ctx, *id) | ||
if err != nil { | ||
// note for the resource we shouldn't gracefully fail since we have permission to CRUD it | ||
return fmt.Errorf("listing the Keys for %s: %+v", *id, err) | ||
} | ||
|
||
if model := keys.Model; model != nil { | ||
d.Set("primary_access_key", model.Key1) | ||
d.Set("secondary_access_key", model.Key2) | ||
} | ||
} | ||
Comment on lines
+583
to
+594
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Can you please update the documentation with a note below these properties with the explanation that these are only available if |
||
|
||
Comment on lines
+583
to
+595
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Technically a breaking change since these were being populated when using Whether those keys were actually useful though is another question. Pointing this out for awareness. |
||
customerManagedKey, err := flattenCognitiveAccountCustomerManagedKey(props.Encryption) | ||
if err != nil { | ||
return err | ||
|
This file was deleted.
This file was deleted.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you please update the documentation with a note below these properties with the explanation that these are only available if
location_authentication_enabled
istrue