Hi,
Not sure if you have explored Bicep codes for deploying the resources in Azure, but I will suggest you to kindly check this article and process to deploy the NSG rules. Or Terraform to deploy it.
manage-route-tables-and-network-security-groups-in-azure-with-bicep-and-azure-devops-pipelines
automate-azure-nsg-rule-changes-terraform-devops-anil-shafeeque
This is the script using Excel and PS.
Add-Multiple-Rules-to-NSG-using-PowerShell-and-CSV
Hope this helps.
JS
==
Please Accept the answer if the information helped you. This will help us and others in the community as well.