diff --git a/src/ServiceManagement/Services/Commands.Utilities/Commands.Utilities.csproj b/src/ServiceManagement/Services/Commands.Utilities/Commands.Utilities.csproj index a78596be1433..ffe71e2c63d4 100644 --- a/src/ServiceManagement/Services/Commands.Utilities/Commands.Utilities.csproj +++ b/src/ServiceManagement/Services/Commands.Utilities/Commands.Utilities.csproj @@ -119,7 +119,7 @@ False - ..\..\..\packages\Microsoft.WindowsAzure.Management.Scheduler.3.0.2\lib\net40\Microsoft.WindowsAzure.Management.Scheduler.dll + ..\..\..\packages\Microsoft.WindowsAzure.Management.Scheduler.4.1.0\lib\net40\Microsoft.WindowsAzure.Management.Scheduler.dll ..\..\..\packages\Microsoft.WindowsAzure.Management.ServiceBus.0.15.0-preview\lib\net40\Microsoft.WindowsAzure.Management.ServiceBus.dll @@ -246,6 +246,9 @@ + + + diff --git a/src/ServiceManagement/Services/Commands.Utilities/Microsoft.WindowsAzure.Commands.Scheduler.format.ps1xml b/src/ServiceManagement/Services/Commands.Utilities/Microsoft.WindowsAzure.Commands.Scheduler.format.ps1xml index 9c449126a410..605c97d540b0 100644 --- a/src/ServiceManagement/Services/Commands.Utilities/Microsoft.WindowsAzure.Commands.Scheduler.format.ps1xml +++ b/src/ServiceManagement/Services/Commands.Utilities/Microsoft.WindowsAzure.Commands.Scheduler.format.ps1xml @@ -131,6 +131,416 @@ + + + Microsoft.WindowsAzure.Commands.Utilities.Scheduler.Model.PSHttpJobDetail + + Microsoft.WindowsAzure.Commands.Utilities.Scheduler.Model.PSHttpJobDetail + + + + + + + + JobCollectionName + + + + JobName + + + + Lastrun + + + + Nextrun + + + + StartTime + + + + Status + + + + Recurrence + + + + Failures + + + + Faults + + + + Executions + + + + EndSchedule + + + + Method + + + + Uri + + + + Body + + + + Headers + + + + + + + + Microsoft.WindowsAzure.Commands.Utilities.Scheduler.Model.PSStorageQueueJobDetail + + Microsoft.WindowsAzure.Commands.Utilities.Scheduler.Model.PSStorageQueueJobDetail + + + + + + + + JobCollectionName + + + + JobName + + + + Lastrun + + + + Nextrun + + + + StartTime + + + + Status + + + + Recurrence + + + + Failures + + + + Faults + + + + Executions + + + + EndSchedule + + + + QueueMessage + + + + StorageAccountName + + + + StorageQueueName + + + + SasToken + + + + + + + + Microsoft.WindowsAzure.Commands.Utilities.Scheduler.Model.PSClientCertAuthenticationJobDetail + + Microsoft.WindowsAzure.Commands.Utilities.Scheduler.Model.PSClientCertAuthenticationJobDetail + + + + + + + + JobCollectionName + + + + JobName + + + + Lastrun + + + + Nextrun + + + + StartTime + + + + Status + + + + Recurrence + + + + Failures + + + + Faults + + + + Executions + + + + EndSchedule + + + + Method + + + + Uri + + + + Body + + + + Headers + + + + AuthenticationType + + + + ClientCertSubjectName + + + + ClientCertThumbprint + + + + ClientCertExpiryDate + + + + + + + + Microsoft.WindowsAzure.Commands.Utilities.Scheduler.Model.PSAADOAuthenticationJobDetail + + Microsoft.WindowsAzure.Commands.Utilities.Scheduler.Model.PSAADOAuthenticationJobDetail + + + + + + + + JobCollectionName + + + + JobName + + + + Lastrun + + + + Nextrun + + + + StartTime + + + + Status + + + + Recurrence + + + + Failures + + + + Faults + + + + Executions + + + + EndSchedule + + + + Method + + + + Uri + + + + Body + + + + Headers + + + + AuthenticationType + + + + Tenant + + + + Audience + + + + ClientId + + + + + + + + Microsoft.WindowsAzure.Commands.Utilities.Scheduler.Model.PSBasicAuthenticationJobDetail + + Microsoft.WindowsAzure.Commands.Utilities.Scheduler.Model.PSBasicAuthenticationJobDetail + + + + + + + + JobCollectionName + + + + JobName + + + + Lastrun + + + + Nextrun + + + + StartTime + + + + Status + + + + Recurrence + + + + Failures + + + + Faults + + + + Executions + + + + EndSchedule + + + + Method + + + + Uri + + + + Body + + + + Headers + + + + AuthenticationType + + + + Username + + + + + \ No newline at end of file diff --git a/src/ServiceManagement/Services/Commands.Utilities/Scheduler/Model/PSAADOAuthenticationJobDetail.cs b/src/ServiceManagement/Services/Commands.Utilities/Scheduler/Model/PSAADOAuthenticationJobDetail.cs new file mode 100644 index 000000000000..875f549250ca --- /dev/null +++ b/src/ServiceManagement/Services/Commands.Utilities/Scheduler/Model/PSAADOAuthenticationJobDetail.cs @@ -0,0 +1,32 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Reflection; +using System.Text; +using System.Threading.Tasks; + +namespace Microsoft.WindowsAzure.Commands.Utilities.Scheduler.Model +{ + public class PSAADOAuthenticationJobDetail : PSHttpJobDetail + { + public string AuthenticationType = "AAD OAuthentication"; + + public string Tenant { get; internal set; } + + public string Audience { get; internal set; } + + public string ClientId { get; internal set; } + + public PSAADOAuthenticationJobDetail (PSHttpJobDetail jobDetail) + { + foreach(PropertyInfo prop in jobDetail.GetType().GetProperties()) + { + GetType().GetProperty(prop.Name).SetValue(this, prop.GetValue(jobDetail, null), null); + } + } + + public PSAADOAuthenticationJobDetail() + { + } + } +} diff --git a/src/ServiceManagement/Services/Commands.Utilities/Scheduler/Model/PSBasicAuthenticationJobDetail.cs b/src/ServiceManagement/Services/Commands.Utilities/Scheduler/Model/PSBasicAuthenticationJobDetail.cs new file mode 100644 index 000000000000..0b777c1f3220 --- /dev/null +++ b/src/ServiceManagement/Services/Commands.Utilities/Scheduler/Model/PSBasicAuthenticationJobDetail.cs @@ -0,0 +1,28 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Reflection; +using System.Text; +using System.Threading.Tasks; + +namespace Microsoft.WindowsAzure.Commands.Utilities.Scheduler.Model +{ + public class PSBasicAuthenticationJobDetail : PSHttpJobDetail + { + public string AuthenticationType = "Basic Authentication"; + + public string Username { get; internal set; } + + public PSBasicAuthenticationJobDetail (PSHttpJobDetail jobDetail) + { + foreach(PropertyInfo prop in jobDetail.GetType().GetProperties()) + { + GetType().GetProperty(prop.Name).SetValue(this, prop.GetValue(jobDetail, null), null); + } + } + + public PSBasicAuthenticationJobDetail() + { + } + } +} diff --git a/src/ServiceManagement/Services/Commands.Utilities/Scheduler/Model/PSClientCertAuthenticationJobDetail.cs b/src/ServiceManagement/Services/Commands.Utilities/Scheduler/Model/PSClientCertAuthenticationJobDetail.cs new file mode 100644 index 000000000000..23ff5ea1e321 --- /dev/null +++ b/src/ServiceManagement/Services/Commands.Utilities/Scheduler/Model/PSClientCertAuthenticationJobDetail.cs @@ -0,0 +1,32 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Reflection; +using System.Text; +using System.Threading.Tasks; + +namespace Microsoft.WindowsAzure.Commands.Utilities.Scheduler.Model +{ + public class PSClientCertAuthenticationJobDetail : PSHttpJobDetail + { + public string AuthenticationType = "Client Certificate Authentication"; + + public string ClientCertSubjectName { get; internal set; } + + public string ClientCertThumbprint { get; internal set; } + + public string ClientCertExpiryDate { get; internal set; } + + public PSClientCertAuthenticationJobDetail (PSHttpJobDetail jobDetail) + { + foreach(PropertyInfo prop in jobDetail.GetType().GetProperties()) + { + GetType().GetProperty(prop.Name).SetValue(this, prop.GetValue(jobDetail, null), null); + } + } + + public PSClientCertAuthenticationJobDetail() + { + } + } +} diff --git a/src/ServiceManagement/Services/Commands.Utilities/Scheduler/Model/PSHttpJobDetail.cs b/src/ServiceManagement/Services/Commands.Utilities/Scheduler/Model/PSHttpJobDetail.cs index 0d7f548083f4..d8e68c0a66fb 100644 --- a/src/ServiceManagement/Services/Commands.Utilities/Scheduler/Model/PSHttpJobDetail.cs +++ b/src/ServiceManagement/Services/Commands.Utilities/Scheduler/Model/PSHttpJobDetail.cs @@ -26,11 +26,5 @@ public class PSHttpJobDetail : PSJobDetail public string Body { get; internal set; } public IDictionary Headers { get; internal set; } - - public string ClientCertSubjectName { get; internal set; } - - public string ClientCertThumbprint { get; internal set; } - - public string ClientCertExpiryDate { get; internal set; } } } diff --git a/src/ServiceManagement/Services/Commands.Utilities/Scheduler/SchedulerMgmntClient.cs b/src/ServiceManagement/Services/Commands.Utilities/Scheduler/SchedulerMgmntClient.cs index 5c17f4a926c5..728b6c902af8 100644 --- a/src/ServiceManagement/Services/Commands.Utilities/Scheduler/SchedulerMgmntClient.cs +++ b/src/ServiceManagement/Services/Commands.Utilities/Scheduler/SchedulerMgmntClient.cs @@ -425,11 +425,27 @@ public PSJobDetail GetJobDetail(string jobCollection, string job, string cloudSe jobDetail.Lastrun = j.Status.LastExecutionTime; jobDetail.Nextrun = j.Status.NextExecutionTime; } - if (j.Action.Request.Authentication != null && j.Action.Request.Authentication.Type == HttpAuthenticationType.ClientCertificate) + if (j.Action.Request.Authentication != null) { - jobDetail.ClientCertThumbprint = ((j.Action.Request.Authentication) as ClientCertAuthentication).CertificateThumbprint; - jobDetail.ClientCertExpiryDate = ((j.Action.Request.Authentication) as ClientCertAuthentication).CertificateExpiration.ToString(); - jobDetail.ClientCertSubjectName = ((j.Action.Request.Authentication) as ClientCertAuthentication).CertificateSubjectName; + switch(j.Action.Request.Authentication.Type) + { + case HttpAuthenticationType.ClientCertificate: + PSClientCertAuthenticationJobDetail ClientCertJobDetail = new PSClientCertAuthenticationJobDetail(jobDetail); + ClientCertJobDetail.ClientCertExpiryDate = ((j.Action.Request.Authentication) as ClientCertAuthentication).CertificateExpiration.ToString(); + ClientCertJobDetail.ClientCertSubjectName = ((j.Action.Request.Authentication) as ClientCertAuthentication).CertificateSubjectName; + ClientCertJobDetail.ClientCertThumbprint = ((j.Action.Request.Authentication) as ClientCertAuthentication).CertificateThumbprint; + return ClientCertJobDetail; + case HttpAuthenticationType.ActiveDirectoryOAuth: + PSAADOAuthenticationJobDetail AADOAuthJobDetail = new PSAADOAuthenticationJobDetail(jobDetail); + AADOAuthJobDetail.Audience = ((j.Action.Request.Authentication) as AADOAuthAuthentication).Audience; + AADOAuthJobDetail.ClientId = ((j.Action.Request.Authentication) as AADOAuthAuthentication).ClientId; + AADOAuthJobDetail.Tenant = ((j.Action.Request.Authentication) as AADOAuthAuthentication).Tenant; + return AADOAuthJobDetail; + case HttpAuthenticationType.Basic: + PSBasicAuthenticationJobDetail BasicAuthJobDetail = new PSBasicAuthenticationJobDetail(jobDetail); + BasicAuthJobDetail.Username = ((j.Action.Request.Authentication) as BasicAuthentication).Username; + return BasicAuthJobDetail; + } } return jobDetail; } diff --git a/src/ServiceManagement/Services/Commands.Utilities/packages.config b/src/ServiceManagement/Services/Commands.Utilities/packages.config index bb5d0a608aa4..d8c8a7951892 100644 --- a/src/ServiceManagement/Services/Commands.Utilities/packages.config +++ b/src/ServiceManagement/Services/Commands.Utilities/packages.config @@ -8,15 +8,15 @@ - - + + - + diff --git a/src/ServiceManagement/Services/Commands/Commands.csproj b/src/ServiceManagement/Services/Commands/Commands.csproj index 4a835410fcac..476a8dfec958 100644 --- a/src/ServiceManagement/Services/Commands/Commands.csproj +++ b/src/ServiceManagement/Services/Commands/Commands.csproj @@ -92,13 +92,11 @@ False ..\..\..\lib\Microsoft.Web.Deployment.dll - - False - ..\..\..\packages\Microsoft.WindowsAzure.Common.1.4.0\lib\net45\Microsoft.WindowsAzure.Common.dll + + ..\..\..\packages\Microsoft.WindowsAzure.Common.1.4.1\lib\net45\Microsoft.WindowsAzure.Common.dll - - False - ..\..\..\packages\Microsoft.WindowsAzure.Common.1.4.0\lib\net45\Microsoft.WindowsAzure.Common.NetFramework.dll + + ..\..\..\packages\Microsoft.WindowsAzure.Common.1.4.1\lib\net45\Microsoft.WindowsAzure.Common.NetFramework.dll ..\..\..\packages\Microsoft.WindowsAzure.ConfigurationManager.2.0.3\lib\net40\Microsoft.WindowsAzure.Configuration.dll @@ -119,9 +117,8 @@ False ..\..\..\packages\Microsoft.WindowsAzure.Management.Network.4.0.0\lib\net40\Microsoft.WindowsAzure.Management.Network.dll - - False - ..\..\..\packages\Microsoft.WindowsAzure.Management.Scheduler.3.0.2\lib\net40\Microsoft.WindowsAzure.Management.Scheduler.dll + + ..\..\..\packages\Microsoft.WindowsAzure.Management.Scheduler.4.1.0\lib\net40\Microsoft.WindowsAzure.Management.Scheduler.dll ..\..\..\packages\Microsoft.WindowsAzure.Management.ServiceBus.0.15.0-preview\lib\net40\Microsoft.WindowsAzure.Management.ServiceBus.dll diff --git a/src/ServiceManagement/Services/Commands/packages.config b/src/ServiceManagement/Services/Commands/packages.config index 225068cf1eaa..272a66094c77 100644 --- a/src/ServiceManagement/Services/Commands/packages.config +++ b/src/ServiceManagement/Services/Commands/packages.config @@ -8,14 +8,14 @@ - - + + - +