Skip to content

Commit

Permalink
comment out list keys
Browse files Browse the repository at this point in the history
  • Loading branch information
ricleal-fugue committed Jan 13, 2023
1 parent 8035b68 commit aaa39e4
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 10 deletions.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -51,4 +51,6 @@ tf.zip
# do not upload secrets
.env
tmp/
/debug
*.orig

21 changes: 11 additions & 10 deletions internal/services/batch/batch_account_resource.go
Original file line number Diff line number Diff line change
Expand Up @@ -346,16 +346,17 @@ func resourceBatchAccountRead(d *pluginsdk.ResourceData, meta interface{}) error
}
}

if d.Get("pool_allocation_mode").(string) == string(batch.PoolAllocationModeBatchService) &&
isShardKeyAllowed(d.Get("allowed_authentication_modes").(*pluginsdk.Set).List()) {
keys, err := client.GetKeys(ctx, id.ResourceGroup, id.BatchAccountName)
if err != nil {
return fmt.Errorf("Cannot read keys for Batch account %q (resource group %q): %v", id.BatchAccountName, id.ResourceGroup, err)
}

d.Set("primary_access_key", keys.Primary)
d.Set("secondary_access_key", keys.Secondary)
}
// we don't have permissions to read the keys
// if d.Get("pool_allocation_mode").(string) == string(batch.PoolAllocationModeBatchService) &&
// isShardKeyAllowed(d.Get("allowed_authentication_modes").(*pluginsdk.Set).List()) {
// keys, err := client.GetKeys(ctx, id.ResourceGroup, id.BatchAccountName)
// if err != nil {
// return fmt.Errorf("Cannot read keys for Batch account %q (resource group %q): %v", id.BatchAccountName, id.ResourceGroup, err)
// }

// d.Set("primary_access_key", keys.Primary)
// d.Set("secondary_access_key", keys.Secondary)
// }

return tags.FlattenAndSet(d, resp.Tags)
}
Expand Down

0 comments on commit aaa39e4

Please sign in to comment.