/// <summary>
 /// The Create Service principal operation adds a new service principal
 /// in the subscription.
 /// </summary>
 /// <param name='operations'>
 /// Reference to the
 /// Microsoft.WindowsAzure.Management.ISubscriptionServicePrincipalOperations.
 /// </param>
 /// <param name='parameters'>
 /// Required. Parameters supplied to the Create Service Principal
 /// operation.
 /// </param>
 /// <returns>
 /// A standard service response including an HTTP status code and
 /// request ID.
 /// </returns>
 public static AzureOperationResponse Create(this ISubscriptionServicePrincipalOperations operations, SubscriptionServicePrincipalCreateParameters parameters)
 {
     return(Task.Factory.StartNew((object s) =>
     {
         return ((ISubscriptionServicePrincipalOperations)s).CreateAsync(parameters);
     }
                                  , operations, CancellationToken.None, TaskCreationOptions.None, TaskScheduler.Default).Unwrap().GetAwaiter().GetResult());
 }
 /// <summary>
 /// The List Service Principal operation retrieves all the service
 /// principalsexisting in the current subscription.
 /// </summary>
 /// <param name='operations'>
 /// Reference to the
 /// Microsoft.WindowsAzure.Management.ISubscriptionServicePrincipalOperations.
 /// </param>
 /// <returns>
 /// The List Service Principal operation response.
 /// </returns>
 public static SubscriptionServicePrincipalListResponse List(this ISubscriptionServicePrincipalOperations operations)
 {
     return(Task.Factory.StartNew((object s) =>
     {
         return ((ISubscriptionServicePrincipalOperations)s).ListAsync();
     }
                                  , operations, CancellationToken.None, TaskCreationOptions.None, TaskScheduler.Default).Unwrap().GetAwaiter().GetResult());
 }
Пример #3
0
 /// <summary>
 /// Initializes a new instance of the ManagementClient class.
 /// </summary>
 /// <param name='httpClient'>
 /// The Http client
 /// </param>
 public ManagementClient(HttpClient httpClient)
     : base(httpClient)
 {
     this._affinityGroups                     = new AffinityGroupOperations(this);
     this._locations                          = new LocationOperations(this);
     this._managementCertificates             = new ManagementCertificateOperations(this);
     this._roleSizes                          = new RoleSizeOperations(this);
     this._subscriptions                      = new SubscriptionOperations(this);
     this._subscriptionServicePrincipals      = new SubscriptionServicePrincipalOperations(this);
     this._apiVersion                         = "2018-06-01";
     this._longRunningOperationInitialTimeout = -1;
     this._longRunningOperationRetryTimeout   = -1;
     this.HttpClient.Timeout                  = TimeSpan.FromSeconds(300);
 }
 /// <summary>
 /// The Create Service principal operation adds a new service principal
 /// in the subscription.
 /// </summary>
 /// <param name='operations'>
 /// Reference to the
 /// Microsoft.WindowsAzure.Management.ISubscriptionServicePrincipalOperations.
 /// </param>
 /// <param name='parameters'>
 /// Required. Parameters supplied to the Create Service Principal
 /// operation.
 /// </param>
 /// <returns>
 /// A standard service response including an HTTP status code and
 /// request ID.
 /// </returns>
 public static Task <AzureOperationResponse> CreateAsync(this ISubscriptionServicePrincipalOperations operations, SubscriptionServicePrincipalCreateParameters parameters)
 {
     return(operations.CreateAsync(parameters, CancellationToken.None));
 }
 /// <summary>
 /// The List Service Principal operation retrieves all the service
 /// principalsexisting in the current subscription.
 /// </summary>
 /// <param name='operations'>
 /// Reference to the
 /// Microsoft.WindowsAzure.Management.ISubscriptionServicePrincipalOperations.
 /// </param>
 /// <returns>
 /// The List Service Principal operation response.
 /// </returns>
 public static Task <SubscriptionServicePrincipalListResponse> ListAsync(this ISubscriptionServicePrincipalOperations operations)
 {
     return(operations.ListAsync(CancellationToken.None));
 }
 /// <summary>
 /// The Get Service Principal operation retrieves the service
 /// principalwith the specified servicePrincipalId, if it exists in
 /// the subscription.
 /// </summary>
 /// <param name='operations'>
 /// Reference to the
 /// Microsoft.WindowsAzure.Management.ISubscriptionServicePrincipalOperations.
 /// </param>
 /// <param name='servicePrincipalId'>
 /// Required. The Id of the service principal.
 /// </param>
 /// <returns>
 /// The Get Service Principal operation response.
 /// </returns>
 public static Task <SubscriptionServicePrincipalGetResponse> GetAsync(this ISubscriptionServicePrincipalOperations operations, string servicePrincipalId)
 {
     return(operations.GetAsync(servicePrincipalId, CancellationToken.None));
 }
 /// <summary>
 /// The Delete Service Principal operation deletes the service
 /// principalwith specified servicePrincipalId, if it exists in the
 /// subscription.
 /// </summary>
 /// <param name='operations'>
 /// Reference to the
 /// Microsoft.WindowsAzure.Management.ISubscriptionServicePrincipalOperations.
 /// </param>
 /// <param name='servicePrincipalId'>
 /// Required. The Id of the service principal.
 /// </param>
 /// <returns>
 /// A standard service response including an HTTP status code and
 /// request ID.
 /// </returns>
 public static Task <AzureOperationResponse> DeleteAsync(this ISubscriptionServicePrincipalOperations operations, string servicePrincipalId)
 {
     return(operations.DeleteAsync(servicePrincipalId, CancellationToken.None));
 }