ARI icon indicating copy to clipboard operation
ARI copied to clipboard

Multiple Subscriptions Error

Open Arodriguez81 opened this issue 3 years ago • 7 comments

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'."

Arodriguez81 avatar Sep 09 '22 16:09 Arodriguez81

Hello,

Can you check the Azure CLI version you are using?

Thanks

Claudio-Merola avatar Sep 14 '22 14:09 Claudio-Merola

2.40.0, thanks for getting back to me

Arodriguez81 avatar Sep 14 '22 15:09 Arodriguez81

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

cybersh3ll avatar Sep 21 '22 09:09 cybersh3ll

If you specify -suscription subID works fine... the problem is only with multiple subs

cybersh3ll avatar Sep 21 '22 10:09 cybersh3ll

I get it working again using AzureCLI ver. 2.39.0 https://azcliprod.blob.core.windows.net/msi/azure-cli-2.39.0.msi

cybersh3ll avatar Sep 21 '22 11:09 cybersh3ll

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.

Claudio-Merola avatar Sep 22 '22 20:09 Claudio-Merola

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.

Claudio-Merola avatar Sep 27 '22 22:09 Claudio-Merola

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.

ghost avatar Oct 13 '22 01:10 ghost

@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.

klemen-df avatar Jan 12 '23 11:01 klemen-df