Skip to content

Commit

Permalink
azurerm_log_analytics - fixing crash during read (#20011)
Browse files Browse the repository at this point in the history
  • Loading branch information
mbfrahry authored Jan 13, 2023
1 parent ed9e2ad commit 889e60c
Showing 1 changed file with 5 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -335,11 +335,6 @@ func resourceLogAnalyticsWorkspaceRead(d *pluginsdk.ResourceData, meta interface
ctx, cancel := timeouts.ForRead(meta.(*clients.Client).StopContext, d)
defer cancel()
id, err := workspaces.ParseWorkspaceID(d.Id())
sharedKeyId := sharedKeyWorkspaces.WorkspaceId{
SubscriptionId: id.SubscriptionId,
ResourceGroupName: id.ResourceGroupName,
WorkspaceName: id.WorkspaceName,
}
if err != nil {
return err
}
Expand Down Expand Up @@ -421,6 +416,11 @@ func resourceLogAnalyticsWorkspaceRead(d *pluginsdk.ResourceData, meta interface
}
d.Set("allow_resource_only_permissions", allowResourceOnlyPermissions)

sharedKeyId := sharedKeyWorkspaces.WorkspaceId{
SubscriptionId: id.SubscriptionId,
ResourceGroupName: id.ResourceGroupName,
WorkspaceName: id.WorkspaceName,
}
sharedKeysResp, err := sharedKeyClient.SharedKeysGetSharedKeys(ctx, sharedKeyId)
if err != nil {
log.Printf("[ERROR] Unable to List Shared keys for Log Analytics workspaces %s: %+v", id.WorkspaceName, err)
Expand Down

0 comments on commit 889e60c

Please sign in to comment.