Multiple Subscriptions Error
The script is passing all subscriptions in one line. no as an array. When using one subscription works fine.
ERROR: { "code": "BadRequest", "message": "Please provide below info when asking for support: timestamp = 2022-09-09T16:37:56.8022696Z, correlationId = a056e40d-a55e-474b-acb0-f928ffcacbf7.", "details": [ { "code": "SubscriptionsContainInvalidGuids", "message": "Subscription ids have to be valid GUIDs. Given: 'xxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxx xxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxx xxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxx xxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxx xxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxx xxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxx xxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxx xxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxx xxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxx xxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxx xxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxx xxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxx xxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxx xxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxx xxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxx'."
Hello,
Can you check the Azure CLI version you are using?
Thanks
2.40.0, thanks for getting back to me
Hello, I've the same problem
.\AzureResourceInventory.ps1 $tenant.id Validating Az Cli..
Validating Az Cli Extension..
Validating ImportExcel Module..
PowerShell Desktop Identified.
Azure Cloud Environment: AzureCloud
ERROR: {ventory [4% Complete. ]
"code": "BadRequest",
"message": "Please provide below info when asking for support: timestamp = 2022-09-21T09:40:14.1612947Z, correlationId = xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxxx",
"details": [
{
"code": "SubscriptionsContainInvalidGuids",
"message": "Subscription ids have to be valid GUIDs. Given: 'xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxxx xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxxx'."
}
To include Security Center details in the report, use <-SecurityCenter> parameter.
ERROR: {ventory [Processing ] "code": "BadRequest", "message": "Please provide below info when asking for support: timestamp = 2022-09-21T09:40:15.5993936Z, correlationId = xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxxx.", "details": [ { "code": "SubscriptionsContainInvalidGuids", "message": "Subscription ids have to be valid GUIDs. Given: 'xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx'." } ] Report Complete. Total Runtime was: ,81 Minutes
If you specify -suscription subID works fine... the problem is only with multiple subs
I get it working again using AzureCLI ver. 2.39.0 https://azcliprod.blob.core.windows.net/msi/azure-cli-2.39.0.msi
That's very strange.
I've been messing with that bug for a while now and passing the multiple subs directly in the "az graph query" is working fine. The problem is only when passing it through variables.
Seems very bizarre how a change in the az cli could impact that.
I'll try to work around it somehow in the next days.
Hello
I believe we found a bug in az cli or resource-graph extension. Until they fix it on the az cli side we can't do much I'm afraid.
For now, I removed the parameters -SubscriptionID and -ResourceGroup.
Will keep you posted.
This issue has been automatically marked as stale because it has been marked as requiring author feedback but has not had any activity for 15 days. It will be closed if no further activity occurs within 15 days of this comment.
@Claudio-Merola can we use -SubscriptionID again in the latest versions? I'm using latest versions of both azcli and this script but it always goes through all subscriptions.