using
\nexec azure.resource_graph.resources.resources\n@data__query = \n'{\n \"query\": \"Resources | project id, name, type, location, tags | limit 3\"\n}';\nBut I am getting the error
\nHTTP response error. Status code 400. Detail: { \"httpError\": { \"statusCode\": 400, \"body\": {\"error\":{\"code\":\"BadRequest\",\"details\":[{\"code\":\"RequestDeserializationFailure\",\"message\":\"An error occurred when deserializing the request body: Unexpected character encountered while parsing value: {. Path 'query', line 1, position 10..\"}],\"message\":\"Please provide below info when asking for support: timestamp = 2024-06-02T11:34:03.2700414Z, correlationId = 72de4bdd-bdfa-4113-9d8a-c658019f7c3e.\"}} } }\nI tried multiple variations of the query, provided required parameters as mentioned here. Any help is appreciated.
","upvoteCount":1,"answerCount":11,"acceptedAnswer":{"@type":"Answer","text":"try:
\nstackql >>SELECT * FROM\nstackql >>azure.resource_graph.graph_resources\nstackql >>WHERE data__query =\nstackql >>\"spotresources\nstackql >>| where type == 'microsoft.compute/skuspotevictionrate/location'\nstackql >>| where location in ('westeurope','northeurope')\nstackql >>| project skuName=tostring(sku.name), location, evictionRate=properties.evictionRate\nstackql >>| order by skuName\"\nstackql >>and data__subscriptions = '[\"0123456789\"]';-
|
@jeffreyaven I am trying to run this Azure Resource Graph query from Azure Resource Graph using But I am getting the error I tried multiple variations of the query, provided required parameters as mentioned here. Any help is appreciated. |
Beta Was this translation helpful? Give feedback.
-
|
hey @vwake7, try this: exec azure.resource_graph.resources.resources
@@json='{ "query": "Resources | project id, name, type, location, tags | limit 3" }'; |
Beta Was this translation helpful? Give feedback.
-
|
try the attached test spec @vwake7 note the resource name includes a reserved work used like (try without any new lines first): SELECT * FROM
azure.resource_graph.graph_resources
WHERE data__query = '{ "query": "Resources | project id, name, type, location, tags | limit 3"}';looks like additional params include:
you will need to replace the let me know how this goes resource_graph.zip (youll need to unzip of course) |
Beta Was this translation helpful? Give feedback.
-
|
ok the below works with this updated spec: resource_graph.zip SELECT *
FROM azure.resource_graph.graph_resources
WHERE data__query = 'Resources | project name, type, location, resourceGroup | limit 50';a couple of points to note:
If this works we can merge this into the next release of |
Beta Was this translation helpful? Give feedback.
-
|
might be a week or two in the middle of a new |
Beta Was this translation helpful? Give feedback.
-
|
how is your javascript/typescript @vwake7 if you wanted to build a new |
Beta Was this translation helpful? Give feedback.
-
|
@vwake7 fix has been pushed to the dev registry, test this: export DEV_REG="{ \"url\": \"https://registry-dev.stackql.app/providers\" }"
./stackql --registry="${DEV_REG}" shell |
Beta Was this translation helpful? Give feedback.
-
|
upgrade to the latest |
Beta Was this translation helpful? Give feedback.
-
|
cool, have merged this into the prod registry now, so you can get rid of the |
Beta Was this translation helpful? Give feedback.
-
|
no problems @vwake7 |
Beta Was this translation helpful? Give feedback.
-
|
@jeffreyaven , Is this change applied to pystackql as well? |
Beta Was this translation helpful? Give feedback.
-
|
Hey @vwake7 from pystackql import StackQL
stackql = StackQL()
stackql.upgrade()pull the latest docs using stackql.executeStmt("REGISTRY PULL azure") |
Beta Was this translation helpful? Give feedback.
try: