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

[BUG] Azure.Security.KeyVault.Secrets preview2 doesn't support update #7189

Closed
3 tasks done
KSchlobohm opened this issue Aug 7, 2019 · 4 comments · Fixed by #7943
Closed
3 tasks done

[BUG] Azure.Security.KeyVault.Secrets preview2 doesn't support update #7189

KSchlobohm opened this issue Aug 7, 2019 · 4 comments · Fixed by #7943
Assignees
Labels
Client This issue points to a problem in the data-plane of the library. KeyVault

Comments

@KSchlobohm
Copy link

KSchlobohm commented Aug 7, 2019

Describe the bug
Following along with the documentation the process for updating a secret is shown. This process does not compile (the Secret constructor requires 2 string params) and does not succeed due to a required parameter of secret.Version which is a read-only property.

NOTE: another issue with the example is that the returned object from client.Update is of type SecretBase which does not have a "Value" property as shown in the example. This "missing property" issue also applies to the delete example in the Readme.md file.

Exception or Stack Trace

  • System.ArgumentNullException: 'Value cannot be null. (Parameter 'secret.Version')'

To Reproduce
Steps to reproduce the behavior:

  1. Example

Code Snippet

Secret secret = new Secret("secret-name");

// Clients may specify the content type of a secret to assist in interpreting the secret data when it's retrieved
secret.ContentType = "text/plain";

// You can specify additional application-specific metadata in the form of tags.
secret.Tags["foo"] = "updated tag";

SecretBase updatedSecret = client.Update(secret);

Console.WriteLine(updatedSecret.Name);
Console.WriteLine(updatedSecret.Value);
Console.WriteLine(updatedSecret.Version);
Console.WriteLine(updatedSecret.ContentType);

Expected behavior
Expecting to be able to set the version of the secret and receive an updatedSecret response.

Screenshots
If applicable, add screenshots to help explain your problem.

Setup (please complete the following information):

  • OS: [Windows 10]
  • IDE : [Visual Studio]
  • Version of the Library used: Azure.Security.KeyVault.Secrets -Version 4.0.0-preview.2

Additional context
Add any other context about the problem here.

Information Checklist
Kindly make sure that you have added all the following information above and checkoff the required fields otherwise we will treat the issuer as an incomplete report

  • Bug Description Added
  • Repro Steps Added
  • Setup information Added
@triage-new-issues triage-new-issues bot added the needs-triage Workflow: This is a new issue that needs to be triaged to the appropriate team. label Aug 7, 2019
@loarabia loarabia added Client This issue points to a problem in the data-plane of the library. KeyVault labels Aug 7, 2019
@triage-new-issues triage-new-issues bot removed the needs-triage Workflow: This is a new issue that needs to be triaged to the appropriate team. label Aug 7, 2019
@KSchlobohm
Copy link
Author

Looks like the link to the KeyVault Readme is changing with regard to the link for Steps to Reproduce.

@AlexGhiondea
Copy link
Contributor

@KSchlobohm thanks for pointing this out! We'll take a look at this!

@heaths
Copy link
Member

heaths commented Aug 27, 2019

Thanks for the feedback! The server API actually only updates secret attributes, so the value isn't part of the response, though if required to be passed in could simply be cached. We are considering what this API will look like and how it relates to the other bug about GetSecrets() returning a SecretBase. As such, we'll consider this for preview 4.

heaths added a commit to heaths/azure-sdk-for-net that referenced this issue Aug 28, 2019
Addresses issues raised in Azure#7189 and Azure#7193 where the samples do not compile. These are not fixes, as we'll address the API issues in track 2 preview 4.
heaths added a commit that referenced this issue Aug 28, 2019
Addresses issues raised in #7189 and #7193 where the samples do not compile. These are not fixes, as we'll address the API issues in track 2 preview 4.
@heaths
Copy link
Member

heaths commented Oct 2, 2019

The client code was fixed in #7729. Will leave open to track making sure the samples are updated.

heaths added a commit to heaths/azure-sdk-for-net that referenced this issue Oct 5, 2019
heaths added a commit that referenced this issue Oct 7, 2019
@github-actions github-actions bot locked and limited conversation to collaborators Mar 29, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Client This issue points to a problem in the data-plane of the library. KeyVault
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants