Get started with Pulumi and Azure
Cleanup & destroy the stack
Our final step is to clean up all of the resources we’ve provisioned. This is as simple as running pulumi destroy:
$ pulumi destroy
> pulumi destroy
Just like pulumi up, pulumi destroy shows you a preview before performing any changes:
Previewing destroy (dev):
Type Name Plan
- pulumi:pulumi:Stack quickstart-dev delete
- ├─ azure-native:storage:Blob index.html delete
- ├─ azure-native:storage:StorageAccountStaticWebsite staticWebsite delete
- ├─ azure-native:storage:StorageAccount sa delete
- └─ azure-native:resources:ResourceGroup resourceGroup delete
Outputs:
- url: "https://sa8dd8af62.z22.web.core.windows.net/"
Resources:
- 5 to delete
Do you want to perform this destroy?
> yes
no
details
As with an update, we can choose no or details; select yes to proceed:
Destroying (dev):
Type Name Status
- pulumi:pulumi:Stack quickstart-dev deleted
- ├─ azure-native:storage:Blob index.html deleted
- ├─ azure-native:storage:StorageAccountStaticWebsite staticWebsite deleted
- ├─ azure-native:storage:StorageAccount sa deleted
- └─ azure-native:resources:ResourceGroup resourceGroup deleted
Outputs:
- url: "https://sa8dd8af62.z22.web.core.windows.net/"
Resources:
- 5 deleted
Duration: 53s
At this stage, your stack still exists, but all cloud resources have been deleted from it.
Remove the stack
The final step is to remove the stack itself. Destroy keeps the stack around so that you still have the full
history of what happened to the stack. Running pulumi stack rm will
delete it entirely, including all history and state snapshots. Be careful, this step cannot be undone!
$ pulumi stack rm
> pulumi stack rm
You’ll be prompted to confirm the removal. Confirm it to successfully complete this tutorial.
Thank you for your feedback!
If you have a question about how to use Pulumi, reach out in Community Slack.
Open an issue on GitHub to report a problem or suggest an improvement.
