0

New to Container Apps.

I'm trying to understand basic connectivity between services in Container Apps.

Lets say I have a web front in .Net Core and an Web API backend (.Net Core).

Without containerization, I could put the base address of my web api in my app settings of the front end to connect to the api, lets say localhost:5000 etc. Using an httpClient to do the call.

If I containerize the front end and api and deploy it to ACA, what would that look like? I think its would be like:

  1. Ingress external for front end
  2. Ingress internal for api
  3. Port 80 for both front end and web api????

Or do I need to setup a base address of some sort to call the web api? Or an environment variable?

I put both ports to 80 but they cannot seem to connect.

Thanks!

1 Answers1

1

In your "Without containerization" example, if your web ui is running on localhost:8080 for example, and your API is running on localhost:5000 then you'll need to enable CORS on the api. In That example, both your web ui and your api are "external". Anything you need to call from a browser is 'external'.

Internal only are for server to server communication, or microservices communicating with each other.

In your example, you'd deploy both as external apps, this will give you 2 domains https://webui.env.region.azurecontainerapps.io and https://api.env.region.azurecontainerapps.io then you will configure a CORS policy on the api app.

see this for more details

ahmelsayed
  • 7,125
  • 3
  • 28
  • 40