Hello @Vedanth Pulipati ,
Thank you for the update.
You can refer the below doc which shows how to associate an IP configuration with an application security group via Azure PowerShell commands:
https://learn.microsoft.com/en-us/powershell/module/az.network/set-aznetworkinterfaceipconfig?view=azps-7.2.0#2--associating-an-ip-configuration-with-an-application-security-group
To do the same via Azure CLI, please use the below command:
az network nic ip-config update -g RGname --nic-name nicname -n ipconfig1 --private-ip-address 10.0.1.4 --subnet subnetname --vnet-name vnetname --application-security-groups asgname
NOTE: You will need to provide the Vnet name, subnet name, nic name & private IP address info for the command to be successful.
Also, only network interfaces that exist in the same virtual network can be added to the same application security group. The application security group must exist in the same location as the network interface.
Refer : https://learn.microsoft.com/en-us/azure/virtual-network/virtual-network-network-interface#add-to-or-remove-from-application-security-groups
Kindly let us know if the above helps or you need further assistance on this issue.
----------------------------------------------------------------------------------------------------------------
Please "Accept the answer" if the information helped you. This will help us and others in the community as well.