There is a dedicated datasource for this, namely data "azurerm_function_app_host_keys" "functionkeys"
By using this, you should be able to access the key with azurerm_function_app_host_key.functionkeys.default_function_key
If you need further information, please have a look at the documentation: