Search code examples
azureazure-powershellazure-container-apps

Delete Azure Container App Environment using Azure PowerShell


I am using below Azure Powershell command to remove an ACA Environment, but it is not working:

Remove-AzAppServiceEnvironment -Name fer-bpbu-d-cae-euwe-dev -ResourceGroupName "fer-bpbu-d-rsg-conapp"

enter image description here

Unable to find appropriate command to remove this.


Solution

  • To delete Azure Container App Environment using Azure PowerShell, you can run below command:

    Remove-AzContainerAppManagedEnv -EnvName <env_name> -ResourceGroupName <rg_name>
    

    I have one Azure Container App Environment named srienv with 0 container apps like below:

    enter image description here

    To get the above environment details from Azure PowerShell, you can run below command:

    Get-AzContainerAppManagedEnv -EnvName  srienv -ResourceGroupName Sri
    

    Response:

    enter image description here

    To delete the above Container App Environment, I ran below command:

    Get-AzContainerAppManagedEnv -EnvName  srienv -ResourceGroupName Sri | Remove-AzContainerAppManagedEnv
    

    Response:

    enter image description here

    When I checked the same in Portal, Container App Environment named srienv deleted successfully like below:

    enter image description here

    Reference: Remove-AzContainerAppManagedEnv (Az.App) | Microsoft