Skip to content

Implement az staticwebapp environment delete #19433

Closed

Description

@tkhadimullin

Is your feature request related to a problem? Please describe.
At the moment there seems to be no way to clean up Staging Environments via the CLI.

Describe the solution you'd like
Running something like
az staticwebapp environment delete --name swa-name --env environment-name

Describe alternatives you've considered
Deleting from the Portal seems to be supported. But this is much harder to automate. In some cases (see context below) even this may not work and will likely require redeploying the whole resource.

Additional context

  1. I created an SWA resource with Other source of deployment.
  2. Performed a manual deployment using mcr.microsoft.com/appsvc/staticappsclient directly:
docker run -it --rm \
   -e INPUT_AZURE_STATIC_WEB_APPS_API_TOKEN=<my_deployment_token> 
   -e DEPLOYMENT_PROVIDER=DevOps \
   -e GITHUB_WORKSPACE="/working_dir"
   -e IS_PULL_REQUEST=true \
   -e BRANCH="TEST_BRANCH" \
   -e ENVIRONMENT_NAME="TESTENV" \
   -e PULL_REQUEST_TITLE="PR-TITLE" \
   -e INPUT_APP_LOCATION="." \
   -e INPUT_API_LOCATION="./api" \
   -v ${pwd}:/working_dir \
   mcr.microsoft.com/appsvc/staticappsclient:stable \
   ./bin/staticsites/StaticSitesClient upload
  1. Ended up with two environments and no way to delete them except for dropping the whole resource

image-3
image-2

Activity

  1. ghost added
    needs-triageThis is a new issue that needs to be triaged to the appropriate team.
    on Sep 2, 2021
  2. ghost added
    questionThe issue doesn't require a change to the product in order to be resolved. Most issues start as that
    on Sep 2, 2021
  3. ghost added
    customer-reportedIssues that are reported by GitHub users external to the Azure organization.
    on Sep 2, 2021
  4. ghost removed
    needs-triageThis is a new issue that needs to be triaged to the appropriate team.
    on Sep 2, 2021
  5. added
    Service AttentionThis issue is responsible by Azure service team.
    and removed
    questionThe issue doesn't require a change to the product in order to be resolved. Most issues start as that
    on Sep 2, 2021
  6. yonzhan commented on Sep 2, 2021

    @yonzhan
    Collaborator

    route to service team

  7. bmiddha commented on Sep 10, 2021

    @bmiddha
    Contributor

    related pr: #19514

  8. RakeshMohanMSFT commented on Apr 21, 2022

    @RakeshMohanMSFT
    Contributor

    This is implemented. Closing the issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

Service AttentionThis issue is responsible by Azure service team.customer-reportedIssues that are reported by GitHub users external to the Azure organization.staticwebappaz staticwebapp

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions