Skip to content

[logicapp] Support local managed API connection creation - #10524

Merged
Ethan Yang (necusjz) merged 3 commits into
Azure:mainfrom
rllyy97:rileyevans-microsoft-local-managed-connections
Oct 26, 2026
Merged

Ethan Yang (necusjz) merged 3 commits into
Azure:mainfrom
rllyy97:rileyevans-microsoft-local-managed-connections

Conversation

@rllyy97

@rllyy97 Riley Evans (rllyy97) commented Oct 26, 2026 •

Copy link
Copy Markdown
Contributor

🤖 PR Validation — ⚠️ Review suggested

Breaking Changes Suppressions
⚠️ None ⚠️ 3 added
⚠️Azure CLI Extensions Breaking Change Test
⚠️logicapp
rule cmd_name rule_message suggest_message
⚠️ 1006 - ParaAdd logicapp connection managed create cmd logicapp connection managed create added parameter context
⚠️ 1006 - ParaAdd logicapp connection managed create cmd logicapp connection managed create added parameter path
⚠️ 1009 - ParaPropRemove logicapp connection managed create cmd logicapp connection managed create update parameter location: removed property required=True
⚠️ 1009 - ParaPropRemove logicapp connection managed create cmd logicapp connection managed create update parameter logic_app_name: removed property required=True
⚠️ 1009 - ParaPropRemove logicapp connection managed create cmd logicapp connection managed create update parameter resource_group_name: removed property required=True

This PR adds warning or check suppressions. Fix the underlying warning where possible and justify each remaining suppression in a code comment or the PR description.

3 added suppressions
File Line Kind Code
src/logicapp/azext_logicapp/_local_managed_connection.py 15 pylint # pylint: disable=import-error,no-name-in-module
src/logicapp/azext_logicapp/_local_managed_connection.py 115 pylint class LocalConnectionsFile: # pylint: disable=too-many-instance-attributes
src/logicapp/azext_logicapp/tests/latest/test_local_managed_connections.py 340 skipped test self.skipTest("Git is not installed on this host.")

This checklist is used to make sure that common guidelines for a pull request are followed.

Related command

az logicapp connection managed create

Follow-up to #10467, ported onto upstream main without staging history. Advances preview 1.0.0b1 to 1.0.0b2, preserving upstream ownership, packaging, review repairs and historical report compatibility.

Original issue acceptance:

Requirement Behavior and evidence
Supply Azure scope for a local project/context Subscription/group/location derive from local.settings.json; explicit flags override settings, with no new context schema.
Create a managed connection for a local or deployed target Supports --path, named local/cloud --context, active context without an explicit target, or existing --logic-app-name. Actual CLI/deployed lifecycle regressions pass; local Outlook OAuth plus a real workflow run succeeded.
Error when required settings are absent Missing project files, missing/invalid scope, encrypted/malformed settings and absent/mismatched signed-in subscription fail before connection creation.

Local scope precedence is explicit --subscription over Values.WORKFLOWS_SUBSCRIPTION_ID, --resource-group over WORKFLOWS_RESOURCE_GROUP_NAME, and --location over WORKFLOWS_LOCATION_NAME. Contexts remain local path/port or deployed-site bookmarks. No default-subscription fallback, account switch or scope-setting rewrite. Injected group defaults do not override local settings/cloud contexts; explicit deployed-app targets retain configured-default behavior.

Local execution creates a V2 Azure Microsoft.Web/connections resource using existing connector parameters/stdin secrets/OAuth. It requests a seven-day development key, saves it only as NAME-connectionKey in local.settings.json, and writes a Raw/Key app-setting reference in connections.json. Results never return the key and redact runtime URLs. Backend auth supports raw/service-principal/OAuth; local managed-identity and user-assigned identity are refused. Local targets make no site identity/access-policy/remote VFS calls. Existing deployed lifecycle and deployed-only legacy connection create --managed-api behavior remain guarded.

Preflight rejects missing/malformed/encrypted settings, invalid scope, absent/mismatched signed-in subscriptions, unsafe links/aliases, nonregular files and Git-tracked settings before creation. Existing resources/local wiring require --force. Publication preserves unrelated content, establishes effective final ignore rules for local settings and private staging before any secret staging contents are written, then uses private staged files, snapshots, an advisory lock and individual atomic replacements. ZIPs/manifests exclude local settings and .azurelogicapps.

API-diff warnings are additive target selection: local scope can be derived, so parser-level deployed coordinates become conditional, not removed. Deployed targets still validate required coordinates. Dynamic-import pylint exceptions follow adjacent modules; installed-byte/CLI checks verify imports. The class-scoped instance-attribute exception keeps guarded publication state together. Real-Git tests skip only when Git is absent; they ran here. Actual FIFO tests require hosts supporting FIFOs/nonblocking opens. No scanner suppression was added.

General Guidelines

  • Have you run azdev style <YOUR_EXT> locally? (pip install azdev required)
  • Have you run python scripts/ci/test_index.py -q locally? (pip install azdev required)
  • My extension version conforms to the Extension version schema

For new extensions:

Not a new extension; that item is not applicable.

Independent upstream validation uses Windows x64/Python 3.14.7/CLI 2.91.0 and private development/configuration/extension directories; these are not staging results.

Command/check Result
python -m azdev style logicapp Passed pylint/flake8 after AI fixes.
python -m azdev linter logicapp Passed nonempty command/argument/help/custom rules after AI fixes.
python -m pytest src\logicapp\azext_logicapp\tests\latest\test_local_managed_connections.py src\logicapp\azext_logicapp\tests\latest\test_managed_lifecycle_regressions.py src\logicapp\azext_logicapp\tests\latest\test_cli_contract_regressions.py src\logicapp\azext_logicapp\tests\latest\test_testing_foundation_regressions.py -q Latest source: 180 passed / 511 subtests; 3 host-dependent skips.
python <session-artifacts>\run_suite.py using installed-only Python with production preload/import-origin guard Latest exact installed wheel: 943 passed / 2,568 subtests; 5 host-dependent skips (3 symlink, 2 FIFO).
python <session-artifacts>\smoke_installed.py 8 actual stock-CLI package-only cases passed; no source imports/credentials.
python -m azdev scan --confidence-level MEDIUM -f <changed-file> --continue-on-failure All 6 AI-repair files passed; previously all 15 original PR files passed. Synthetic URL fixture false positive was corrected without a suppression.
Private wheel build/install and source/wheel/install byte comparison Passed; all 33 production Python/metadata files match; preview metadata and test/cache exclusions passed.
python scripts\ci\test_index.py -q Original qualification: 9 successful checks, 2 CI-only network skips; index unchanged.
python scripts\ci\validate_external_source_urls.py --cached Passed original staged change; upstream checks also passed on pre-repair head.
python -m azdev test logicapp --profile latest --series --discover --no-exitfirst --pytest-args -q Original source qualification: 936 passed, 3 host symlink skips.

Earlier revalidation before AI fixes passed 938 installed tests / 2,559 subtests and 8 stock CLI smoke cases. An initial environment-only rerun omitted extension discovery variables and failed additivity discovery; the correctly configured full rerun passed. Latest post-fix results are in the table above.

Latest repaired wheel SHA256: f2a4b14d4160db9d670d0247180aefbe75e0195fc69cdf2c78b6c743364c4bd6, built from cea48b060c265575f4eeafb5c7845b314b8587f2 production bytes. First actual Copilot review identified 4 issues; all were fixed, regression-covered, replied to and resolved in that commit: fatal Git exit status, secret staging exclusion, blocking FIFO validation and configured group defaults. A fresh completed AI review and CI on the new head are still required; absence of new comments alone is not a clean review. The earlier permission-denied reviewer API request has not been retried or bypassed; the user is requesting review directly.

Historical user-authorized live qualification was on 6305fd9 (wheel SHA256 0b603f5c6ca212fe1893af134a1f6c53861374c07432155b0fb6590645e2364c): one new local Office365 OAuth connection, user-driven browser consent, private key wiring, and exactly one actual Stateful GetEmailsV3 workflow (top: 1, no attachments/retries, secure mailbox-action I/O). Run succeeded with only count: 1 exposed. Owned runtime/storage stopped; cloud connection/private project retained. No default-account/context changes, global installs, deployed app/ACL/role operations or login. This live trial has not been repeated for the subsequent production safety fixes; deployed behavior remains regression-qualified, not newly live-qualified.

Limits: development keys expire after seven days with no auto-renewal; they are not production authentication. Publication is not a multi-file transaction/CAS against noncooperating writers. Failure can retain Azure state and partial local publication; no unsafe rollback/deletion/automatic mutation retry. Unknown Git tracking is reported as trackedByGit: null, not untracked. No merge or readiness claim until the review cycle completes; this task does not change PR draft/open state.

About Extension Publish

There is a pipeline to automatically build, upload and publish extension wheels.
Once your pull request is merged into main branch, a new pull request will be created to update src/index.json automatically.
You only need to update the version information in file setup.py and historical information in file HISTORY.rst in your PR but do not modify src/index.json.

Port local managed connection creation onto the published preview, preserving deployed identity behavior and guarded local key publication.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
@microsoft-github-policy-service microsoft-github-policy-service Bot added the customer-reported Issues that are reported by GitHub users external to the Azure organization. label Oct 26, 2026
@microsoft-github-policy-service

Copy link
Copy Markdown
Contributor

Thank you for your contribution Riley Evans (@rllyy97)! We will review the pull request and get back to you soon.

Retain credential-bearing runtime URL rejection coverage without a literal credential URL that trips the medium-confidence scanner. Add explicit missing-file and signed-in subscription regressions for the original local-target requirement.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
@rllyy97
Riley Evans (rllyy97) marked this pull request as ready for review October 26, 2026 18:28
Copilot AI balanced review requested due to automatic review settings October 26, 2026 18:29

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🟡 Changes recommended

Secret-file source-control protection, configured-default handling, and blocking file validation need correction before approval.

4 open issues
What changed in this PR

Extends the Logic Apps Standard preview with managed API connection creation for local projects, building on the existing deployed-app workflow.

Changes:

  • Adds path and context targeting, with local Azure scope derived from project settings and command overrides.
  • Adds development-key storage and guarded local file publication while preserving deployed connection behavior.
  • Updates documentation, regression coverage, and the preview version to 1.0.0b2.
File Description
src/​logicapp/​setup.py Advances the preview package version.
src/​logicapp/​README.md Documents local creation, authentication, and recovery limits.
src/​logicapp/​HISTORY.rst Records the new preview capabilities.
src/​logicapp/​docs/​context-management.md Explains local scope without changing context metadata.
src/​logicapp/​azext_logicapp/​tests/​latest/​test_testing_foundation_regressions.py Pins historical report provenance.
src/​logicapp/​azext_logicapp/​tests/​latest/​test_sdk_testing.py Updates future-version compatibility coverage.
src/​logicapp/​azext_logicapp/​tests/​latest/​test_local_managed_connections.py Adds local scope, authentication, publication, and failure coverage.
src/​logicapp/​azext_logicapp/​tests/​latest/​test_feedback_contracts.py Updates historical and future report compatibility cases.
src/​logicapp/​azext_logicapp/​tests/​latest/​test_cli_contract_regressions.py Covers local targeting and CLI scope overrides.
src/​logicapp/​azext_logicapp/​custom.py Resolves local and deployed targets.
src/​logicapp/​azext_logicapp/​_test_report.py Updates the report producer version.
src/​logicapp/​azext_logicapp/​_params.py Adds local targeting arguments and optional scope parameters.
src/​logicapp/​azext_logicapp/​_managed_connection.py Integrates local development keys into connection creation.
src/​logicapp/​azext_logicapp/​_local_managed_connection.py Implements local validation, scope resolution, and guarded publication.
src/​logicapp/​azext_logicapp/​_help.py Adds command guidance and local examples.

Review effort: Balanced

Comment thread src/logicapp/azext_logicapp/_params.py Resolved
Preserve unknown Git tracking status on fatal errors, publish staging exclusion before writing secrets, reject nonregular configuration files without blocking, and ignore configured group defaults for local/context targets while preserving explicit deployed defaults. Add targeted regressions and clarify local publication guidance.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
@yonzhan

Copy link
Copy Markdown
Collaborator

/azp run

@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines:
Successfully started running 2 pipeline(s).

@necusjz
Ethan Yang (necusjz) merged commit 8b02db6 into Azure:main Oct 26, 2026
24 checks passed
@azclibot

Copy link
Copy Markdown
Collaborator

[Release] Update index.json for extension [ logicapp-1.0.0b2 ] : https://dev.azure.com/msazure/One/_build/results?buildId=187840996&view=results

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

Labels

customer-reported Issues that are reported by GitHub users external to the Azure organization.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

7 participants