Skip to content

Commit

Permalink
fix(azurerm_log_analytics_workspace_table): Parse subscriptionId from…
Browse files Browse the repository at this point in the history
… workspaceId (#27590)

Subscription ID used to manage tables should be the same as the Log Analytics Workspace.

Fixes #27564
  • Loading branch information
xescab authored Nov 11, 2024
1 parent 765f5fb commit 8788c77
Showing 1 changed file with 1 addition and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,6 @@ func (r LogAnalyticsWorkspaceTableResource) Create() sdk.ResourceFunc {
return fmt.Errorf("decoding %+v", err)
}
client := metadata.Client.LogAnalytics.TablesClient
subscriptionId := metadata.Client.Account.SubscriptionId

tableName := model.Name
log.Printf("[INFO] preparing arguments for AzureRM Log Analytics Workspace Table %s update.", tableName)
Expand All @@ -123,7 +122,7 @@ func (r LogAnalyticsWorkspaceTableResource) Create() sdk.ResourceFunc {
return fmt.Errorf("invalid workspace object ID for table %s: %s", tableName, err)
}

id := tables.NewTableID(subscriptionId, workspaceId.ResourceGroupName, workspaceId.WorkspaceName, tableName)
id := tables.NewTableID(workspaceId.SubscriptionId, workspaceId.ResourceGroupName, workspaceId.WorkspaceName, tableName)

updateInput := tables.Table{
Properties: &tables.TableProperties{
Expand Down

0 comments on commit 8788c77

Please sign in to comment.