Skip to content

Security Center Automations - fields required by the API are omitted #12634

Closed

Description

Bug Report

  • import path of package in question: services/preview/security/mgmt/v1.0/security
  • SDK versionv46.4.0
  • Go version: go1.15.1 linux/amd64

What happened?

When trying to create or update an automation using the SDK and the CreateOrUpdate function, the following error is returned

StatusCode=400 -- Original Error: autorest/azure: Service returned an error. Status=400 Code="LocationRequired" Message="The location property is required for this definition."

I expect this package within the SDK has never worked due to this error

What did you expect or want to happen?

The CreateOrUpdate operation to succeed and the resource is created in Azure

Why this happened

The Automation struct has the READ-ONLY comment above the Location field
Link to code in the SDK

The MarshallJSON() function does not include the Location field
Link to code in the SDK

I suspect this is due to an error in the upstream API spec where that field has been marked read-only

How can we reproduce it?

Sample code to easily reproduce the bug is here https://gist.github.com/benc-uk/c6114689e978c834b92b6fcd9656c020

Anything we should know about your environment.

Nothing of note

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

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions