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 - Set(Secret) does not properly store Expires and NotBefore dateTimes #7196

Closed
3 tasks done
KSchlobohm opened this issue Aug 7, 2019 · 2 comments · Fixed by #7418
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
Created a new secret and then set the DateTimeOffset for the Expires and NotBefore properties. Reviewed the data in the Azure portal and saw that the date in the portal does not match the date retrieved from the SDK.

Exception or Stack Trace

  • N/A

To Reproduce

  1. Use supporting documentation to setup a new keyvault
  2. Follow the steps for creating a new Secret("mySecret","myValue")
  3. Set the properites on the new Secret object for Expires and NotBefore
  4. Save the object using the SecretClient.Set method
  5. Get the object using the SecretClient.Get method
  6. Observed: The properties on the retrieved object do not match the results displayed in the Azure portal. The azure portal shows the secret will Expire in the year 51703

Code Snippet

            SecretClient client = new SecretClient(
                vaultUri: new Uri("https://ux-bash-keyvault.vault.azure.net/"),
                credential: new DefaultAzureCredential());

            // Create a new secret using the secret client
            var newSecret = new Secret("mySecret", "newSecret");
            newSecret.Expires = new DateTimeOffset(DateTime.Now.AddDays(50));
            newSecret.NotBefore = new DateTimeOffset(DateTime.Now.AddDays(49));
            var newSecretResponse = client.Set(newSecret);
            Secret getNewSecretResponse = client.Get(newSecret.Name);
            Console.WriteLine("New Secret secret.Value: " + getNewSecretResponse.Name);
            Console.WriteLine("New Secret secret.Version: " + getNewSecretResponse.Version);
            Console.WriteLine("New Secret secret.Expires: " + getNewSecretResponse.Expires);
            Console.WriteLine("New Secret secret.NotBefore: " + getNewSecretResponse.NotBefore);

Expected behavior
Expecting the Date in the Azure portal to match the date returned by the library.

Screenshots
KeyVault date does not match

Setup (please complete the following information):

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

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 heaths assigned heaths and unassigned schaabs Aug 27, 2019
heaths added a commit to heaths/azure-sdk-for-net that referenced this issue Aug 28, 2019
heaths added a commit that referenced this issue Aug 28, 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