-
Notifications
You must be signed in to change notification settings - Fork 5.1k
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
Fix Lint error #13765
Merged
jiacheng-L
merged 3 commits into
Azure:dev-keyvault-Microsoft.KeyVault-2021-04-01-preview
from
jiacheng-L:keyVaultFix
Apr 6, 2021
Merged
Fix Lint error #13765
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this done only for consistently with other control-plane definitions for KV? In practice, it's a pain: there are no ARM template functions to calculate or format this value, which means it has to be done outside the ARM template and passed in if people want to reuse the ARM template, which is one of ARM templates' goals: reusability.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi @heaths , here is the only place that we use unixtime for integer in control-plane. Now the swagger do this job, to validate the integer format. They only allow int32 or int64: https://github.com/Azure/azure-rest-api-specs/blob/master/documentation/openapi-authoring-automated-guidelines.md#R4013
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, an integer type needs a format. The point of my question, though, is whether this should be an integer at all - or a string using the datetime format.
ARM templates are meant to be reusable. There are ARM functions that, for example, can calculate datetimes and format them to standard ISO 8601 formats. So if you wanted to use a template written a year ago to provisioning a Key Vault and secret (or key) using an expiration date for reasonable now (say, today + 90 days), these integers do not work. They have to be passed in as parameters (and, hence, calculated outside the ARM template by some other scripts) or changed in the file itself - both of which make reusability of the ARM template unwieldy.
I recently came up against this trying to help customers on Stack Overflow. These offsets as integers since the 1970-01-01 epoch are not useful.
/cc @jlichwa
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@heaths I agree that using Unix Time in ARM templates is really bad experience (ARM template don't have function to convert datetime to unix time. and I went over many Stack Overflow issues complaining about it)
Our service (REST API for both planes) requires unix time today for all dates and that is what has been used, so I don't think we can change it without updating service, which will be breaking change.
I think we should create a feature request to replace all unix time with date time or anything else which is more dev friendly, but due to this being breaking change across many APIs, it is not an easy effort.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks. That's what I was wondering: if this is a change to make the swagger correct, or if there's opportunity to fix the problem now.
Bicep is considering (or at least there's "tons" of users requesting it) user-declared functions, but I wonder if requesting more date functions for ARM templates is feasible.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This change will be merged to PR: #13585, which is the new API version 2021-04-01-preview for control plane. That PR reported the integer format that must be fixed. As it is a new API version and swagger block this, I think it is OK to fix it now.