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

Unable to deploy with User Assigned Identity more than 1 time (provisioning state 'Failed' without explanations) #56

Closed AlexMasson closed 5 months ago

AlexMasson commented 6 months ago

Which trigger/binding are you using? All of them

Which language are you using? C#

Expected behavior The bicep deployment should work even after the first deployment.

Actual behavior

An error occurred during the second time I deploy the bicep. The resource write operation failed to complete successfully, because it reached terminal provisioning state 'Failed'.

{"status":"Failed","error":{"code":"DeploymentFailed","target":"/subscriptions/***/resourceGroups/amn-test/providers/Microsoft.Resources/deployments/function-aca","message":"At least one resource deployment operation failed. Please list deployment operations for details. Please see https://aka.ms/arm-deployment-operations for usage details.","details":[{"code":"ResourceDeploymentFailure","target":"/subscriptions/***/resourceGroups/amn-test/providers/Microsoft.Web/sites/amntest-funcapp","message":"The resource write operation failed to complete successfully, because it reached terminal provisioning state 'Failed'.","details":[{"message":"Operation Failed. Please try again "}]}]}}

To Reproduce function-aca.txt (change extension to .bicep).

  1. Deploy a first time the given bicep file function-aca.bicep.
  2. Check that the ressources exists on Azure Portal, with User Assigned Identity enabled.
  3. Deploy it a second time.

Logs {"status":"Failed","error":{"code":"DeploymentFailed","target":"/subscriptions//resourceGroups/amn-test/providers/Microsoft.Resources/deployments/function-aca","message":"At least one resource deployment operation failed. Please list deployment operations for details. Please see https://aka.ms/arm-deployment-operations for usage details.","details":[{"code":"ResourceDeploymentFailure","target":"/subscriptions//resourceGroups/amn-test/providers/Microsoft.Web/sites/amntest-funcapp","message":"The resource write operation failed to complete successfully, because it reached terminal provisioning state 'Failed'.","details":[{"message":"Operation Failed. Please try again "}]}]}}

Additional context I use the samples given here without success : https://github.com/Azure/azure-functions-on-container-apps/blob/main/samples/Biceptemplates/MI_VNET_sample/README.md.

👍 If I remove the User Assigned Identity completely, the deployment works. But.. I need this one !

chandrod commented 6 months ago

Hi @AlexMasson , we made changes for the fix and deployed the changes as well. I verified by using the bicep file you provided in this issue. The deployment went through successfully. Could you please verify? Thanks.

AlexMasson commented 5 months ago

Hi @chandrod , this is now working, thanks a lot !