Reach sources that block public network access via private endpoints - #9
Open
ryanwjackson wants to merge 1 commit into
Open
Reach sources that block public network access via private endpoints#9ryanwjackson wants to merge 1 commit into
ryanwjackson wants to merge 1 commit into
Conversation
A storage account with public network access disabled ignores its firewall allow list entirely, so grant-source cannot reach it. Setting the new source.privateEndpoint flag on a job now makes the deployment create, in its own network: a private-endpoints subnet, a privatelink DNS zone for the storage service with a link to the copy vnet, and one private endpoint per distinct source account with its DNS record. The connection is requested rather than auto-approved, so deploying needs no permission on the storage account; it arrives Pending and the account's owner approves it once, in the portal or with the new approve-source command. status reports the connection's state, and deploy gains --replace so the flag can be backfilled onto an already-deployed job without redeploying the fleet. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01WddsTwUa11DHabXuJ4pTHd
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Why
grant-sourceadds the copy subnet to a source account's firewall allow list, but an account with public network access disabled ignores that list entirely — every request to its public endpoint fails with 403AuthorizationFailure. Such accounts previously could not be sources at all (README said as much).What
A new per-job flag, configured in the job JSON:
When any job sets it, the template additionally deploys — all inside the copy service's own resource group and vnet:
private-endpointssubnet (always created, empty and free when unused; the Container Apps subnet is delegated and cannot hold endpoints),privatelink.file.core.windows.net/privatelink.blob.core.windows.netprivate DNS zone, linked to the copy vnet,deploy, and jobs sharing an account converge on the same resources.The connection uses
manualPrivateLinkServiceConnections, so deploying needs no permission on the storage account: it arrives Pending, and the account's owner approves it once — portal, or the newcopyctl.py approve-source <job>. Until then runs keep failing with the same 403, whichcopyctl.py statusnow calls out by showing the connection state.copyctl
approve-source <job>— approves this deployment's pending connection (matched by the endpoint's deterministic name, so it can never approve someone else's request).status— shows the endpoint's approval state for jobs with the flag.deploy --replace— redeploys one existing job in place so the flag can be backfilled without a fleet-wide redeploy; that job's schedule returns to parked and its secret to the placeholder, which the command spells out. Other jobs stay untouched.deployreads the deployedprivate-endpointssubnet prefix back from Azure (like the other shared values);params/validate/deploygain--pe-subnetfor custom addressing, validated for fit and non-overlap.SOURCE_PRIVATE_ENDPOINTis carried on the container env (not read by it) sopullround-trips the flag.The portal form always emits
"privateEndpoint": false— portal deployments are unchanged; the flag is CLI/job-file only.Notes for review
tests/template_test.pyforbids conditional top-level resources, so everything is zero-length loops derived from the jobs array; with no flagged jobs the template's output is unchanged except the extra subnet.infra/main.jsonregenerated with Bicep CLI 0.46.1. If CI'saz bicepversion differs enough to change codegen, regenerate withaz bicep build --file infra/main.bicep --outfile infra/main.json.copyctl.py validate, config/uidefinition/template/transfer tests, shellcheck). Not verified against live Azure: the Pending→Approved flow, and that re-PUTting an approved manual connection on redeploy keeps its approved state (expected ARM behavior, but worth watching on the first backfill).🤖 Generated with Claude Code
https://claude.ai/code/session_01WddsTwUa11DHabXuJ4pTHd