Requests/Traffic NOT happening between Azure Application Gateway to Container Apps(Frontend: Angular, Backend: dotNET)

Ramesh S 0 Reputation points
2024-07-04T03:28:02.6266667+00:00

Issue: The traffic is not happening between Application Gateway(Public) to the Container Apps.

High level steps follows:

Below are the step that followed:

  1. Created 2 Internal Container Apps Environment from portal (One environment for frontend application and another for backend application) with same VNET, but with different Subnets.

VNET Address: 10.0.0.0/16

Frontend Subnet: 10.0.0.0/23

Backend Subnet: 10.0.4.0/23

  1. Created 2 Container Apps(one for frontend and another for backed application) with Ingress Enabled(Limited to VNET)
  2. Deployed frontend application(Angular) into the Container Apps and container running without any errors and also deployed backend application(dotNET) into another container Apps and the container is running.
  3. Created 2 Private DNS Zones and in the Recordsets added A records referring to their corresponding Container App Environment Static IP. Also created Virtual Network links for bother Private DNS Zones.
  4. Created 1 Application Gateway with 2 backend pools(frontend pool with frontend container app FQDN and backend pool with backend container app FQDN).
  5. Frontend application/container is running with port 80 and Backend application/container is running with port 5000.
  6. Below the frontend code(Angular), where updated baseURL and redirectURL in environment ts as below:

export const environment = {

production: false,

env: 'cloud',

baseURL: 'https://backend.ambitiousdesert-a188a35d.eastus.azurecontainerapps.io/',

postlogout: 'https://login.microsoftonline.com/432a4219-1a46-4b7f-92ce-aae7bc705c26/oauth2/logout',

azureSso: {

  tenantId: 'xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx',

  clientId: 'xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx',

  redirectUrl: 'https://frontend.ambitiousdesert-a188a35d.eastus.azurecontainerapps.io',

  clientSecret: 'xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx',

},

rsaPublicKey: `-----BEGIN PUBLIC KEY-----

`

};

Here,

https://frontend.ambitiousdesert-a188a35d.eastus.azurecontainerapps.io is the frontend container app FQDN.

https://backend.ambitiousdesert-a188a35d.eastus.azurecontainerapps.io/ is the backend containerapp FQDN.

  1. In the backend code, in program.cs , updated frontend container application url as below:

builder.Services.AddCors(options => {

options.AddPolicy(name: MyAllowSpecificOrigins, policy => {

    policy.WithOrigins("http://localhost:4200","http://localhost:8000","http://57.xxx.xxx.80","***https://frontend.ambitiousdesert-a188a35d.eastus.azurecontainerapps.io***");

    policy.AllowAnyHeader();

    policy.AllowAnyMethod();

});

});

  1. Both Container Application URLs are registered/added in Microsoft AD.
  • Validating the Applicaiton

10)Now when access the application using Application Gateway Public IP http://57.xxx.xxx.80 via. browser, it is not loging any page. Basically, it should ask for the microsoft login page.

Below are checks performed:

i) After hitting Application Gateway Public IP http://57.xxx.xxx.80, the request is not reaching to the container app, as i dont see any logs .

ii) Health Probe is giving success(status code: 200)

iii) Backend Health for both Backend Pools is showing Healthy.

Followed link: https://learn.microsoft.com/en-us/azure/container-apps/waf-app-gateway?source=recommendations&tabs=default-domain

Please let me know if i am missing anything.

Thanks in advance.

Azure Application Gateway
Azure Application Gateway
An Azure service that provides a platform-managed, scalable, and highly available application delivery controller as a service.
1,003 questions
Azure Container Apps
Azure Container Apps
An Azure service that provides a general-purpose, serverless container platform.
329 questions
0 comments No comments
{count} votes