Azure / service-fabric-mesh-preview

Service Fabric Mesh is the Service Fabric's serverless offering to enable developers to deploy containerized applications without managing infrastructure. Service Fabric Mesh , aka project “SeaBreeze” is currently available in private preview. This repository will be used for tracking bugs/feature requests as GitHub issues and for maintaining the latest documentation.
MIT License
83 stars 10 forks source link

Unable to run mesh asp net core application using https in Azure #353

Open andrewdmoreno opened 5 years ago

andrewdmoreno commented 5 years ago

There is a related issue on docs repo MicrosoftDocs/azure-docs#25285 where configuring https with mesh is discussed. That issue has since been closed and I myself was at one point able to successfully deploy an asp net core api with https enabled. Since that time, subsequent deploys of my application to Azure stopped working with seemingly no changes that I could find. To rule out anything to do with that specific application I have been attempting to get the out of box Mesh asp net core api template in Visual Studio working with https as a sample, but have been unable to get it working properly when deploying to Azure.

To assist with triage I have created a Sample Repo that can used to run locally. Locally, building and running this via linux container functions as expected. Browsing to https://localhost/api/values returns the output from the controller and expected certificate is displayed. The only changes that were made to the generated code are as follows:

Configure kestrel listener for https

        public static IWebHostBuilder CreateWebHostBuilder(string[] args) =>
            WebHost.CreateDefaultBuilder(args)
                .UseApplicationInsights()
                .UseStartup<Startup>()
                .UseKestrel(options =>
                {
                    options.Listen(IPAddress.Any, 443,
                        listenOptions => { listenOptions.UseHttps(GetCertificate()); });
                });

       ......

Updating the mesh gateway.yaml file and ports in parameters file, listener settings, docker file, etc., to 443

gateway:
  schemaVersion: 1.0.0-preview2
  name: HttpsMeshAppGateway
  properties:
    description: HttpsMeshApp Gateway Resource
    sourceNetwork:
      name: Open
    destinationNetwork:
      name: HttpsMeshAppNetwork
    tcp:
      - name: Web1TCP
        port: "[parameters('Web1_ingressport')]"
        destination:
          applicationName: HttpsMeshApp
          serviceName: Web1
          endpointName: Web1Listener

parameters.yaml

## Parameters file ##
Web1_cpu: 1
Web1_ingressport: 443

When I deploy the arm template to Azure and obtain the public ip address, all attempts to browse to https://[public.ip.address]/api/values fail. I can only imagine that the gateway is not forwarding the traffic to the backend service. The arm template has also been included in the repo in case there is an issue with it.

image

Would definitely be beneficial to have a working prototype of an api with https. If anyone sees any settings or steps that are incorrect would appreciate the help.

dkkapur commented 5 years ago

@sridmad can you take a look

@mattrowmsft as well to confirm that there have not been recent deployments affecting this experience.