Skip to content

Fix/init datafactory provisioning retry#2001

Merged
RolandKrummenacher merged 2 commits into
devfrom
fix/init-datafactory-provisioning-retry
Feb 13, 2026
Merged

Fix/init datafactory provisioning retry#2001
RolandKrummenacher merged 2 commits into
devfrom
fix/init-datafactory-provisioning-retry

Conversation

@RolandKrummenacher

Copy link
Copy Markdown
Collaborator

🛠️ Description

Improves the fix from #1997 for Event Grid subscription handling in Init-DataFactory.ps1.

The original PR (#1997) correctly identified the problem (subscribe + status poll in the same retry loop), but wrapped the subscribe call in Invoke-WithRetry with an outer try/catch — meaning up to ~17 minutes of wasted retries before the "already provisioning" fallback kicks in.

This PR takes a check-first approach instead:

  1. Pre-check the current subscription status before calling subscribe/unsubscribe
  2. Early return if already at the target status (Enabled/Disabled)
  3. Skip the call if already in a transitional state (Provisioning/Deprovisioning) and go straight to polling
  4. Poll separately for completion using Invoke-WithRetry

Also adds the missing changelog entry under v14.

Fixes #1996
Supersedes #1997

📋 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)

Stephane Lapointe and others added 2 commits February 12, 2026 18:58
…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>
- Check subscription status before attempting subscribe/unsubscribe
- Skip call if already in transitional state (Provisioning/Deprovisioning)
- Early return if already at target status
- Poll separately for completion with retry loop
- Add changelog entry for v14

Fixes #1996
@RolandKrummenacher

Copy link
Copy Markdown
Collaborator Author

@slapointe As I didn't could/wanted to push to your fork, I've created a new PR here.

@RolandKrummenacher RolandKrummenacher marked this pull request as ready for review February 13, 2026 11:13
@RolandKrummenacher RolandKrummenacher merged commit 1df269d into dev Feb 13, 2026
4 checks passed
@RolandKrummenacher RolandKrummenacher deleted the fix/init-datafactory-provisioning-retry branch February 13, 2026 11:13
flanakin pushed a commit that referenced this pull request Mar 10, 2026
Co-authored-by: Stephane Lapointe <stephane.lapointe@workleap.com>
Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
Co-authored-by: Roland Krummenacher <roland.krummenacher@alescent.com>
@Elgeario

Copy link
Copy Markdown

@RolandKrummenacher When is this due to be fixed? We have upgraded to V13 today and hit this issue. Is there a work around / release date of the fix?

@RolandKrummenacher

RolandKrummenacher commented Apr 28, 2026

Copy link
Copy Markdown
Collaborator Author

@Elgeario This is part of release 14 which is planned to be released this or next week.

@Elgeario

Copy link
Copy Markdown

@RolandKrummenacher , Thank you for the prompt response!

@RolandKrummenacher

Copy link
Copy Markdown
Collaborator Author

@Elgeario V14 is now fully released. We had some issues that delayed the release. Sorry about that.

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

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

4 participants