Skip to content

dsvoda/Az-Resource-Move-Checker

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Azure Resource Move Checker

This repository contains Python and PowerShell scripts to check whether Azure resources can be moved to a different subscription, resource group, or region.

Table of Contents

Overview

Moving Azure resources from one subscription, resource group, or region to another can be a complex task, and requires careful planning and execution. This repository provides Python and PowerShell scripts that can help you check whether a given set of Azure resources can be moved to a different subscription, resource group, or region.

The Python script fetch_non_movable_resources.py scrapes Microsoft Doc's GitHub page for a list of non-movable resources, including resource group and region move support, and saves it to a JSON file named NonMovableResources.json. The PowerShell script Test-AzResourceMove.ps1 imports this JSON file into an array and checks each resource in the source subscription against this list to determine whether it can be moved or not. The result of the check is then written to a CSV file, which can be used to help plan and execute the resource move.

Prerequisites

  • Azure Subscription
  • Python 3.7 or higher (for Python Script)
  • PowerShell 5.1 or higher (for PowerShell Script)
  • Azure PowerShell module
  • requests, re, json (for Python Script)

Python Script

The fetch_non_movable_resources.py script is written in Python and uses the requests module to scrape Microsoft Doc's GitHub page for a list of non-movable resources, including resource group and region move support. It then saves the list to a JSON file named NonMovableResources.json.

To run the Python script, follow these steps:

  1. Clone this repository to your local machine.
  2. Open a terminal or command prompt and navigate to the root directory of the repository.
  3. Run the following command to install the required Python packages: pip install -r requirements.txt
  4. Run the following command to execute the script: python fetch_non_movable_resources.py
  5. The script will generate a JSON file named NonMovableResources.json in the root directory of the repository.

PowerShell Script

The Test-AzResourceMove.ps1 script is written in PowerShell and uses the Azure PowerShell module to retrieve the list of resources in the source subscription. It then checks each resource against the list of non-movable resources in the NonMovableResources.json file, and writes the result of the check to a CSV file.

To run the PowerShell script, follow these steps:

  1. Clone this repository to your local machine.
  2. Open a PowerShell terminal and navigate to the root directory of the repository.
  3. Run the following command to execute the script: .\Test-AzResourceMove.ps1
  4. The script will generate a CSV file named Test-AzResourceMove.csv in the c:\temp directory.

Contributing

Contributions are welcome! Please feel free to open an issue or submit a pull request with any improvements or bug fixes.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors