570 questions
Advice
0
votes
0
replies
19
views
Enable Defender CSPM (Advanced) and CWPP via Azure Policy
I would like to deploy policy at the management group level to enable Micosoft Defender for Cloud. (I have owner role for all mgmt groups).
I found some these in-built policy definition:
Microsoft ...
0
votes
0
answers
34
views
How to access the Tags collection in Azure APIM policies
I am working on an API, global policy for our Azure APIM.
For API with a specific tag, I need to allow access to users only if they come from some IP Ranges:
I have this:
<inbound>
<base /...
1
vote
0
answers
66
views
Azure Policy - restrict tag naming values, issue with regex for Owner tag
Been struggling to get the regex for a resource tag to function as expected. I have an Owner tag thats one of four tags that I am forcing users to add to any resource in a particular subscription. I ...
0
votes
0
answers
153
views
Add and enforce a tag on all Azure subscriptions with Azure Policy
I'd like to enforce a tag on all subscriptions in my Azure tenant.
key: policy_config_path
value: config/azure/mytenantname.com/subscriptions/<subscription_id>
My requirement is basically apply ...
-1
votes
2
answers
137
views
Azure Policy fails to deploy AzureNetworkWatcherExtension on Windows VMs (Error: "resource not found")
I'm currently working on creating Azure Policies to manage our virtual machines, and one of the policies is not behaving as expected.
The goal of this custom policy is to automatically deploy the ...
0
votes
1
answer
88
views
How can I construct an Azure Policy to audit for either of 2 conditions to be considered compliant?
I made a copy of the built-in policy to audit VMs for ASR and we want to add a condition with a specific tag existing on a VM to be considered "compliant". Meaning, the policy should ...
0
votes
0
answers
65
views
Azure subscription policy need help defining the rules
I need help defining an Azure subscription policy. I want to say VMSS should contain at least one extension of type X OR it should contain extensions A AND B.
But my code below says it should define ...
0
votes
1
answer
74
views
Match elements in an array against elements in another in Azure Policy definition
I am creating a set of Azure Policies to automatically deploy private DNS zone groups in private endpoints. I'm having issues with the if portion of the policy. Previously, I had it written like this:
...
0
votes
1
answer
69
views
Azure Policy - restrict creation of Front Door to Standard SKU Only
I want to limit by Azure Policy the creation of Azure Front Door resources to Standard SKU only.
I'm struggling to figure this policy out. So far I have.
{
"mode": "All",
"...
0
votes
1
answer
138
views
Building a mapping of Azure private link DNS zones and private endpoint groupIds
This question is really about automation. I could easily do this manually in less time then it will take me to wait for an answer, but I think automation might be neater in the long run. I am ...
-1
votes
1
answer
126
views
Azure Policy Require a tag on creation Resource [closed]
I enabled Azure policy [Require a tag on resources], It is validating tags on resource creation as expected but it also evaluating existing resources and showing Non-compliant.
Definition
{
"...
0
votes
1
answer
207
views
Inherit all Tags from resourcegroup
Is there any way that we can inherit all the tags from Resource groups in a single go to it's resources using custom policy without specifying a particular tag?
The policy which I am using is not ...
0
votes
1
answer
132
views
Is there an easier way to create an Azure Policy exemption to allow a single VM SKU?
We currently have an Azure Policy only allowing certain VM SKUs when building new VMs across our tenant. However, we have a new need for a single application team to use a SKU that's not in the ...
0
votes
1
answer
87
views
Azure: How to Duplicate a Policy Definition with Metadata?
I'm trying to duplicate a policy definition along with its metadata in Azure Policy, specifically for NIST SP 800 171. While I can do this through the portal UI, it doesn't duplicate the entire ...
1
vote
1
answer
105
views
Require a tag on secret creation using Azure Policy
Background
I want to make an Azure Policy that requires a tag to be created for every newly created secret.
What I tried so far
I made a new policy by copying the pre-existing Azure Policy Require a ...
0
votes
1
answer
361
views
How to Identify and Suppress "Azure Overprovisioned Identities" Recommendation in Microsoft Defender for Cloud
Recently, I received a recommendation from Microsoft Defender for Cloud regarding "Azure overprovisioned identities should have only the necessary permissions."
I want to suppress this ...
0
votes
3
answers
492
views
Use of Regex in naming convention
I am trying to make an Azure policy that can ensure that my resources keep a certain naming convention, for example "app-{name}-{version}-{zone}-{build}. At the moment the part of my policiy ...
0
votes
0
answers
169
views
Automating Email Notifications for Non-Compliant Resources in Azure Policy
Currently, I have a custom policy that audits Network Security Group (NSG) rules allowing inbound traffic from ANY or Internet (i.e., when the source is ANY or Internet). This policy is assigned at ...
0
votes
1
answer
88
views
Azure built-in policy definitions for SQL virtual machine and Microsoft Defender
Just want to ask an expert opinion to get more information about the following Azure built-in policies if there is a similarity. Also the difference of these policies from each other.
Azure built-in ...
0
votes
1
answer
70
views
How can I accept a tag value with 4 or more digits
I'm currently configuring a Azure Policy that only allows some values to one of my tags.
Here is the policy as of right now:
"policyRule": {
"if": {
"allof":...
0
votes
1
answer
215
views
How to make Visible the Keys/Passwords in CosmosDB connection string - Azure [closed]
I have an issue with the account not being able to view the Keys of connection string in CosmosDB Azure portal. Look below as it is greyed out both read write and read only keys.
Take note that this ...
0
votes
1
answer
182
views
Creating an Azure Policy to automatically give any SQL Managed Instance Databases a LTR instead of manually assigning them to each database
I wanted to create a policy that automatically gives databases a long term retention instead of doing it manually every time so I created this code but for some reason the database does not get any ...
0
votes
1
answer
136
views
Azure policy compliance error Existence condition
I have a policy already in place for installing MDE.Linux agent to all machines as extension, which works fine. We are now in the process of writing another policy to install 'QualysAgentLinux' agent, ...
0
votes
0
answers
277
views
Azure Advisor - Windows servers should be configured to use secure communication protocols - resolving
I have got an azure advisor alert concerning windows virtual machines.
These are standard VM's and they are reporting the following remediation steps. I have carried out the following to remediate the ...
2
votes
1
answer
106
views
Restrict Savings Plan creation outside specified subscription in Mgmt group via Azure Policy
Using Terraform/Azure Policies, I want to restrict the creation of savings plans only to one of our subscriptions i.e Prod. We have more than 10 subscriptions in the tenant in different management ...
0
votes
1
answer
87
views
Deny Savings Plan Creation and Set Up Alerts for Policy Violations in Azure Using Terraform
Using Terraform, I want to deny the creation of savings plans outside of the singular Prod subscription and get an email whenever an attempt is made. We have more than 10 subscriptions in the tenant ...
0
votes
1
answer
155
views
Azure Policy Definition using Powershell
I am trying to create az azure policy definition using powershell and I am receiving the following error.
New-AzPolicyDefinition_CreateExpanded : Failed to parse policy rule: 'Error converting value &...
0
votes
1
answer
114
views
Azure Policy enable specific tag and value on all newly created resources directly (not on resource group itself) with deployifnoexistseffect
I have written the following policy to enable it:
{
"mode": "Indexed",
"policyRule": {
"if": {
"field": "tags[Environment]",
...
0
votes
0
answers
152
views
Create Custom Azure Policy - DeployIfNoExists effect to add specific tag (Environment:Cloud) to newly created resources
We have a requirement to create Azure policy with DeployIfNoExists effect with specific tag for newly created resources. But, I`m kind of stuck, I have tried to rewrite modify built in one policy - no ...
0
votes
1
answer
98
views
Automation - Is there any chance that the Managed Identities in Container Apps being monitored?
Just wondering if possible to monitor the System-assigned or User-assigned activity.
For example if System-assigned manually OFF then email alert will trigger.
By this automation the users will be ...
0
votes
1
answer
308
views
Assign Azure Policy's depending on the subscription tag
I have a question and unfortunately I can't find anything explicit in the MS documentation.
We would like to use the Azure Policies to determine the location of the resource etc. via the subscription ...
0
votes
1
answer
510
views
Create Remediation Task is Greyed Out on Managed Identity ACA built-in policy
Unable to Create Remediation Task on managed identity ACA built in policy.
Although compliance state is working fine on all resources.
Need to remediate non compliant resources. The question is, do ...
0
votes
1
answer
532
views
Azure policy Inherith tags from resource groups
currently we have implemented a modify policy that inherit tags from the resource group to the resources.
The resource group have only 15 tags, I know that the limit is around 50 max
But I am seeing ...
0
votes
1
answer
154
views
Azure Container Apps Service to use Managed built-in policy definition
There is 1 policy definition on Managed Identity in Azure for Container Apps.
Managed Identity should be enabled for Container Apps
Just curious on how this built-in policy apply as i am new with ...
0
votes
1
answer
215
views
Challenges in creating custom policy rule to 'Deny VNet peering between subscriptions of "corp" & "online" management groups in Azure ESLZ'
I have attempted this using address prefix ranges, as we are aware of the address spaces used within the 'corp' VNETs. However, we do not have information on the ranges for the 'online' VNETs. ...
0
votes
1
answer
127
views
Azure Policy to deploy Metrics centrally - how to recognise compliance?
I'm trying to create a policy to deploy metrics, and I've got some of the way there but a bit stuck.
For each public IP in our tenancy (spread across different subscriptions) we want to deploy a ...
0
votes
1
answer
72
views
Get all Azure policy definitions related to customer managed keys using PowerShell or ArmClient
I want to automate the process of listing all policies in Azure that support Customer-managed keys for Azure Storage encryption.
Right now my current approach is to search for them in the Azure portal ...
0
votes
1
answer
120
views
azure policy | To deny the action of removing user assigned identity from a virtual machine is not working
I want to create an azure policy with deny effect to prevent action of removing user assigned identity from a virtual machine is not working but I am not able to do so as we are using terraform to ...
2
votes
1
answer
123
views
Custom Policy for Synapse Analytics Private Endpoint Non-Compliant
I have created custom policy for adding private endpoints on Synapse Analytics Workspace. See Script below.
"policyRule": {
"if": {
"field": "type"...
0
votes
1
answer
184
views
Determine Azure Resource Policy result / effect by querying Azure Graph for state of other resources
At Microsoft Ignite 2023 MS was discussing a soon-to-be-released ability for an Azure Resource Policy definition to be allowed to invoke a Graph API query and use the results as part of the Policy ...
1
vote
1
answer
216
views
Azure CLI Policy Definition Error: 'Could not find member 'mode' on object of type 'PolicyRuleDefinition''
I am trying to create a custom policy in Azure using Azure CLI, but I keep encountering an error related to parsing the policy JSON file. Here are the details:
Command:
az policy definition create --...
0
votes
1
answer
197
views
Azure policy not evaluating compliance correctly, non-compliance reason: Current value must not be equal to the target value
I have created a custom azure policy that checks if Logs and Metrics are enabled for Azure Firewall or not. But it is showing all the Azure firewall instances non-compliant, wherein diagnostics are ...
2
votes
1
answer
180
views
Azure Policy 'DeployIfNotExists' Error: LinkedAuthorizationFailed for Diagnostic Settings
I'm getting a LinkedAuthorizationFailed error when trying to configure diagnostic settings on a Virtual Network Gateway in Azure, and this configuration is being applied through an Azure Policy using ...
0
votes
1
answer
534
views
triggering remediation tasks in Azure policy programatically and getting the display name
I have written a script that will automatically rigger policy remediation, the script below does that.
$InitiativeAssignmentName = "xxxx"
# Loop through each policy and create individual ...
0
votes
1
answer
629
views
Programmatically triggering azure policy remediation
I have got azure policy auto remediation in place, however the process is a manual one where the remediation tasks needs to be manually triggered. I was wondering if there is a way to programmatically ...
0
votes
1
answer
528
views
Azure Policy to prevent overly permissive NSG rules being created?
I want to be able to create a policy within Azure that prevents users from creating inbound NSG allow rules for ports 3389/22 from any/ internet source, either manually or via the options within the ...
0
votes
3
answers
413
views
Terraform and Azure policy interaction issue
We have a deployment of a VNET with bicep which works fine. Moving to Terraform and there are issues with Azure policy.
We have a policy which denies the creation of subnets with no NSGs. This is fine ...
0
votes
1
answer
128
views
What should be put to 'repoOwners' in Managed Identity Federated Credentials policy?
I've set up Workload identity federation. Basically like this:
var applicationRegistrationDisplayName = 'GitHub Actions Application Deployer.'
var githubOIDCProvider = 'https://token.actions....
0
votes
1
answer
338
views
using PS customobject in foreach loop
I am writing one script to exclude all SKUs otherthan recommended in policy for that i have written script where it looks all skus and add to policy waiver list if that sku not the file i am fetching, ...
1
vote
2
answers
438
views
Cannot register SHIR(ADF) on Azure VM
As I mentioned on the title I'm trying to register a SHIR(ADF) on Azure VM but the error has occurred.
The error message and the log were like below.
According to a MS document, the solution like this ...