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

Issue with insights / API Version 2021-07-01-preview - AccessModeSettings missing omitempty #901

Open
1 task done
katbyte opened this issue Feb 26, 2024 · 1 comment
Open
1 task done

Comments

@katbyte
Copy link
Collaborator

katbyte commented Feb 26, 2024

Is there an existing issue for this?

  • I have searched the existing issues

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

Service Used

insights

API Versions Used

2021-07-01-preview

Description

the model

type AzureMonitorPrivateLinkScopeProperties struct {
	AccessModeSettings         AccessModeSettings           `json:"accessModeSettings"`
	PrivateEndpointConnections *[]PrivateEndpointConnection `json:"privateEndpointConnections,omitempty"`
	ProvisioningState          *string                      `json:"provisioningState,omitempty"`
}

is missing omitempty leading to this payload

{
	"location": "Global",
	"properties": {
		"accessModeSettings": {
			"ingestionAccessMode": "",
			"queryAccessMode": ""
		}
	},
	"tags": {}
}

causing this error

=== RUN   TestAccMonitorPrivateLinkScopedService_basic
=== PAUSE TestAccMonitorPrivateLinkScopedService_basic
=== CONT  TestAccMonitorPrivateLinkScopedService_basic
    testcase.go:113: Step 1/2 error: Error running apply: exit status 1
        
        Error: creating/updating Private Link Scope (Subscription: "*******"
        Resource Group Name: "acctestRG-plss-240226211342829276"
        Private Link Scope Name: "acctest-pls-240226211342829276"): privatelinkscopesapis.PrivateLinkScopesAPIsClient#PrivateLinkScopesCreateOrUpdate: Failure responding to request: StatusCode=400 -- Original Error: autorest/azure: Service returned an error. Status=400 Code="BadRequest" Message="properties.accessModeSettings.ingestionAccessMode is invalid, allowed values are: 'Open', 'PrivateOnly'" InnerError={"trace":["System.ArgumentException"]}
        
          with azurerm_monitor_private_link_scope.test,
          on terraform_plugin_test.tf line 26, in resource "azurerm_monitor_private_link_scope" "test":
          26: resource "azurerm_monitor_private_link_scope" "test" {
        

References

hashicorp/terraform-provider-azurerm#24624

@tombuildsstuff
Copy link
Contributor

@katbyte this field is marked as Required in the Swagger, and since it's the only fields within that payload that's not readonly that looks right to me. Since this field isn't present in the older version of this API it appears this is a new requirement?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants