Find file History
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
..
Failed to load latest commit information.
README.md removed Initiative definitions because it's not working Sep 20, 2018
azurepolicy.json correct spelling mistakes Sep 20, 2018
azurepolicy.parameters.json
azurepolicy.rules.json

README.md

Restrict public-facing Storage Accounts

This policy restrict creation of storage accounts that are not connected to a VNet Service Endpoint.

Try on Portal

Deploy to Azure

Try with PowerShell

$definition = New-AzureRmPolicyDefinition -Name "restrict-public-storageAccounts" -DisplayName "Restrict Public Storage Accounts" -description "This policy restrict creation of storage accounts that are not connected to a VNet Service Endpoint" -Policy 'https://raw.githubusercontent.com/tyconsulting/azurepolicy/master/policy-definitions/restrict-public-storageAccount/azurepolicy.rules.json' -Parameter 'https://raw.githubusercontent.com/tyconsulting/azurepolicy/master/policy-definitions/restrict-public-storageAccount/azurepolicy.parameters.json' -Mode All -Metadata '{ "category": "Storage"}'
$definition
$assignment = New-AzureRMPolicyAssignment -Name <assignmentname> -Scope <scope> -PolicyDefinition $definition
$assignment 

Try with CLI


az policy definition create --name 'restrict-public-storageAccounts' --display-name 'Restrict Public Storage Accounts' --description 'This policy restrict creation of storage accounts that are not connected to a VNet Service Endpoint' --rules 'https://raw.githubusercontent.com/tyconsulting/azurepolicy/master/policy-definitions/restrict-public-storageAccount/azurepolicy.rules.json' --params 'https://raw.githubusercontent.com/tyconsulting/azurepolicy/master/policy-definitions/restrict-public-storageAccount/azurepolicy.parameters.json' --mode All

az policy assignment create --name <assignmentname> --scope <scope> --policy "restrict-public-storageAccounts"