Azure / azure-functions-on-container-apps

Docs , samples and issues for Azure Functions on Azure Container Apps
MIT License
74 stars 18 forks source link

Creating Function as Azure Container App creates new Resource Group and I cannot control the name of it #81

Closed iulian-popescu closed 2 weeks ago

iulian-popescu commented 1 month ago

A new resourcegroup with the following name is created: {MANAGED_ENV_NAME}FunctionApp{RANDOM_STRING} I would like to be able to control the name of the resourcegroup, so that I can have a policy regarding resource group naming.

Is there a property that I can set on either container app env or functionApp, similar to the infrastructureResourceGroup property from container app env?

v-shenoy commented 1 month ago

Unfortunately, there is no way to control the predetermined name of the managed resource group. Can you share some more details on the policy so that we can potentially provide a workaround?

raorugan commented 1 month ago

@iulian-popescu - this is a system managed resource and not a user controlled/managed resource group. For more details refer here - https://learn.microsoft.com/en-us/azure/azure-functions/functions-container-apps-hosting#managed-resource-groups. However would like to know about your org level naming policy

francovanzyl96 commented 4 weeks ago

Hi @v-shenoy,

I am running into a similar policy issue with regards to the managed resource group.

The policy requires a certain set of tags to be set on all resource groups and it would be ok to exempt this managed resource group, however it is not possible to know the name that the managed resource will get in order to exempt it.

2 possible solutions as I see it, 1. make the managed resource group name configurable, 2. inherit the tags applied to the function app resource on the managed resource group

v-shenoy commented 3 weeks ago

The tags set on the first function app created in the container apps environment are inherited by the managed resource group. You can use this to set tags as per your policy.

francovanzyl96 commented 3 weeks ago

Hi @v-shenoy,

Thanks for the response. I tested this out and this works for me.