GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — feat(credentials): Microsoft app credentials for Power BI and Azure Data Explorer, with national clouds by waleedlatif1 · Pull Request #9931 · simstudioai/sim

Conversation

@waleedlatif1

@waleedlatif1 waleedlatif1 commented Nov 12, 2026

Copy link
Copy Markdown
Collaborator

Summary

  • Microsoft app credentials now mint tokens per resource. The cache key is credential + stored-secret version + audience, and one table maps each service to its audience. Graph services share one token; every other resource gets its own. The secret is decrypted only on a cache miss, inside the shared mint, so a cached token costs one row read.
  • New optional cloud on the credential: Global (default), US Gov GCC High, US Gov DoD, or China (21Vianet). The Entra endpoint, the certificate assertion audience and the save-time Graph check follow the cloud. China signs in at login.partner.microsoftonline.cn, the endpoint the Entra national-cloud reference lists and the one legacy inline ADX sign-ins already use. Graph, Power BI and Dataverse services refuse a national-cloud credential with a new cloud_mismatch code, whose message names the cloud mismatch instead of asking the user to reconnect. A reconnect opens on the credential's stored cloud. The reconnect reads the stored mode and cloud through one per-provider map, with no provider-specific branch.
  • Power BI accepts a Microsoft app credential next to its delegated connection. Token audience: https://analysis.windows.net/powerbi/api/.default. Global cloud only.
  • New azure_data_explorer_v2, a credential-only block. The token audience is the allowlisted cluster (or resource-override) host. The credential's cloud must match the cluster's cloud, so a national-cloud cluster needs a matching national-cloud credential. The operation re-checks the credential against the run's workspace or organization, as the AWS operation path does. The legacy block keeps its inline fields and is marked legacy.

Not in this PR (design memos):

  • Azure DevOps service principal. The service-principal guide (https://learn.microsoft.com/en-us/azure/devops/integrate/get-started/authentication/service-principal-managed-identity) uses the token scope https://app.vssps.visualstudio.com/.default, sent as Bearer. Azure DevOps ignores Entra app permissions. The service principal must be added to each organization as a user, with Basic or higher access, and it takes a paid license. Two things block it:

    • Each service holds one serviceAccountProviderId (lib/oauth/types.ts), and Azure DevOps already uses it for its PAT credential. Offering an app credential needs either a list-valued provider-id field across pickers, the resolver and the block contract, or a new provider id.
    • Every Azure DevOps tool hard-codes a Basic PAT header. Switching to Bearer means passing the credential kind through credentialParams in every tool, which changes their tool schemas.

    It needs a product decision on the credential model and a live proof.

  • Azure OpenAI via Entra. The Entra guide (https://learn.microsoft.com/en-us/azure/ai-foundry/openai/how-to/managed-identity) uses the data-plane scope https://ai.azure.com/.default. It requires a custom-subdomain endpoint and the Cognitive Services OpenAI User role. The provider takes an inline API key and a user-supplied endpoint, and model providers have no saved-credential path yet. It needs that model-credential pattern, an endpoint host allowlist (*.openai.azure.com) and a client cache keyed by credential and expiry.

  • Planner/Outlook app-only. Graph's /me requires a signed-in user, and application permissions are not supported there (https://learn.microsoft.com/en-us/graph/api/user-get?view=graph-rest-1.0). These tools call /me. App-only would need a new user or mailbox parameter that switches to /users/{id}, and tenant-wide mailbox scope is a product and security decision.

Product update (if relevant)

  • Admins can run Power BI and Azure Data Explorer as an Entra app registration (client secret, certificate, or keyless federated credential), including in US Government and China clouds for ADX. Setup steps are in the Microsoft app credentials and per-integration docs.

Type of Change

  • Bug fix
  • New feature
  • Breaking change
  • Documentation
  • Other: ___________

Testing

  • Unit:
    • Per-audience cache separation; a cached token is served without decrypting; the ADX cluster key includes the resource's clouds.
    • National-cloud endpoints and assertion audience; cloud_mismatch refusals for Graph, Dataverse, Power BI and ADX.
    • The reconnect returns the stored mode and cloud.
    • ADX operation tests: runs with no inline secret, ignores inline sign-in fields, takes the audience from the override host, refuses a cluster in another cloud (400) before any request, refuses a credential from another workspace before decrypting, refuses a non-allowlisted host before decrypting, does not echo Entra's error detail, keeps the legacy inline path.
  • Integration (real Postgres): Power BI run and selector with a persisted app credential.
  • Generated artifacts, block-registry check (saved-credential contract, sunset replacedBy) and targeted audits pass locally. Full type-check and audits are left to CI.
  • Please review:
    • Backward compatibility: global credentials store no cloud field, old workers fail closed on a national-cloud secret, and legacy inline ADX authorities are unchanged.
    • ADX audience derivation and owner-scope re-check in requestAzureDataExplorerAsApp.

Checklist

  • Code follows project style guidelines
  • Self-reviewed my changes
  • Tests added/updated and passing
  • No new warnings introduced
  • I confirm that I have read and agree to the terms outlined in the Contributor License Agreement (CLA)

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

greptile-apps[bot] reacted with thumbs up emoji
All reactions
  • 👍 1 reaction
@vercel

vercel Bot commented Nov 12, 2026 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
docs Ready Ready Preview Nov 12, 2026 12:44pm UTC

Request Review

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

cubic-dev-ai[bot]
cubic-dev-ai Bot reviewed Nov 12, 2026
View reviewed changes

@cubic-dev-ai cubic-dev-ai Bot left a comment •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
Contributor

There was a problem hiding this comment.

Choose a reason for hiding this comment

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

All reported issues were addressed across 51 files

Turn on auto-fix | Re-trigger cubic

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
Comment thread ...aceId]/integrations/components/connect-service-account-modal/microsoft-app-account-modal.tsx Resolved

Uh oh!

There was an error while loading. Please reload this page.

Comment thread apps/sim/blocks/blocks/powerbi.ts Resolved

Uh oh!

There was an error while loading. Please reload this page.

Comment thread apps/sim/lib/internal/azure-data-explorer/schema.ts Resolved

Uh oh!

There was an error while loading. Please reload this page.

@vercel
vercel Bot deployed to Preview November 12, 2026 11:55
View deployment
@greptile-apps

greptile-apps Bot commented Nov 12, 2026 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
Contributor

RetriggerView in GreptileConfidence Score: 5/5

[High impact] The PR appears safe to merge; no new actionable issues were found.

Summary

Adds Microsoft app credentials for Power BI and a new saved-credential Azure Data Explorer block.

  • Microsoft app credentials now support national clouds and Power BI tokens.
  • Azure Data Explorer now runs from a saved app credential and matches its token to the cluster.

Diagram

%%{init: {'theme': 'neutral'}}%%
flowchart TD
  A[Selected Microsoft app credential] --> B[Executor authorizes credential use]
  B --> C{Service}
  C -->|Power BI or Graph| D[Choose fixed audience]
  C -->|Azure Data Explorer| E[Check cluster host and credential owner]
  E --> F[Choose cluster audience and allowed clouds]
  D --> G[Read token cache]
  F --> G
  G -->|Miss| H[Decrypt secret and check cloud]
  H --> I[Mint token at cloud endpoint]
  I --> J[Call service]
  G -->|Hit| J
Loading

Reviews (2) · Last reviewed commit: "fix(credentials): resolve a reconnect's ..." · Reviewed by Greptile

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

greptile-apps[bot]
greptile-apps Bot reviewed Nov 12, 2026
View reviewed changes
Comment thread ...aceId]/integrations/components/connect-service-account-modal/microsoft-app-account-modal.tsx Resolved

Uh oh!

There was an error while loading. Please reload this page.

waleedlatif1 added 7 commits November 12, 2026 04:20
@waleedlatif1
feat(credentials): resource-aware Microsoft app tokens and an optiona…
be27910
…l national cloud

Microsoft app credentials resolve each service's token audience from one
table and cache minted tokens per credential, stored-secret version, and
audience, so services that need a different resource no longer share a
Graph-or-Dataverse key. A credential can name a national cloud (US
Government GCC High or DoD, or China); its Entra endpoint, certificate
assertion audience, and save-time Graph check follow that cloud. Global
credentials store no cloud field, so existing secrets and older workers
read them exactly as before, and Graph and Dataverse services refuse a
national-cloud credential because their tools call the global cloud.
@waleedlatif1
feat(powerbi): run Power BI as a Microsoft app credential
8367fc0
The Power BI service offers the Microsoft app credential beside its
delegated OAuth connection. A run or selector with an app credential gets
an app-only token for the Power BI REST API audience
(https://analysis.windows.net/powerbi/api/.default), cached apart from the
credential's Graph token; national-cloud credentials are refused because
the tools call api.powerbi.com. Delegated connections and every tool's
params are unchanged. The Power BI integration suite proves a run and a
selector end to end with a persisted app credential.
@waleedlatif1
feat(azure-data-explorer): run as a saved Microsoft app credential
2332725
Adds azure_data_explorer_v2, a credential-only successor whose picker
selects a Microsoft app credential (client secret, certificate, or keyless
federated credential) in place of the inline tenant ID, client ID, and
client secret. The executor authorizes the credential and the operation
mints a token for the cluster each call names: the audience is the
allowlisted cluster (or resource override) host as https://<host>, and the
credential's cloud must be one that host belongs to, so a US Government or
China cluster takes a matching national-cloud credential. Inline secrets
are never read on that path.

The legacy block keeps its inline fields and behavior and is marked legacy
with azure_data_explorer_v2 as its replacement. The connect dialog gains a
Cloud choice; a global credential's payload and stored secret are
unchanged.
@waleedlatif1
fix(credentials): decrypt Microsoft app secrets only on a token miss …
0f6daeb
…and scope the ADX operation

- Token cache key is named before decrypting, so a cached token skips the
  decrypt and parse; Azure Data Explorer authorization no longer decrypts,
  and its cluster key includes the resource's clouds.
- The ADX operation re-checks the credential against the run's workspace or
  organization, as the AWS operation path does.
- A credential in the wrong Microsoft cloud is refused as cloud_mismatch with
  its own message instead of "reconnect the credential"; ADX tool errors come
  from the refusal code, not log detail.
- The operation-minted service comes from the shared ADX credential config.
- Reconnect reopens a national-cloud credential on its stored cloud.
- China signs in at login.partner.microsoftonline.cn (Entra national-cloud
  reference) for both ADX auth paths; Kusto authorities derive from
  MICROSOFT_CLOUDS.
- Drop the one-line ADX operations passthrough; refresh TSDoc and the Power BI
  description.
@waleedlatif1
fix(credentials): refuse a national-cloud Microsoft app credential fo…
98d223f
…r Dataverse as a cloud mismatch
@waleedlatif1
refactor(credentials): read a reconnect's stored mode and cloud throu…
f06a074
…gh one per-provider map
@waleedlatif1
fix(credentials): resolve a reconnect's cloud before saving and refus…
5e55a34
…e a cross-cloud ADX resource

A Microsoft app reconnect now waits for the stored cloud, or asks for one when it cannot be
read (an organization credential or a failed lookup), instead of saving as global. The ADX
schema refuses a resource override whose cloud differs from the cluster's before any
credential is decrypted, and the Power BI description says app credentials run in the
global cloud only.
@waleedlatif1
waleedlatif1 force-pushed the feat/microsoft-app-resources branch from c7a71c9 to 5e55a34 Compare November 12, 2026 12:39
@waleedlatif1

waleedlatif1 commented Nov 12, 2026

Copy link
Copy Markdown
Collaborator Author

@greptile

greptile-apps[bot] reacted with thumbs up emoji
All reactions
  • 👍 1 reaction

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@waleedlatif1

waleedlatif1 commented Nov 12, 2026

Copy link
Copy Markdown
Collaborator Author

@cubic-dev-ai review this PR

cubic-dev-ai[bot] reacted with eyes emoji
All reactions
  • 👀 1 reaction

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@cubic-dev-ai

cubic-dev-ai Bot commented Nov 12, 2026

Copy link
Copy Markdown
Contributor

@cubic-dev-ai review this PR

@waleedlatif1 I have started the AI code review. It will take a few minutes to complete.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

cubic-dev-ai[bot]
cubic-dev-ai Bot reviewed Nov 12, 2026
View reviewed changes

@cubic-dev-ai cubic-dev-ai Bot left a comment

Copy link
Copy Markdown
Contributor

There was a problem hiding this comment.

Choose a reason for hiding this comment

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

1 issue found across 51 files

Confidence score: 3/5

  • In apps/sim/lib/oauth/oauth.ts, Power BI is registered for Global only, but its credential modal offers all four clouds, so users can select an unsupported cloud. Filter the options for Power BI or register the additional clouds server-side.
Prompt for AI agents (unresolved issues)

Check if these issues are valid — if so, understand the root cause of each and fix them. When an issue isn't valid or won't be fixed in this PR, reply in its thread with the reason and then resolve the thread. If appropriate, use sub-agents to investigate and fix each issue separately.


<file name="apps/sim/lib/oauth/oauth.ts">

<violation number="1" location="apps/sim/lib/oauth/oauth.ts:656">
P2: Power BI is registered as Global-only on the server, but this change exposes the app credential modal for it, and that modal offers all four clouds. Filter the cloud options per service, or limit Power BI to the Global cloud, so a national-cloud Power BI credential cannot be created.</violation>
</file>

Reply with feedback, questions, or to request a fix.

Turn on auto-fix | Re-trigger cubic

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
Comment thread apps/sim/lib/oauth/oauth.ts
providerId: 'azure-data-explorer',
icon: AzureDataExplorerIcon,
baseProviderIcon: MicrosoftIcon,
serviceAccountProviderId: 'microsoft-app-service-account',

@cubic-dev-ai cubic-dev-ai Bot Nov 12, 2026 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
Contributor

There was a problem hiding this comment.

Choose a reason for hiding this comment

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

P2: Power BI is registered as Global-only on the server, but this change exposes the app credential modal for it, and that modal offers all four clouds. Filter the cloud options per service, or limit Power BI to the Global cloud, so a national-cloud Power BI credential cannot be created.

Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. When an issue isn't valid or won't be fixed in this PR, reply in its thread with the reason and then resolve the thread. At apps/sim/lib/oauth/oauth.ts, line 656:

<comment>Power BI is registered as Global-only on the server, but this change exposes the app credential modal for it, and that modal offers all four clouds. Filter the cloud options per service, or limit Power BI to the Global cloud, so a national-cloud Power BI credential cannot be created.</comment>

<file context>
@@ -645,6 +646,17 @@ export const OAUTH_PROVIDERS: Record<string, OAuthProviderConfig> = {
+        providerId: 'azure-data-explorer',
+        icon: AzureDataExplorerIcon,
+        baseProviderIcon: MicrosoftIcon,
+        serviceAccountProviderId: 'microsoft-app-service-account',
+        authType: 'service_account',
+        scopes: [],
</file context>
Fix with cubic

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@vercel
vercel Bot deployed to Preview November 12, 2026 12:44
View deployment

This branch was successfully deployed

1 active deployment
Preview — 5e55a344 Deployed Nov 12, 2026 by vercel[bot]
View deployment
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

@greptile-apps greptile-apps[bot] greptile-apps[bot] left review comments
@cubic-dev-ai cubic-dev-ai[bot] cubic-dev-ai[bot] left review comments

Uh oh!

There was an error while loading. Please reload this page.

Assignees

No one assigned

Labels

None yet

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

Uh oh!

There was an error while loading. Please reload this page.

1 participant

@waleedlatif1
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
You are visitor 01402503 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.