terraform-provider-azurerm
terraform-provider-azurerm copied to clipboard
Support for an identity attribute in azurerm_container_app
Is there an existing issue for this?
- [X] I have searched the existing issues
Community Note
- Please vote on this issue by adding a :thumbsup: reaction to the original issue to help the community and maintainers prioritize this request
- Please do not leave "+1" or "me too" comments, they generate extra noise for issue followers and do not help prioritize the request
- If you are interested in working on this issue or have submitted a pull request, please leave a comment
Description
Just like, for examle, the azurerm_windows_web_app, it would be nice if the azurerm_container_app resources and data sources exposed the identity block where we can access the principal_id.
New or Affected Resource(s)/Data Source(s)
azurerm_container_app
Potential Terraform Configuration
resource "azurerm_container_app" "example" {
// etcetera
}
resource "azurerm_role_assignment" {
scope = (Azure Container Registry resourceId)
role_definition_name = "Contributor"
principal_id = azurerm_container_app.example.identity.principal_id
}
### References
_No response_
Is there an existing issue for this?
* [x] I have searched the existing issuesCommunity Note
* Please vote on this issue by adding a 👍 [reaction](https://blog.github.com/2016-03-10-add-reactions-to-pull-requests-issues-and-comments/) to the original issue to help the community and maintainers prioritize this request * Please do not leave "+1" or "me too" comments, they generate extra noise for issue followers and do not help prioritize the request * If you are interested in working on this issue or have submitted a pull request, please leave a commentDescription
Just like, for examle, the azurerm_windows_web_app, it would be nice if the
azurerm_container_appresources and data sources exposed theidentityblock where we can access theprincipal_id.New or Affected Resource(s)/Data Source(s)
azurerm_container_app
Potential Terraform Configuration
resource "azurerm_container_app" "example" { // etcetera } resource "azurerm_role_assignment" { scope = (Azure Container Registry resourceId) role_definition_name = "Contributor" principal_id = azurerm_container_app.example.identity.principal_id }### References _No response_
This workaround worked for me:
object_id = azurerm_container_app.my_app_name.identity.0.principal_id
Source: https://medium.com/@vivazmo/azure-container-apps-container-with-terraform-scaling-rules-part-4-2c29bc1c92