Closed smeury closed 7 years ago
Thanks for the feedback on this. It does seem like it could be a time zone issue. I'll have a look and see if I can tell what might cause this. Thanks, Eamon
We ran into this same issue in another project and solved it by setting the "NotBefore" property of the cert to a UTC based DateTime value at creation time.
$cert.NotBefore = [System.DateTime]::UtcNow
Hopefully this helps..
Thanks Justin - I'll give this a go and see if it resolves the issue. Eamon
For some reason, it is still adding an hour to the certificate start time.
I'm in the UK, with the current time zone being British Summer Time = +1 GMT / UTC, but as you can see, from the following, the certificate time should start an hour earlier, not an hour later:
Get-Date = 01/07/2017 23:56:32
[DateTime]::Now = 07/01/2017 23:56:32
[DateTime]::UtcNow = 07/01/2017 22:56:32
Any ideas?
Thanks
There is still an issue with the start time of the certificate. I installed the ISE addon on a new system, with the following time values:
[DateTime]::Now = Dienstag, 3. Oktober 2017 13:17:51
[DateTime]::UtcNow = Dienstag, 3. Oktober 2017 11:17:51
The value of the certificate property "NotBefore" is: Dienstag, 3. Oktober 2017 15:03:19
Version of the toolkit:
Get-Module AzureAutomationAuthoringToolKit
ModuleType Version Name ExportedCommands
---------- ------- ---- ----------------
Script 0.2.3.8 AzureAutomationAuthoringToolkit {Get-AutomationCertificate, Get-AutomationConnection,...
@eamonoreilly Your change would solve this issue. As far as i can see, it did not make its way into the master branch of this repro. Can you check? Was looking into the wrong file... Sorry.
Just a quick update: Downloading the latest sources and building it on my machine did resolve the issue. Prio this step the certificate property "NotBefore" was: [Now] + 2 hours. The certificates for the automation accounts did also have the wrong (future) date.
Following the link to the powershell gallery: The version over there is outdated compared to changes made for this issue
Version | Downloads | Last updated
AzureAutomationAuthoringToolkit 0.2.3.8 (this version) | 7320 | Thursday, February 16 2017
Thanks - I'll work on a new build so that the latest fixes can get onto the official release on PowerShell gallery.
New release is now live on https://www.powershellgallery.com/packages/AzureAutomationAuthoringToolkit/0.2.3.9 with this change incorporated. Thanks.
The first time I signed in to Azure Automation with the ISE addon I received this error (replaced the thumbprints with xxx):
I found out that the certificate that was generated starts 2 hours in the future. After waiting for 2 hours I didn't receive this error again.
Maybe there is a problem with timezones?