/// <summary> /// The Begin Upgrading Deployment By Slot operation initiates an /// update of role instances in a deployment using the package and /// configuration that you specify. For more information about /// updating role instances, see Update an Azure Service at /// http://msdn.microsoft.com/en-us/library/windowsazure/hh472157.aspx.This /// operation is an asynchronous operation. To determine whether the /// request has been processed, call Get Operation Status. For more /// information on asynchronous operations, see Tracking Asynchronous /// Service Management Requests at /// http://msdn.microsoft.com/en-us/library/windowsazure/ee460791.aspx. /// To perform an automatic update of a deployment, call Upgrade /// Deployment or Change Deployment Configuration with the Mode /// element set to automatic. The update proceeds from that point /// without a need for further input. You can call Get Operation /// Status to determine when the update is complete. To perform a /// manual update, first call Upgrade Deployment with the Mode element /// set to manual. Next, call Walk Upgrade Domain to update each /// domain within the deployment. You should make sure that the /// operation is complete by calling Get Operation Status before /// updating the next domain. Important: An update that adds or /// removes role instances will result in a configuration update to /// all roles that are deployed in the cloud service. Existing role /// instances need to be notified of new role instances so that all /// role instances can communicate together in the cloud service. By /// default, a cloud service is deployed with five update domains, /// which are updated one at a time during an in-place update. For /// information on modifying the number of update domains in the /// service definition file, see the Azure Service Definition Schema /// (.csdef File). To determine the update domain in which a /// particular instance is running in Windows Azure, use the /// UpdateDomain property of the RoleInstance class. See the Azure /// Managed Library Reference at /// http://msdn.microsoft.com/en-us/library/windowsazure/dd179380.aspx /// for more information. (see /// http://msdn.microsoft.com/en-us/library/windowsazure/ee460793.aspx /// for more information) /// </summary> /// <param name='operations'> /// Reference to the /// Microsoft.WindowsAzure.Management.Compute.IDeploymentOperations. /// </param> /// <param name='serviceName'> /// Required. The cloud service to upgrade. /// </param> /// <param name='deploymentSlot'> /// Required. The slot to upgrade. /// </param> /// <param name='parameters'> /// Required. Parameters supplied to the Begin Upgrading Deployment By /// Slot operation. /// </param> /// <returns> /// A standard service response including an HTTP status code and /// request ID. /// </returns> public static Task<AzureOperationResponse> BeginUpgradingBySlotAsync(this IDeploymentOperations operations, string serviceName, DeploymentSlot deploymentSlot, DeploymentUpgradeParameters parameters) { return operations.BeginUpgradingBySlotAsync(serviceName, deploymentSlot, parameters, CancellationToken.None); }
/// <summary> /// The Upgrade Deployment operation initiates an update of role /// instances in a deployment using the package and configuration that /// you specify. For more information about updating role instances, /// see Update a Windows Azure Service. The Upgrade Deployment /// operation is an asynchronous operation. To determine whether the /// request has been processed, call Get Operation Status. For more /// information on asynchronous operations, see Tracking Asynchronous /// Service Management Requests. To perform an automatic update of a /// deployment, call Upgrade Deployment or Change Deployment /// Configuration with the Mode element set to automatic. The update /// proceeds from that point without a need for further input. You can /// call Get Operation Status to determine when the update is /// complete. To perform a manual update, first call Upgrade /// Deployment with the Mode element set to manual. Next, call Walk /// Upgrade Domain to update each domain within the deployment. You /// should make sure that the operation is complete by calling Get /// Operation Status before updating the next domain. Important: An /// update that adds or removes role instances will result in a /// configuration update to all roles that are deployed in the cloud /// service. Existing role instances need to be notified of new role /// instances so that all role instances can communicate together in /// the cloud service. By default, a cloud service is deployed with /// five update domains, which are updated one at a time during an /// in-place update. For information on modifying the number of update /// domains in the service definition file, see Windows Azure Service /// Definition Schema (.csdef File). To determine the update domain /// in which a particular instance is running in Windows Azure, use /// the UpdateDomain property of the RoleInstance class. See the /// Windows Azure Managed Library Reference for more information. /// (see http://msdn.microsoft.com/en-us/library/windowsazure/ee460793.aspx /// for more information) /// </summary> /// <param name='operations'> /// Reference to the /// Microsoft.WindowsAzure.Management.Compute.IDeploymentOperations. /// </param> /// <param name='serviceName'> /// The cloud service to upgrade. /// </param> /// <param name='deploymentSlot'> /// The slot to upgrade. /// </param> /// <param name='parameters'> /// Parameters supplied to the Upgrade Deployment operation. /// </param> /// <returns> /// A standard service response including an HTTP status code and /// request ID. /// </returns> public static OperationResponse BeginUpgradingBySlot(this IDeploymentOperations operations, string serviceName, DeploymentSlot deploymentSlot, DeploymentUpgradeParameters parameters) { try { return operations.BeginUpgradingBySlotAsync(serviceName, deploymentSlot, parameters).Result; } catch (AggregateException ex) { if (ex.InnerExceptions.Count > 1) { throw; } else { throw ex.InnerException; } } }