/// <summary> /// Updates settings for the specified application. /// </summary> /// <param name='operations'> /// Reference to the /// Microsoft.Azure.Management.Batch.IApplicationOperations. /// </param> /// <param name='resourceGroupName'> /// Required. The name of the resource group that contains the Batch /// account. /// </param> /// <param name='accountName'> /// Required. The name of the Batch account. /// </param> /// <param name='applicationId'> /// Required. The id of the application. /// </param> /// <param name='parameters'> /// Required. The parameters for the request. /// </param> /// <returns> /// A standard service response including an HTTP status code and /// request ID. /// </returns> public static AzureOperationResponse UpdateApplication(this IApplicationOperations operations, string resourceGroupName, string accountName, string applicationId, UpdateApplicationParameters parameters) { return Task.Factory.StartNew((object s) => { return ((IApplicationOperations)s).UpdateApplicationAsync(resourceGroupName, accountName, applicationId, parameters); } , operations, CancellationToken.None, TaskCreationOptions.None, TaskScheduler.Default).Unwrap().GetAwaiter().GetResult(); }
/// <summary> /// Updates settings for the specified application. /// </summary> /// <param name='operations'> /// Reference to the /// Microsoft.Azure.Management.Batch.IApplicationOperations. /// </param> /// <param name='resourceGroupName'> /// Required. The name of the resource group that contains the Batch /// account. /// </param> /// <param name='accountName'> /// Required. The name of the Batch account. /// </param> /// <param name='applicationId'> /// Required. The id of the application. /// </param> /// <param name='parameters'> /// Required. The parameters for the request. /// </param> /// <returns> /// A standard service response including an HTTP status code and /// request ID. /// </returns> public static Task<AzureOperationResponse> UpdateApplicationAsync(this IApplicationOperations operations, string resourceGroupName, string accountName, string applicationId, UpdateApplicationParameters parameters) { return operations.UpdateApplicationAsync(resourceGroupName, accountName, applicationId, parameters, CancellationToken.None); }
public virtual void UpdateApplication( string resourceGroupName, string accountName, string applicationId, bool? allowUpdates, string defaultVersion, string displayName) { if (string.IsNullOrEmpty(resourceGroupName)) { // use resource mgr to see if account exists and then use resource group name to do the actual lookup resourceGroupName = GetGroupForAccount(accountName); } UpdateApplicationParameters uap = new UpdateApplicationParameters(); if (allowUpdates != null) { uap.AllowUpdates = allowUpdates; } if (defaultVersion != null) { uap.DefaultVersion = defaultVersion; } if (displayName != null) { uap.DisplayName = displayName; } BatchManagementClient.Application.UpdateApplication( resourceGroupName, accountName, applicationId, uap); }