Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
andrewdmoreno opened this issue Mar 7, 2019 · 1 comment
Open
Assignees

Comments

@andrewdmoreno
Copy link

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
Copy link
Contributor

dkkapur commented Mar 22, 2019

@sridmad can you take a look

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants