'Getting Subscription ID with Resource Group and System ID

Is there a way to programmatically get the subscription ID from Azure with only the Resource Group and System Id?

I have tried using the azure rest api

https://management.azure.com/subscriptions?api-version=2020-01-01

Which returns a single subscription ID but the ID returned doesn’t house the resource group.



Solution 1:[1]

To get the subscription id using resource group use :

Get-AzResourceGroup -Name "ResourcegroupName"

enter image description here

Reference.

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 RithwikBojja-MT