Skip to content
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

Support for APACHEAVRO format in azurerm_kusto_eventhub_data_connection#data_format #12455

Closed
agisbert opened this issue Jul 2, 2021 · 3 comments · Fixed by #12480
Closed

Comments

@agisbert
Copy link
Contributor

agisbert commented Jul 2, 2021

Community Note

  • Please vote on this issue by adding a 👍 reaction to the original issue to help the community and maintainers prioritize this request
  • Please do not leave "+1" or "me too" comments, they generate extra noise for issue followers and do not help prioritize the request
  • If you are interested in working on this issue or have submitted a pull request, please leave a comment

Description

Azure supports both AVRO and APACHEAVRO formats:

https://docs.microsoft.com/en-gb/azure/data-explorer/ingestion-supported-formats

However, the azure terraform provider does not:

https://registry.terraform.io/providers/hashicorp/azurerm/latest/docs/resources/kusto_eventhub_data_connection#data_format

And of course, complains when trying to use it:

│ Error: expected data_format to be one of [AVRO CSV JSON MULTIJSON PSV RAW SCSV SINGLEJSON SOHSV TSV TXT], got APACHEAVRO
│ 
│   with module.adx.azurerm_kusto_eventhub_data_connection.adx_eventhub_connection,
│   on ../../modules/adx/main.tf line 74, in resource "azurerm_kusto_eventhub_data_connection" "adx_eventhub_connection":
│   74:   data_format       = "APACHEAVRO"
│ 

New or Affected Resource(s)

  • azurerm_kusto_eventhub_data_connection
@agisbert
Copy link
Contributor Author

agisbert commented Jul 5, 2021

Hey @jackofallops ,

I'm actually not sure whether this is an enhancement or a bug. I forked the provider, and looked for the missing bits for "APACHEAVRO".

Funny thing is;

https://github.com/terraform-providers/terraform-provider-azurerm/blob/9e4e300defe006f4e9ce21e3765647991ee62768/vendor/github.com/Azure/azure-sdk-for-go/services/kusto/mgmt/2020-09-18/kusto/enums.go#L257-L297

Contains already AVRO and APACHEAVRO as supported data formats, however, seems the missing bit is only at the input validation for the resource:

https://github.com/terraform-providers/terraform-provider-azurerm/blob/3c1b3fca9cfcb6c405ab2a0a4b18f5828b5c6a1a/azurerm/internal/services/kusto/kusto_eventhub_data_connection_resource.go#L117-L129

I modified the following line, built the provider locally, tested it and it all went all right, creating the data ingestion with the APACHEAVRO data format. table_name and mapping_rule_name were not necessary.

2288e8c#diff-6277133348e05225dc501c4e9b12d478e5d45b72d1230b853d79e3626136c8f1R117-R119

Here is the PR in case you agree with the solution:
#12480

@agisbert
Copy link
Contributor Author

agisbert commented Jul 9, 2021

@github-actions
Copy link

github-actions bot commented Aug 9, 2021

I'm going to lock this issue because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active issues.
If you have found a problem that seems similar to this, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Aug 9, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants