Search
Join the Technical Preview Program
See how NVMe-oF removes iSCSI
bottlenecks in your HCI
The Best Hyperconverged
Infrastructure
(HCI) for Enterprise
ROBO, SMB & Edge
The Best Virtual SAN
for Enterprise ROBO, SMB & Edge

Cleaning Your Azure Subscription Policies

  • October 29, 2020
  • 2 min read
Cloud and Virtualization Architect and Microsoft MVP. Florent specializes in public, private, and hybrid cloud ecosystems. An MCSE in Private Cloud, he provides technical leadership in Cloud and Datacenter Management. Florent delivers high-authority insights on Azure deployments, virtualization strategy, and optimizing enterprise-scale cloud infrastructure.
Cloud and Virtualization Architect and Microsoft MVP. Florent specializes in public, private, and hybrid cloud ecosystems. An MCSE in Private Cloud, he provides technical leadership in Cloud and Datacenter Management. Florent delivers high-authority insights on Azure deployments, virtualization strategy, and optimizing enterprise-scale cloud infrastructure.


wp-image-15280

Because I’m doing a lot of demos with Azure Policies, I searched how to clean, quickly and easily, my subscription of all these policies. For example, I deployed the following policies on a subscription:

 Azure Policy

To start, connect to your Azure account, in PowerShell, and select the subscription that you want to clean:

Connect-AzAccount 
 Select-AzSubscription -SubscriptionId "VotreId"

Execute the following command to clean all of the subscription’s policies:Azure account in PowerShell

$policies = Get-AzPolicyAssignment 
foreach ($policy in $policies){Remove-AzPolicyAssignment -Id $policy.ResourceId}

Admin Windows PowerShell

When the command has finished, your subscription is empty of policies:

Policy Compliance

It is an easy command, but one that will save a lot of time.

Hey! Found Florent’s insights useful? Looking for a cost-effective, high-performance, and easy-to-use hyperconverged platform?
Taras Shved
Taras Shved StarWind HCI Appliance Product Manager
Look no further! StarWind HCI Appliance (HCA) is a plug-and-play solution that combines compute, storage, networking, and virtualization software into a single easy-to-use hyperconverged platform. It's designed to significantly trim your IT costs and save valuable time. Interested in learning more? Book your StarWind HCA demo now to see it in action!