Search code examples
c#.netazureazure-devopsazure-service-fabric

service fabric unable to see container template in Visual Studio


I am following instruction given in following link : https://learn.microsoft.com/en-us/azure/service-fabric/service-fabric-get-started-containers#create-the-containerized-service-in-visual-studio

The Service Fabric SDK and tools provide a service template to help you create a containerized application.

  1. Start Visual Studio. Select File > New > Project.
  2. Select Service Fabric application, name it "MyFirstContainer", and click OK.
  3. Select Container from the list of service templates.
  4. In Image Name enter "myregistry.azurecr.io/samples/helloworldapp", the image you pushed to your container repository. Give your service a name, and click OK.

When I open visual studio community edition, I do not see any such template. This is what I see:

enter image description here

I have already installed Azure development components:

enter image description here

How can I deploy container image on azure service fabric cluster?


Solution

  • I don't think that you perform the steps explained in the instructions. On you first screenshot it seems that you have selected Service Fabric Application on the left but that is just the most recent template that you have used.

    On the right you then search for container but that will find all templates that contain the word container. You want to find the Service Fabric Application template (which happens to be the most recent template in your screenshot).

    The container part is something you select to add a new service to your Service Fabric Application so it's not a Visual Studio project template but a Service Fabric service template. Here are som screenshots from my Visual Studio 2019 16.4.4:

    Select the Service Fabric Application template and press Next:

    Screenshot of the Create a new project dialog box

    Name your project etc. and press Create:

    Screenshot of the dialog box used to create a new Service Fabric project

    Select Container in the Hosted Containers and Applications section of the service templates to add a service to your project and finalize the project creation process.

    Screenshot of the dialog box used to create a new Service Fabric service