Azure Custom Policy to Scope VM which is migrated with Azure Migrate and has missing parameters "imagePublisher" "imageOffer" "imageSKU"
This repository contains Azure Policy definitions that can be used to scope virtual machines (VMs) that were not previously scoped by built-in policies. These policies can help ensure that your VMs are properly configured and secured.
To use these policies, you'll need to import them into your Azure Policy environment. Here's how:
- Clone this repository to your local machine.
- Open the Azure Policy portal in your browser.
- Click on "Definitions" in the left-hand menu.
- Click on "Import definition" at the top of the page.
- Select the JSON file for the policy you want to import (located in the "policies" folder of this repository).
- Follow the prompts to complete the import process.
Once you've imported the policies, you can assign them to your VMs by creating an Azure Policy assignment. Here's how:
- Click on "Assignments" in the left-hand menu of the Azure Policy portal.
- Click on "Assign policy" at the top of the page.
- Select the policy you want to assign from the list.
- Follow the prompts to complete the assignment process.
This repository contains the following policies:
policy1.json: This policy scopes VMs to a specific subscription or resource group and remediates the scoped VM's with AMA extensionpolicy2.json: This policy remediation tasks attaches DCR to VMs. (configure DCR prior creating policy2 since it's mandatory to provide DCR resource ID
If you have suggestions for additional policies or improvements to existing policies, please feel free to submit a pull request or open an issue.
This repository is licensed under the MIT License. See the LICENSE file for more information.