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

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

Closed
benc-uk opened this issue Sep 30, 2020 · 5 comments · Fixed by #12710
Closed

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

benc-uk opened this issue Sep 30, 2020 · 5 comments · Fixed by #12710
Labels

Comments

@benc-uk
Copy link

benc-uk commented Sep 30, 2020

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

@ghost ghost added the needs-triage Workflow: This is a new issue that needs to be triaged to the appropriate team. label Sep 30, 2020
@benc-uk benc-uk changed the title Security Center Automations - missing fields required by the API Security Center Automations - fields required by the API are omitted Sep 30, 2020
@ArcturusZhang
Copy link
Member

Hi @benc-uk thanks for this issue and sorry for the inconvenience.

I have identified the root cause of this issue, and this will be resolved in the next major version

@ghost ghost removed the needs-triage Workflow: This is a new issue that needs to be triaged to the appropriate team. label Oct 12, 2020
@benc-uk
Copy link
Author

benc-uk commented Oct 12, 2020

Thanks @ArcturusZhang this is great news. I spotted v47 in the PR section, will this fix make that release or the one after?

@ArcturusZhang
Copy link
Member

Thanks @ArcturusZhang this is great news. I spotted v47 in the PR section, will this fix make that release or the one after?

Should be included in this release, I am working on it

@ArcturusZhang
Copy link
Member

ArcturusZhang commented Oct 13, 2020

Hi @benc-uk the v47.0.0 has been released and the issue should have been resolved, please have a try, thanks!

As you can see here, the location is now properly marshaled.

@benc-uk
Copy link
Author

benc-uk commented Oct 13, 2020

@ArcturusZhang I just checked my code, and v47 fixes this
Thanks for the speedy turn around on this one! Great stuff

@github-actions github-actions bot locked and limited conversation to collaborators Apr 11, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants