Skip to content

Conversation

@slapointe
Copy link

🛠️ Description

Fixes #1996

In Set-BlobTriggerSubscription, the Add-AzDataFactoryV2TriggerSubscription call and the Get-AzDataFactoryV2TriggerSubscriptionStatus check were inside the same Invoke-WithRetry block. This caused the status to be checked immediately after subscribing (always Provisioning), and on retry the subscribe call would fail with Resource cannot be updated during provisioning, exhausting all retries.

Split into two steps:

  1. The subscription operation wrapped in a try/catch that tolerates an already-transitioning subscription
  2. A separate status-polling retry loop that waits for provisioning to complete

📋 Checklist

🔬 How did you test this change?

  • 🤏 Lint tests
  • 🤞 PS -WhatIf / az validate
  • 👍 Manually deployed + verified
  • 💪 Unit tests
  • 🙌 Integration tests

🙋‍♀️ Do any of the following that apply?

  • 🚨 This is a breaking change.
  • 🤏 The change is less than 20 lines of code.

📑 Did you update docs/changelog.md?

  • ✅ Updated changelog (required for dev PRs)
  • ➡️ Will add log in a future PR (feature branch PRs only)
  • ❎ Log not needed (small/internal change)

📖 Did you update documentation?

  • ✅ Public docs in docs (required for dev)
  • ✅ Public docs in docs-mslearn (required for dev)
  • ✅ Internal dev docs in docs-wiki (required for dev)
  • ✅ Internal dev docs in src (required for dev)
  • ➡️ Will add docs in a future PR (feature branch PRs only)
  • ❎ Docs not needed (small/internal change)

…aFactory

In Set-BlobTriggerSubscription, the Add/Remove subscription call and the
status check were in the same Invoke-WithRetry block. This meant the status
was checked immediately after subscribing, always finding "Provisioning".
The retry would then call Add-AzDataFactoryV2TriggerSubscription again,
which fails with "Resource cannot be updated during provisioning", exhausting
all retries and failing the deployment.

Split into two steps: the subscription operation (with a try/catch that
tolerates an already-transitioning subscription) and a separate status-polling
loop that waits for provisioning to complete.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@slapointe slapointe force-pushed the fix/init-datafactory-provisioning-retry branch from 4fcc47d to 26c7f09 Compare February 13, 2026 00:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Micro PR 🔬 Very small PR that should be especially easy for newcomers Needs: Review 👀 PR that is ready to be reviewed Tool: FinOps hubs Data pipeline solution

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Init-DataFactory.ps1 fails when Event Grid subscription is already provisioning

7 participants