Create a policy to disable NICs that don't have a certain tag to be able to attach certain IPs
Mirko Krajcer
0
Reputation points
I want to disable NICs that don't have a tag
my:tag:name
being equal to
123456
to assign PRIVATE IPs from a predefined list
[1.2.3.4, 5.6.7.8, 9.10.11.12, ...]
using a policy or any other Microsoft service. Can you help me?
I've tried doing this and it is not working:
{
"mode": "Indexed",
"policyRule": {
"if": {
"allOf": [
{
"field": "type",
"equals": "Microsoft.Network/networkInterfaces"
},
{
"field": "tags['my:tag:name']",
"equals": "123456"
},
{
"field": "Microsoft.Network/networkInterfaces/ipConfigurations[*].privateIPAddress",
"in": [
"1.2.3.4",
"5.6.7.8",
"9.10.11.12"
]
}
]
},
"then": {
"effect": "deny"
}
},
"parameters": {}
}
Azure Cloud Services
Azure Cloud Services
An Azure platform as a service offer that is used to deploy web and cloud applications.
752 questions
Sign in to answer