Hi Salam ELIAS
You might be using the App Registration Object ID, which could be causing the issue. To resolve it, please use the Enterprise Application Object ID instead, as both are different.
The below code is for reference, here it assigns the Contributor role to a specific Azure AD principal (ObjectID) on a Storage Account resource, ensuring the role assignment only occurs after the storage account is created.
resource "azurerm_role_assignment" "role-assignment" {
depends_on = [ azurerm_storage_account.synapseStoarge-name]
scope = azurerm_storage_account.synapseStoarge-name.id
role_definition_name = "contributor"
principal_id = "ObectID"
}
Please let me know if you face any challenge here, I can help you to resolve this issue further
Provide your valuable Comments.
Please do not forget to "Accept the answer” and “upvote it” wherever the information provided helps you, this can be beneficial to other community members.it would be greatly appreciated and helpful to others.