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

New-AzureRmAutomationSchedule TimeZone ignored when using DaysOfWeek and WeekInterval #3043

Closed
pbering opened this issue Oct 1, 2016 · 4 comments
Assignees
Labels
Automation Service Attention This issue is responsible by Azure service team.

Comments

@pbering
Copy link

pbering commented Oct 1, 2016

Cmdlet(s)

PowerShell Version

5.1.14393.206

Module Version

3.0

OS Version

10.0.14393.206

Description

Debug Output

DEBUG: 23:51:05 - NewAzureAutomationSchedule begin processing with ParameterSet 'ByWeekly'.
DEBUG: 23:51:05 - using account id 'pmb@codehouse.com'...
DEBUG: [Common.Authentication]: Authenticating using Account: 'pmb@codehouse.com', environment: 'AzureCloud', tenant: '48eed373-fc69-4460-8a43-78e33fa
9d6a9'
DEBUG: Microsoft.IdentityModel.Clients.ActiveDirectory Information: 2 : 
DEBUG: 10/01/2016 21:51:05:  - TokenCache: Deserialized 3 items to token cache.

DEBUG: [Common.Authentication]: Authenticating using configuration values: Domain: '48eed373-fc69-4460-8a43-78e33fa9d6a9', Endpoint: 'https://login.mi
crosoftonline.com/', ClientId: '1950a258-227b-4e31-a9cf-717495945fc2', ClientRedirect: 'urn:ietf:wg:oauth:2.0:oob', ResourceClientUri: 'https://manage
ment.core.windows.net/', ValidateAuthrity: 'True'
DEBUG: [Common.Authentication]: Acquiring token using context with Authority 'https://login.microsoftonline.com/48eed373-fc69-4460-8a43-78e33fa9d6a9/'
, CorrelationId: '00000000-0000-0000-0000-000000000000', ValidateAuthority: 'True'
DEBUG: [Common.Authentication]: Acquiring token using AdalConfiguration with Domain: '48eed373-fc69-4460-8a43-78e33fa9d6a9', AdEndpoint: 'https://logi
n.microsoftonline.com/', ClientId: '1950a258-227b-4e31-a9cf-717495945fc2', ClientRedirectUri: urn:ietf:wg:oauth:2.0:oob
DEBUG: Microsoft.IdentityModel.Clients.ActiveDirectory Information: 2 : 
DEBUG: 10/01/2016 21:51:05: 8037015f-84fa-43da-b02f-36076330c4d5 - AcquireTokenHandlerBase: === Token Acquisition started:
    Authority: https://login.microsoftonline.com/48eed373-fc69-4460-8a43-78e33fa9d6a9/
    Resource: https://management.core.windows.net/
    ClientId: 1950a258-227b-4e31-a9cf-717495945fc2
    CacheType: Microsoft.IdentityModel.Clients.ActiveDirectory.TokenCache (3 items)
    Authentication Target: User


DEBUG: Microsoft.IdentityModel.Clients.ActiveDirectory Verbose: 1 : 
DEBUG: 10/01/2016 21:51:05: 8037015f-84fa-43da-b02f-36076330c4d5 - TokenCache: Looking up cache for a token...

DEBUG: Microsoft.IdentityModel.Clients.ActiveDirectory Information: 2 : 
DEBUG: 10/01/2016 21:51:05: 8037015f-84fa-43da-b02f-36076330c4d5 - TokenCache: An item matching the requested resource was found in the cache

DEBUG: Microsoft.IdentityModel.Clients.ActiveDirectory Verbose: 1 : 
DEBUG: 10/01/2016 21:51:05: 8037015f-84fa-43da-b02f-36076330c4d5 - TokenCache: 59.90450812 minutes left until token in cache expires

DEBUG: Microsoft.IdentityModel.Clients.ActiveDirectory Information: 2 : 
DEBUG: 10/01/2016 21:51:05: 8037015f-84fa-43da-b02f-36076330c4d5 - TokenCache: A matching item (access token or refresh token or both) was found in th
e cache

DEBUG: Microsoft.IdentityModel.Clients.ActiveDirectory Information: 2 : 
DEBUG: 10/01/2016 21:51:05: 8037015f-84fa-43da-b02f-36076330c4d5 - AcquireTokenHandlerBase: === Token Acquisition finished successfully. An access tok
en was retuned:
    Access Token Hash: 0MYvy4Hkt1Ce+aGNsifPVjrVqH4TDxVOceS59fbd7bc=
    Refresh Token Hash: cTx8f9ToqB0wVDtx66IbF2jVgxSAhDtZvII62FrzDEU=
    Expiration Time: 10/01/2016 22:50:59 +00:00
    User Hash: dmN7ykiq0qKHBDuejP+zPZhKQNDWnTkPREk9inNW1WI=


DEBUG: Microsoft.IdentityModel.Clients.ActiveDirectory Information: 2 : 
DEBUG: 10/01/2016 21:51:05:  - TokenCache: Serializing token cache with 3 items.

DEBUG: [Common.Authentication]: Received token with LoginType 'LiveId', Tenant: '48eed373-fc69-4460-8a43-78e33fa9d6a9', UserId: 'pmb@codehouse.com'
DEBUG: [Common.Authentication]: Renewing Token with Type: 'Bearer', Expiry: '10/01/2016 22:50:59 +00:00', MultipleResource? 'True', Tenant: '48eed373-
fc69-4460-8a43-78e33fa9d6a9', UserId: 'pmb@codehouse.com'
DEBUG: [Common.Authentication]: User info for token DisplayId: 'pmb@codehouse.com', Name: Per Bering, IdProvider: 'live.com', Uid: 'ead02efb-53d8-47ac
-96c4-de2352579ebc'
DEBUG: [Common.Authentication]: Checking token expiration, token expires '10/01/2016 22:50:59 +00:00' Comparing to '10/01/2016 21:51:05 +00:00' With t
hreshold '00:05:00', calculated time until token expiry: '00:59:54.2704872'
DEBUG: ============================ HTTP REQUEST ============================

HTTP Method:
PUT

Absolute Uri:
https://management.azure.com/subscriptions/d85bb431-2275-40fd-b880-38a99ba86202/resourceGroups/interdan-carsubscription-westeurope-dev/providers/Micro
soft.Automation/automationAccounts/carsub-automation-dev/schedules/Friday?api-version=2015-10-31

Headers:
Accept                        : application/json
x-ms-version                  : 2014-06-01

Body:
{
  "name": "Friday",
  "properties": {
    "startTime": "2016-10-02T10:00:00+02:00",
    "expiryTime": "9999-12-31T23:59:59.9999999+01:00",
    "interval": 1,
    "frequency": "Week",
    "advancedSchedule": {
      "weekDays": [
        "Friday"
      ]
    }
  }
}


DEBUG: ============================ HTTP RESPONSE ============================

Status Code:
Created

Headers:
Pragma                        : no-cache
x-ms-request-id               : eec79e98-9254-437a-88b6-12102a821721
x-ms-location                 : https://management.azure.com/subscriptions/d85bb431-2275-40fd-b880-38a99ba86202/resourceGroups/interdan-carsubscriptio
n-westeurope-dev/providers/Microsoft.Automation/automationAccounts/carsub-automation-dev/schedules/Friday?api-version=2015-10-31
ocp-location                  : https://management.azure.com/subscriptions/d85bb431-2275-40fd-b880-38a99ba86202/resourceGroups/interdan-carsubscriptio
n-westeurope-dev/providers/Microsoft.Automation/automationAccounts/carsub-automation-dev/schedules/Friday?api-version=2015-10-31
Strict-Transport-Security     : max-age=31536000; includeSubDomains
x-ms-ratelimit-remaining-subscription-writes: 1197
x-ms-correlation-request-id   : 52a6dc61-4055-4229-8f7b-f0b7fb02b77f
x-ms-routing-request-id       : WESTEUROPE:20161001T215106Z:52a6dc61-4055-4229-8f7b-f0b7fb02b77f
Cache-Control                 : no-cache
Date                          : Sat, 01 Oct 2016 21:51:05 GMT
Location                      : https://management.azure.com/subscriptions/d85bb431-2275-40fd-b880-38a99ba86202/resourceGroups/interdan-carsubscriptio
n-westeurope-dev/providers/Microsoft.Automation/automationAccounts/carsub-automation-dev/schedules/Friday?api-version=2015-10-31
Server                        : Microsoft-IIS/8.5
X-AspNet-Version              : 4.0.30319
X-Powered-By                  : ASP.NET

Body:
{
  "id": "/subscriptions/d85bb431-2275-40fd-b880-38a99ba86202/resourceGroups/interdan-carsubscription-westeurope-dev/providers/Microsoft.Automation/aut
omationAccounts/carsub-automation-dev/schedules/Friday",
  "name": "Friday",
  "properties": {
    "description": null,
    "startTime": "2016-10-02T10:00:00+02:00",
    "startTimeOffsetMinutes": 0.0,
    "expiryTime": "9999-12-31T23:59:59.9999999+01:00",
    "expiryTimeOffsetMinutes": 0.0,
    "isEnabled": true,
    "nextRun": "2016-10-07T10:00:00+02:00",
    "nextRunOffsetMinutes": 0.0,
    "interval": 1,
    "frequency": "Week",
    "creationTime": "2016-10-01T23:51:05.27+02:00",
    "lastModifiedTime": "2016-10-01T23:51:05.27+02:00",
    "timeZone": "UTC",
    "advancedSchedule": {
      "monthDays": null,
      "monthlyOccurrences": null,
      "weekDays": [
        "Friday"
      ]
    }
  }
}


DEBUG: [Common.Authentication]: Renewing Token with Type: 'Bearer', Expiry: '10/01/2016 22:50:59 +00:00', MultipleResource? 'True', Tenant: '48eed373-
fc69-4460-8a43-78e33fa9d6a9', UserId: 'pmb@codehouse.com'
DEBUG: [Common.Authentication]: User info for token DisplayId: 'pmb@codehouse.com', Name: Per Bering, IdProvider: 'live.com', Uid: 'ead02efb-53d8-47ac
-96c4-de2352579ebc'
DEBUG: [Common.Authentication]: Checking token expiration, token expires '10/01/2016 22:50:59 +00:00' Comparing to '10/01/2016 21:51:06 +00:00' With t
hreshold '00:05:00', calculated time until token expiry: '00:59:53.6968768'
DEBUG: ============================ HTTP REQUEST ============================

HTTP Method:
GET

Absolute Uri:
https://management.azure.com/subscriptions/d85bb431-2275-40fd-b880-38a99ba86202/resourceGroups/interdan-carsubscription-westeurope-dev/providers/Micro
soft.Automation/automationAccounts/carsub-automation-dev/schedules/Friday?api-version=2015-10-31

Headers:
Accept                        : application/json
x-ms-version                  : 2014-06-01

Body:



DEBUG: ============================ HTTP RESPONSE ============================

Status Code:
OK

Headers:
Pragma                        : no-cache
x-ms-request-id               : eec79e98-9254-437a-88b6-12102a821721
Strict-Transport-Security     : max-age=31536000; includeSubDomains
x-ms-ratelimit-remaining-subscription-reads: 14976
x-ms-correlation-request-id   : acdbe807-c4d7-4a5c-b1ee-d75af941cd58
x-ms-routing-request-id       : WESTEUROPE:20161001T215106Z:acdbe807-c4d7-4a5c-b1ee-d75af941cd58
Cache-Control                 : no-cache
Date                          : Sat, 01 Oct 2016 21:51:05 GMT
Server                        : Microsoft-IIS/8.5
X-AspNet-Version              : 4.0.30319
X-Powered-By                  : ASP.NET

Body:
{
  "name": "Friday",
  "id": "/subscriptions/d85bb431-2275-40fd-b880-38a99ba86202/resourceGroups/interdan-carsubscription-westeurope-dev/providers/Microsoft.Automation/aut
omationAccounts/carsub-automation-dev/schedules/Friday",
  "properties": {
    "description": null,
    "startTime": "2016-10-02T10:00:00+02:00",
    "startTimeOffsetMinutes": 0.0,
    "expiryTime": "9999-12-31T23:59:59.9999999+01:00",
    "expiryTimeOffsetMinutes": 0.0,
    "isEnabled": true,
    "nextRun": "2016-10-07T10:00:00+02:00",
    "nextRunOffsetMinutes": 0.0,
    "interval": 1,
    "frequency": "Week",
    "creationTime": "2016-10-01T23:51:05.27+02:00",
    "lastModifiedTime": "2016-10-01T23:51:05.27+02:00",
    "timeZone": "UTC",
    "advancedSchedule": {
      "monthDays": null,
      "monthlyOccurrences": null,
      "weekDays": [
        "Friday"
      ]
    }
  }
}


StartTime              : 02-10-2016 08:00:00 +00:00
ExpiryTime             : 31-12-9999 22:59:59 +00:00
IsEnabled              : True
NextRun                : 07-10-2016 08:00:00 +00:00
Interval               : 1
Frequency              : Week
MonthlyScheduleOptions : Microsoft.Azure.Commands.Automation.Model.MonthlyScheduleOptions
WeeklyScheduleOptions  : Microsoft.Azure.Commands.Automation.Model.WeeklyScheduleOptions
TimeZone               : UTC
ResourceGroupName      : interdan-carsubscription-westeurope-dev
AutomationAccountName  : carsub-automation-dev
Name                   : Friday
CreationTime           : 01-10-2016 23:51:05 +02:00
LastModifiedTime       : 01-10-2016 23:51:05 +02:00
Description            : 

DEBUG: 23:51:06 - NewAzureAutomationSchedule end processing.
DEBUG: 23:51:06 - NewAzureAutomationSchedule end processing.

Script/Steps for Reproduction

Run New-AzureRmAutomationSchedule –Name "Friday" (Get-Date).Date.AddDays(1).AddHours(10) -DaysOfWeek Friday -WeekInterval 1 -TimeZone "Europe/Copenhagen" –AutomationAccountName $automationAccount -ResourceGroupName $resourceGroup

New schedule uses timezone UTC and not Europe/Copenhagen as I would expect. I'm trying to create a schedule that runs every friday at 10 CET.

@cormacpayne
Copy link
Member

@eamonoreilly Hey Eamon, would you mind taking a look at this issue?

@Bpoe
Copy link
Contributor

Bpoe commented Feb 27, 2017

Fixed in AzureAutomationTeam repo. Will be merged in the next PR.

@cormacpayne
Copy link
Member

@pbering @Bpoe this fix can be found in version 4.2.0 of Azure PowerShell.

@bsiegel bsiegel added the Service Attention This issue is responsible by Azure service team. label Sep 26, 2018
@jasonvriends
Copy link

I don't think Microsoft have addressed this issue in Azure Cloud Shell as of yet. I am still getting an error saying that schedules must be 5 minutes ahead when using a Time Zone.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Automation Service Attention This issue is responsible by Azure service team.
Projects
None yet
Development

No branches or pull requests

6 participants