Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

scanning diagnostic settings results in a fatal error #194

Closed
kewalaka opened this issue Jan 30, 2024 · 3 comments
Closed

scanning diagnostic settings results in a fatal error #194

kewalaka opened this issue Jan 30, 2024 · 3 comments
Assignees
Labels
bug Something isn't working

Comments

@kewalaka
Copy link

kewalaka commented Jan 30, 2024

Expected Behavior

Scans complete successfully

Actual Behavior

I ran the following, and there was an issue with the first diagnostic settings, as reported below:

PS C:\tools\azqr>  azqr scan -o 20240131.results --debug
2024-01-31T08:57:03+13:00 DBG Debug logging enabled
2024-01-31T08:57:08+13:00 INF Scanning subscriptions/...fa0f7c1 for Private Endpoints
2024-01-31T08:57:09+13:00 INF Scanning subscriptions/...fa0f7c1 for Resource Ids
2024-01-31T08:57:11+13:00 INF Scanning subscriptions/...fa0f7c1 for Diagnostic Settings
2024-01-31T08:57:12+13:00 FTL Failed to get diagnostic settings error="unmarshalling type *scanners.ArmBatchResponse: unmarshalling type *armmonitor.DiagnosticSettingsResourceCollection: json: cannot unmarshal string into Go value of type map[string]json.RawMessage" 

I can't find the debug log to share - no output file has been created.

The diagnostics settings are set by policy, using the EPAC framework.

Steps to Reproduce the Problem

Not sure of specifics - but consistently happens on the first diagnostic setting. Happy to be given more guidance to try.

@cmendible
Copy link
Member

cmendible commented Jan 31, 2024

Hi @kewalaka,

can you please set the AZURE_SDK_GO_LOGGING environment variable to all, run the tool with the --debug flag and then share the console output with us (mask any values you don't want to share).

Also, is the credential Subscription Reader?

@cmendible cmendible added the bug Something isn't working label Jan 31, 2024
@cmendible cmendible self-assigned this Jan 31, 2024
@cmendible
Copy link
Member

@kewalaka can you please provide more information? I'm not able to reproduce this issue.

@cmendible
Copy link
Member

The error seem to happen when Azure CLI is used as the authentication method and the user or service principal has access to one or more Tenant.

To avoid this problems run:

az logout
az account clear
az login -t <tenand>

and the scan as needed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants