Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Azure Service Fabric continuous integration fails in Visual Studio Team Services (was VSO)

I have tried to set up continuous integration to deploy my Azure Service Fabric cluster automatically on git push events in Team Services. I followed the default template for a Team Services Build Definition and a Team Services Release Definition based on this guide:

Set up continuous integration for a Service Fabric application by using Visual Studio Team Services

Here are my settings: Build Definition Release Definition

For the most part everything works for the first deployment. After that it throws the following error:

An application with name 'fabric:/<APP>' already exists, its type is '<APP>Type' and version is '1.0.0.20160812.7'. You must first remove the existing application before a new application can be deployed or provide a new name for the application.

From that it appears as though it is trying to completely redeploy the service instead of just upgrading the service. I have searched through all of the settings and tried creating and recreating the tasks but have not been able to resolve.

Has anyone encountered this before?

like image 908
bashirs Avatar asked Aug 14 '16 18:08

bashirs


People also ask

How do I start a vs2017 build from Azure service fabric?

In Select a template, select the Azure Service Fabric application template and click Apply. In Tasks, enter "Hosted VS2017" as the Agent pool. Under Triggers, enable continuous integration by checking Enable continuous integration. Within Branch filters, the Branch specification defaults to master. Select Save and queue to manually start a build.

How do I integrate service fabric with Visual Studio?

Start Visual Studio and open an existing Service Fabric application project. In Solution Explorer, right-click the application and select Publish.... Choose a target profile within your application project to use for your continuous integration workflow, for example Cloud. Specify the cluster connection endpoint.

How do I Manage my Azure service fabric applications?

Thank you. You can manage your Azure Service Fabric applications and services through Visual Studio. Once you've set up your development environment, you can use Visual Studio to create Service Fabric applications, add services, or package, register, and deploy applications in your local development cluster.

What is build pipeline in Azure service fabric?

An Azure Pipelines build pipeline describes a workflow that is composed of a set of build steps that are executed sequentially. Create a build pipeline that produces a Service Fabric application package, and other artifacts, to deploy to a Service Fabric cluster. Learn more about Azure Pipelines build pipelines.


2 Answers

You need to add or update a publish profile to enable the upgrade mode and use that profile to deploy the Service Fabric after the first deployment is succeed.

To do this quickly, you can right click on your project and select "Publish" from Visual Studio, check "Upgrade the Application" option and click "Configure Upgrade Settings" if needed, and then click “Save Profile" link and commit/push the changes. enter image description here

like image 166
Eddie Chen - MSFT Avatar answered Oct 10 '22 10:10

Eddie Chen - MSFT


Though there is an accepted answer, I would still like to add to this thread. In the approach below we need to edit only the Azure Devops Task. Hopefully this will be useful to others who may encounter the same issue: One simple workaround when you encounter this issue is to change the "Overwrite Behavior" under the Advanced Setting for the build task to "Always". However, care must also be exercised so that if there are services which may already be running - all of them do get upgraded via a rolling upgrade (see second image).

enter image description here

To ensure that rolling upgrade is applied to all the services, in addition to the above, also ensure that the upgrade settings are configured as below:

Upgrade Settings

like image 5
shivesh suman Avatar answered Oct 10 '22 12:10

shivesh suman