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 article helpful? Looking to deploy a new, easy-to-manage, and cost-effective hyperconverged infrastructure?
Alex Bykovskyi
Alex Bykovskyi StarWind Virtual HCI Appliance Product Manager
Well, we can help you with this one! Building a new hyperconverged environment is a breeze with StarWind Virtual HCI Appliance (VHCA). It’s a complete hyperconverged infrastructure solution that combines hypervisor (vSphere, Hyper-V, Proxmox, or our custom version of KVM), software-defined storage (StarWind VSAN), and streamlined management tools. Interested in diving deeper into VHCA’s capabilities and features? Book your StarWind Virtual HCI Appliance demo today!