Hi Vadim,
To automate the process of allowing ingress for Azure Container Apps from App Services within the same Resource Group, you can choose between Azure Automation and Azure Logic Apps or Functions.
1- Azure Automation:
- Create an Azure Automation account.
- Write a PowerShell or Python script that:
- Retrieves the current IP addresses of your App Services within the Resource Group.
- Updates the ingress rules of your Container Apps with these IP addresses.
- Retrieves the current IP addresses of your App Services within the Resource Group.
- Schedule the script to run at regular intervals to ensure the list is up-to-date.
2- Azure Logic App or Function App:
- Create an Azure Logic App or a Function App.
- Use triggers based on events, such as changes in App Services.
- Implement an action that:
- Fetches the IP addresses of the App Services.
- Applies the ingress rules to the Container Apps using Azure Management API calls.
- Fetches the IP addresses of the App Services.
- Set conditions or parameters as needed to filter for the specific Resource Group and services.
And, well for both solutions, you will need to handle authentication against Azure's management APIs, typically using a service principal. Make sure to follow best practices for security and error handling.
I would recommend to review Azure's documentation for the specific API calls required to fetch IP addresses and update ingress rules.
Kindly if you find the provided information helpful and it resolves your query, please consider accepting the answer. Your feedback is valuable and helps ensure the quality and relevance of the responses.