Giter Club home page Giter Club logo

Comments (4)

StanleyCruvinel avatar StanleyCruvinel commented on May 13, 2024 2

I found a fix, put limit lenght in properties where strlen(properties) < 123000

$Resource = az graph query -q "resources | where subscriptionId == '$SUBID' | where strlen(properties) < 123000 | order by id asc" --skip $Limit --first 1000 --output json --only-show-errors | ConvertFrom-Json

or

az graph query -q "Resources | where strlen(properties.definition.actions) < 120000" -o json

the best way to fix it with project-away
https://docs.microsoft.com/en-us/azure/data-explorer/kql-quick-reference

But Microsoft should fix a bug erro.

az graph query -q "Resources | project-away properties.definition.actions" -o json

from ari.

StanleyCruvinel avatar StanleyCruvinel commented on May 13, 2024

Deep in looking!

I don't know the reason ,in line 302 get empty variable! When run outside the script, extracted json has null id values and got Erro when run ConvertFrom-Json, in [].data has null values in id.

Line 302

$Resource = az graph query -q "resources | where subscriptionId == '$SUBID' | order by id asc" --skip $Limit --first 1000 --output json --only-show-errors | ConvertFrom-Json

PS Version

PS C:\Users\AZ_test> $PSVersionTable

Name                           Value
----                           -----
PSVersion                      5.1.19041.1023
PSEdition                      Desktop
PSCompatibleVersions           {1.0, 2.0, 3.0, 4.0...}
BuildVersion                   10.0.19041.1023
CLRVersion                     4.0.30319.42000
WSManStackVersion              3.0
PSRemotingProtocolVersion      2.3
SerializationVersion           1.1.0.1

Sample to check

az graph query -q "Resources | where name matches regex '[A-Za-z 0-9]' " -o json | ConvertFrom-Json
ConvertFrom-Json : Cannot process argument because the value of argument "name" is not valid. Change the value of the "name" argument and run the operation again.
At line:1 char:84

  • ... where name matches regex '[A-Za-z 0-9]' " -o json | ConvertFrom-Json
    • CategoryInfo : InvalidArgument: (:) [ConvertFrom-Json], PSArgumentException
    • FullyQualifiedErrorId: Argument,Microsoft.PowerShell.Commands.ConvertFromJsonCommand

az graph query -q "Resources | project name, type | where name matches regex '[íãõóêéç]' " -o json | ConvertFrom-Json

@ClaudioMerola
I guess, you should include one kind filter and pick what fields will need, in project parameters , the extraction will be cleaner.

from ari.

ClaudioMerola avatar ClaudioMerola commented on May 13, 2024

Hi,

Yea, very strange behavior.

Thanks for the fix, I included it in the version 1.4.11.

Thanks

from ari.

StanleyCruvinel avatar StanleyCruvinel commented on May 13, 2024

Thanks @ClaudioMerola !
it is not perfect because exclude resources witch big strings in properties.definition.actions, like big Logic Apps. In my company it was 3 from 400!

from ari.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.