Skip to content
This repository has been archived by the owner on Jul 8, 2024. It is now read-only.

AaronSaikovski/pyazvalidatemoveresources

Repository files navigation

Python - Validate Move Azure Resources

** Please note that this project has been deprecated and no longer supported. It has been replaced by ARMV **

Validates a source Azure resource group and all child resources to check for moveability support into a target resource group within a target subscription.

Build Status Coverage Status Licence

Python - Validate Move Azure Resources

Version History:

  • 1.0 - Initial version to use environment variables
  • 2.0 - Now uses command line arguments and better error handling, other bug fixes.
  • 3.0 - Now uses modules and has limited unit testing.
  • 3.0.2 - New makefile and updated github action.
  • 3.0.3 - Updated to use poetry - see makefile

Description

This script takes a Source SubscriptionID and Source ResourceGroup as parameters, analyzes the subscription/resource group. and gathers a list of resource Ids and resources that can and cannot be moved to a Target SubscriptionID and Target ResourceGroup and reports accordingly.

NOTE: This script just outputs findings and doesn't move any resources.

Software Requirements

Azure Setup

You must be logged into the Azure from the command line for this program to work. This program will use the CLIs current logged in identity.
Ensure you have run the following:

az login

# Where "XXXX-XXXX-XXXX-XXXX" is your subscriptionID
az account set --subscription "XXXX-XXXX-XXXX-XXXX"

Python Environment Setup:

Using the Makefile will setup the full virtual environment using Poetry for you

To setup the dependencies, run: make install

This will setup the environment with the dependencies from the pyproject.toml file.

Usage:

poetry run python main.py --SourceSubscriptionId "XXXX-XXXX-XXXX-XXXX" --SourceResourceGroup "SourceRSG" --TargetSubscriptionId "XXXX-XXXX-XXXX-XXXX" --TargetResourceGroup "TargetRSG"

Known issues and limitations

  • Currently this program only supports subscriptions and resource groups under the same single tenant.
  • No know bugs or known issues - if found, please report here