-
Notifications
You must be signed in to change notification settings - Fork 4.7k
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
azurerm_automation_dsc_configuration is broken since provider version 2.96.0 #16103
Comments
I have also opened an issue with Azure SDK for Go — Azure/azure-sdk-for-go#17591 |
Probably another duplicate of #10858 @tombuildsstuff FYI |
This comment was marked as off-topic.
This comment was marked as off-topic.
This comment was marked as off-topic.
This comment was marked as off-topic.
Fixed via #22403 |
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. |
Community Note
Terraform (and AzureRM Provider) Version
Affected Resource(s)
azurerm_automation_dsc_configuration
Terraform Configuration Files
Expected Behaviour
A new DSC configuration should be successfully created.
Actual Behaviour
Trying to apply the above code snippet produces the following error, starting with version 2.96.0 of the
azurerm
provider:Steps to Reproduce
Run
apply
on the code snippet above:terraform apply
References
I've done some preliminary debugging and I think the issue can be tracked down to the Azure SDK version change in provider v2.96.0:
terraform-provider-azurerm/internal/services/automation/automation_dsc_configuration_resource.go
Line 10 in 57c1717
In the
2020-01-13-preview/automation
the actual failure seems to happen when trying to unmarshall DSC Configuration content from JSON:https://github.com/Azure/azure-sdk-for-go/blob/94316bad34922dee81518b17ddb1454d7a5f89c8/services/preview/automation/mgmt/2020-01-13-preview/automation/dscconfiguration.go#L384
Since the
azurerm_automation_dsc_configuration.content_embedded
is not a valid JSON we get an error. This was not happening in the previous version of the API2018-06-30-preview/automation
and the content value was just passed as is:https://github.com/Azure/azure-sdk-for-go/blob/94316bad34922dee81518b17ddb1454d7a5f89c8/services/preview/automation/mgmt/2018-06-30-preview/automation/dscconfiguration.go#L383
Finally, the root cause can be traced to the change in the Swagger API definitions. The latest version of the
GetContent
API defines the output as astring
type, which I assume is tried to be de-serialized from JSON by default:https://github.com/Azure/azure-rest-api-specs/blob/3034ada77d465b317cda51250a92454824cca06b/specification/automation/resource-manager/Microsoft.Automation/stable/2019-06-01/dscConfiguration.json#L309
In the earlier version of the API spec the output type is set to
file
:https://github.com/Azure/azure-rest-api-specs/blob/3026119ab41bbce77275cfa3a1afbabf43af5aea/specification/automation/resource-manager/Microsoft.Automation/stable/2015-10-31/dscConfiguration.json#L309
I don't know whether this was intentional API spec change, or whether there is a need to provide further type modifiers in the Swagger API or whether it's an issue with the SDK codegen tool.
Happy to open issues in SDK and API specs repo if someone could validate my assumptions about the root cause of the issue.
The text was updated successfully, but these errors were encountered: