Skip to content

add Azure Resource Graph service doc#463

Open
HarshCasper wants to merge 1 commit intoazure-docsfrom
harshmishra/doc-81
Open

add Azure Resource Graph service doc#463
HarshCasper wants to merge 1 commit intoazure-docsfrom
harshmishra/doc-81

Conversation

@HarshCasper
Copy link
Member

Fixes DOC-81

@cloudflare-workers-and-pages
Copy link

Deploying localstack-docs with  Cloudflare Pages  Cloudflare Pages

Latest commit: 0924625
Status: ✅  Deploy successful!
Preview URL: https://0a4241df.localstack-docs.pages.dev
Branch Preview URL: https://harshmishra-doc-81.localstack-docs.pages.dev

View logs

- filter by type: `where type =~ 'Microsoft.Web/sites'`
- filter by type and name: `where type =~ 'Microsoft.Web/sites' and name =~ 'ls-app-doc81'`
- filter by name: `where name =~ 'ls-app-doc81'`
- project only IDs: `where type =~ 'Microsoft.Web/sites' and name =~ 'ls-app-doc81' | project id`

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is it worth pointing out the known limitations here?

For example:

Suggested change
- project only IDs: `where type =~ 'Microsoft.Web/sites' and name =~ 'ls-app-doc81' | project id`
The following queries are all supported:
- filter by type: `where type =~ 'Microsoft.Web/sites'`
- filter by type and name: `where type =~ 'Microsoft.Web/sites' and name =~ 'ls-app-doc81'`
- filter by name: `where name =~ 'ls-app-doc81'`
- project only IDs: `where type =~ 'Microsoft.Web/sites' and name =~ 'ls-app-doc81' | project id`
-
Known limitations: the Localstack for Azure emulator currently does not support the following constructs:
- nested queries
- the `count` keyword
- the `extend` keyword
- the `join` keyword
- the `limit` keyword
- the `mv-expand` keyword
- the `order` keyword
- the `parse` keyword
- the `project-away` keyword
- the `sort` keyword
- the `summarize` keyword
- the `take` keyword
- the `top` keyword
- the `union` keyword

For reference, the full list of operators can be found here:
https://learn.microsoft.com/en-us/azure/governance/resource-graph/concepts/query-language#supported-tabulartop-level-operators

Considering we only support a small subset of this list, it could also be easier to only show the constructs that we do support!

Copy link

@paolosalvatori paolosalvatori left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@HarshCasper / @bblommers, while using az rest to call the Azure Resource Graph is perfectly doable, it's very unusual. Users prefer to install to the az extension resource-graph as follows:

az extension add --name resource-graph

and use it as shown in Quickstart: Run Resource Graph query using Azure CLI

az graph query --graph-query 'Resources | project name, type | limit 5'
az graph query --graph-query 'Resources | where type =~ 'Microsoft.Storage/storageAccounts' | project name, location`
...

I strongly suggest to refactor the article to use az graph. Said that, I would also keep the az rest you and Bert created to show readers an additional method to invoke the Azure Resource Graph API in Azure as well as our emulator.

I realized that the current implementation throws exceptions with some licit queries, so we need to fix the codebase. I'll take this offline with Bert.

cc: @quetzalliwrites

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants