Azure Automation Authoring Toolkit Error [updated]

Today I tried out the Azure Automation Authoring Toolkit.

The Installation is very easy.
Open a PowerShell console:

Install-Module AzureAutomationAuthoringToolkit -Scope CurrentUser

Then open your PowerShell ISE and run

Import-Module AzureAutomationAuthoringToolkit

You can also install this module so that it loads automatically if you open the PowerShell ISE. To do so run this in your PowerShell console:


Certificate Error

When I tried it the first time, I connected to Azure Automation with the "Sign In" button and received this error (thumbprints replaced with xxxxx):

Add-AzureRmAccount : AADSTS70002: Error validating credentials. AADSTS50012: Client assertion contains an invalid signature. [Reason - The key  
used is expired., Thumbprint of key used by client: 'xxxxx', Found key 'Start=04/08/2017, End=04/08/2018,  
Thumbprint=xxxxx', Configured keys: [Key0:Start=11/04/2016, End=11/05/2017,  
Thumbprint=xxxxxx;Key1:Start=04/08/2017, End=04/08/2018, Thumbprint=xxxxxx;]]  
Trace ID: 7481fb7b-2d50-4b31-9745-b35d3ce14600  
Correlation ID: d13c4f35-437f-40c8-870d-342b8bfb7f45  
Timestamp: 2017-04-08 05:21:26Z  
In Zeile:1 Zeichen:305  
+ ... p 10;$Login=Add-AzureRmAccount -ServicePrincipal -TenantId $RunAsConn ...
+                 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : CloseError: (:) [Add-AzureRmAccount], AdalServiceException
    + FullyQualifiedErrorId : Microsoft.Azure.Commands.Profile.AddAzureRMAccountCommand

Select-AzureRmSubscription : Run Login-AzureRmAccount to login.  
In Zeile:1 Zeichen:487  
+ ... Thumbprint};Select-AzureRmSubscription -SubscriptionId $RunAsConnecti ...
+                 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : InvalidOperation: (:) [Set-AzureRmContext], PSInvalidOperationException
    + FullyQualifiedErrorId : InvalidOperation,Microsoft.Azure.Commands.Profile.SetAzureRMContextCommand

This happens because the automatically generated certificate starts in the future. In my case 2 hours in the future. After 2 hours waiting the error disappeared. This always happens the first time you choose an Automation Account for the first time.


This problem should be fixed in the release See here