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

How to achieve a clean delete of a deployed Function-on-ACA resource #7

Open KaiWalter opened 1 year ago

KaiWalter commented 1 year ago

When deleting a previously deployed resource with

az functionapp delete -n $APP_NAME -g $RESOURCE_GROUP_NAME

or

az group delete -n $RESOURCE_GROUP_NAME

when trying to re-deploy the same resource even after some hours I get this error:

ERROR: deployment failed: error deploying infrastructure: deploying to subscription:

Deployment Error Details:
Conflict: Cannot modify this site because another operation is in progress. Details: Id: f2cdea2b-678b-47e8-a19d-54fbe170af67, OperationName: Create, CreatedTime: 4/27/2023 5:53:37 PM, RequestId: 79a9fa11-63d3-43d3-84b2-83613c1e2238, EntityType: 3
- Cannot modify this site because another operation is in progress. Details: Id: f2cdea2b-678b-47e8-a19d-54fbe170af67, OperationName: Create, CreatedTime: 4/27/2023 5:53:37 PM, RequestId: 79a9fa11-63d3-43d3-84b2-83613c1e2238, EntityType: 3
KaiWalter commented 1 year ago

still get this error when e.g. trying to delete or create a Function App on ACA with Azure CLI after unsuccessfully creating it with Bicep and then deleting it in the portal

Cannot modify this site because another operation is in progress. Details: Id: 4bdd974d-be1d-472d-97de-8a000369116e, OperationName: Delete, CreatedTime: 5/26/2023 6:26:46 PM, RequestId: 00000000-0000-0000-0000-000000000000, EntityType: 2
raorugan commented 1 year ago

@KaiWalter - are you facing such issues in the public preview release version of functions on ACA?

KaiWalter commented 1 year ago

@raorugan - strange; I deleted using the portal and now see 2 versions of my Function Apps

$ az functionapp list -o table
Name                Location      ResourceGroup     DefaultHostName                                                        AppServicePlan            State
------------------  ------------  ----------------  ---------------------------------------------------------------------  ------------------------  -------
acafdistributor     North Europe  kw-messdist-rg    acafdistributor.grayforest-f7d89bee.northeurope.azurecontainerapps.io
acafrecvexp         North Europe  kw-messdist-rg    acafrecvexp.grayforest-f7d89bee.northeurope.azurecontainerapps.io
acafrecvstd         North Europe  kw-messdist-rg    acafrecvstd.grayforest-f7d89bee.northeurope.azurecontainerapps.io
acafdistributor     North Europe  kw-messdist-rg    acafdistributor.grayforest-f7d89bee.northeurope.azurecontainerapps.io
acafrecvexp         North Europe  kw-messdist-rg    acafrecvexp.grayforest-f7d89bee.northeurope.azurecontainerapps.io
acafrecvstd         North Europe  kw-messdist-rg    acafrecvstd.grayforest-f7d89bee.northeurope.azurecontainerapps.io

but at least now I can re-create Funciton on ACA Apps - see #22

when deleting with CLI the Function App are deleted in a clean way - no duplicates

$ az functionapp delete -g kw-messdist-rg -n acafdistributor
$ az functionapp delete -g kw-messdist-rg -n acafrecvexp
$ az functionapp delete -g kw-messdist-rg -n acafrecvstd
chandrod commented 1 year ago

@raorugan - strange; I deleted using the portal and now see 2 versions of my Function Apps

$ az functionapp list -o table
Name                Location      ResourceGroup     DefaultHostName                                                        AppServicePlan            State
------------------  ------------  ----------------  ---------------------------------------------------------------------  ------------------------  -------
acafdistributor     North Europe  kw-messdist-rg    acafdistributor.grayforest-f7d89bee.northeurope.azurecontainerapps.io
acafrecvexp         North Europe  kw-messdist-rg    acafrecvexp.grayforest-f7d89bee.northeurope.azurecontainerapps.io
acafrecvstd         North Europe  kw-messdist-rg    acafrecvstd.grayforest-f7d89bee.northeurope.azurecontainerapps.io
acafdistributor     North Europe  kw-messdist-rg    acafdistributor.grayforest-f7d89bee.northeurope.azurecontainerapps.io
acafrecvexp         North Europe  kw-messdist-rg    acafrecvexp.grayforest-f7d89bee.northeurope.azurecontainerapps.io
acafrecvstd         North Europe  kw-messdist-rg    acafrecvstd.grayforest-f7d89bee.northeurope.azurecontainerapps.io

but at least now I can re-create Funciton on ACA Apps - see #22

when deleting with CLI the Function App are deleted in a clean way - no duplicates

$ az functionapp delete -g kw-messdist-rg -n acafdistributor
$ az functionapp delete -g kw-messdist-rg -n acafrecvexp
$ az functionapp delete -g kw-messdist-rg -n acafrecvstd

For delete issue, we made a fix for public preview which was released on 23rd May. For duplicate functionapps in list : this could be an issue with az functionapp list, which we can check with CLI team. But after deletion, if you go to that resource group in portal, assuming you are not seeing the functionapp.