terraform-provider-azapi
terraform-provider-azapi copied to clipboard
Data source azapi_resource_action does not handle responses that are not json.
When using data source azapi_resource_action with an action that returns Content-Type: text/plain, the resource errors with the following error as it is expecting a JSON response:
unmarshalling type *interface {}: invalid character '<first char of response body>' looking for beginning of value
My use case is retrieving the output of an automation account job and saving the entire body as an output.
data "azapi_resource_action" "job_output" {
type = "Microsoft.Automation/automationAccounts/jobs@2019-06-01"
resource_id = <job resource id>
action = "output"
method = "GET"
}
Hi @AustinSmart ,
Thank you for taking time to report this issue!
Yes, it doesn't work with text/plain content type, I'll work on supporting it.