From a Nightly Batch to a Webhook: Applications in Dataverse Within Seconds
Receive with Power Automate or Azure, validate, upsert on an alternate key, keep the nightly batch as a reconciliation and alert a named owner on every failure.
To get applications into Dataverse within seconds instead of overnight, let the source system call a webhook. In Power Automate the receiver is the When a HTTP request is received trigger, a premium connector; at higher volume an Azure Function or Logic App receives instead. The flow validates the payload against a schema, checks required fields and a shared secret or signature, and answers the sender at once. It then upserts the application on an alternate key, such as the source application number, so a repeated message updates instead of duplicating. Keep the nightly batch, rewritten as a reconciliation that catches anything the webhook missed, and alert a named owner on every failure.
Why replace a nightly batch with a webhook into Dataverse?
Because the people working the applications wait for it. With a nightly load, an application submitted at nine in the morning is visible in Dataverse the next day, follow-up is a day late, and anyone who needs it sooner rekeys it. A webhook reverses the direction: the source system calls an endpoint the moment an application is submitted or changed, and the record is in Dataverse within seconds.
The batch had one quality worth keeping: it eventually got everything. A webhook gets each message once, so a short outage on either side can lose an application silently. The design on this page keeps both properties, speed from the webhook and completeness from the batch, which is the pattern behind every integration on our Dynamics 365 and Azure integration services page.
What does the webhook flow look like end to end?
Five stages, each with a clear job. The stage names are the ones to use when you brief a developer or review a flow someone else built.
| Stage | What happens | Built with |
|---|---|---|
| Receive | The source system posts the application as JSON to an HTTPS endpoint | Power Automate When a HTTP request is received trigger, or an Azure Function or Logic App at higher volume |
| Validate | Schema, required fields and a shared secret or signature are checked; the sender gets 400 or 202 at once | Request body JSON schema, conditions and the Response action, or code in a Function |
| Upsert | The application is created or updated by its source application number | A Dataverse alternate key and an upsert addressed by that key |
| Reconcile | The nightly job compares source and Dataverse and fixes gaps | The existing batch, rewritten as a reconciliation |
| Alert | Failures and silence reach a named owner with the payload kept for replay | Run after configuration, an error table, Teams or email notification |
How do you receive the webhook in Power Automate, and when do you need Azure instead?
In Power Automate, start a solution aware cloud flow with the When a HTTP request is received trigger. Saving it generates the URL the source system calls. On current versions the trigger lets you choose who can call it: anyone with the URL, or only users in your tenant. If the sender cannot authenticate with Microsoft Entra ID, it will be anyone with the URL, and the URL then carries a signature in its query string: treat it as a secret and store it in the sender's vault, not in a shared document. Keep the secret your flow checks in an environment variable, which can reference Azure Key Vault.
Move the receiving side to an Azure Function or a Logic App when volume is high or bursty, when the sender signs messages with a hash your flow cannot compute, or when you need a queue in between. A Function can verify the signature, put the message on an Azure Service Bus queue and answer in milliseconds, while a processor writes to Dataverse at a pace the Dataverse API limits allow. Where flows already run into throttling, read Power Automate 429 throttling at scale before adding more.
What does the flow need to validate before it writes anything?
Validate first, write second, and tell the sender which happened. A rejected message that the sender knows about can be fixed and resent; a message accepted and then dropped cannot.
- Authenticity: a shared secret in a header compared with the value in your environment variable, or a signature verified in a Function. Reject anything else with 401 and do not log the payload in full.
- Shape: the request body JSON schema in the trigger, so a payload with the wrong types fails before any action runs.
- Required fields: the application number, the applicant identity and every field Dataverse requires, checked with conditions, with 400 and a readable reason when one is missing.
- Reference data: codes such as programme, product or region looked up against Dataverse, so a value the table does not know goes to the error table instead of being written blank.
- Response: answer 202 as soon as the message is valid and accepted. The flow continues after the Response action, and the sender is not left waiting for the Dataverse write.
Why upsert on an alternate key instead of create?
Because webhooks are delivered at least once, not exactly once. Senders retry when they do not get a response in time, and the same application is often sent again when the applicant edits it. A create step turns every retry into a duplicate. An upsert addressed by a key from the source, such as the application number, creates the row the first time and updates it every time after.
Create the alternate key on the Dataverse table first. Dataverse builds a unique index behind it in the background, and the key does not become active while duplicate values exist, so clean up the duplicates the nightly batch may already have created. Then write with an upsert addressed by that key: the Dataverse Web API does this with a PATCH to the key, and the Dataverse connector in Power Automate can address a row by alternate key as well; check how your version of the action accepts it. Related rows, such as the applicant contact, are looked up or upserted by their own keys in the same way. For a large first load before go-live, follow bulk import into Dataverse rather than replaying history through the webhook.
Why keep the nightly batch as a safety net?
Because nobody can promise that every webhook call arrives. The source may be down when it should send, a deployment may disable the flow for ten minutes, or a sender may give up after its last retry. Without a second path, those applications are simply missing.
Keep the nightly job but change its purpose. Instead of loading every application, it asks the source for applications created or changed since the previous run, with some overlap, compares them with Dataverse by application number and last modified date, and upserts what is missing or out of date. Because the write is an upsert on the same alternate key, running it twice changes nothing. The report it produces, how many applications it had to fix, is the best measure you have of how healthy the webhook is. When that number stays at zero for long enough, you can run the reconciliation weekly, but keep it.
How should failures raise an alert?
Every failure should reach a person who owns it, with the payload kept so it can be replayed without retyping.
- Put the validate and upsert actions in a scope, and add a second scope configured to run after the first has failed or timed out. That is the catch branch.
- In the catch branch, write the payload, the error message and the flow run link to an error table in Dataverse, notify the named owner in Teams or by email, and return 500 so the sender retries where it can.
- Replay from the error table once the cause is fixed, through the same upsert, so a replay can never duplicate.
- Alert on silence as well as on errors: if no applications arrive during business hours when some always do, something upstream has stopped and no error will tell you.
- Make sure the flow owner is a service account or the flow runs under an application user, so alerts and connections do not stop when someone leaves. Our Power Automate consulting covers flow ownership and monitoring in more depth.
What does the HTTP trigger mean for licensing and governance?
The When a HTTP request is received trigger and the Response action belong to the premium Request connector, so the flow needs premium licensing, either through the owner's licence or a licence for the flow itself. Check the current Power Platform licensing guide for which option fits a service flow that runs for the whole organisation, and budget for it before building; prices are Microsoft's and change. Premium licensing audits are part of our Power Automate consulting.
Check the environment's data loss prevention policy as well: administrators often block the HTTP connectors by default, and the flow will not run until the policy allows them in that environment. Build the flow in a solution with connection references and environment variables, so it moves from development to test to production without editing. If several outside systems will call into Dataverse, an API gateway in front is cleaner than one flow URL per sender; see exposing Dynamics 365 data through an API gateway.
What are the steps to move from a nightly batch to a webhook?
Do them in this order. The alternate key and the reconciliation come before the switch, not after it.
- Agree the contract with the sender: Define the payload, the unique application number, how the message is authenticated, which response codes mean success or retry, and how often the sender retries a failed call.
- Create the alternate key: Remove duplicate application numbers in the Dataverse table, then create an alternate key on that column and wait until the key is active.
- Build the receiver: Create a solution aware cloud flow with the When a HTTP request is received trigger, restrict who can trigger it where your version allows, and add the request body JSON schema. At higher volume, receive with an Azure Function or Logic App instead.
- Validate and answer the sender: Check the shared secret or signature and the required fields. Return 400 with the reason for a bad payload, and 202 once a valid message is accepted.
- Upsert on the alternate key: Write the application to Dataverse addressed by the alternate key, so the same message twice updates one row, with related rows looked up by their own keys.
- Handle failure: Wrap the write in a scope, add a branch that runs after it fails or times out, store the payload and error in an error table, notify the named owner and let the sender retry.
- Turn the nightly batch into a reconciliation: Change the nightly job from loading every application to comparing the source with Dataverse for recent changes, upserting what is missing or out of date, and reporting what it fixed.
- Run in parallel, then switch: Run the webhook alongside the old batch for a few cycles, compare results, alert on silence as well as errors, and then retire the load part of the batch.
What does Solzet deliver for webhook integrations into Dataverse?
For teams without in-house Power Platform skills, Solzet builds the whole path: the contract with the sender, the alternate keys and the duplicate cleanup in Dataverse, the receiver in Power Automate or in Azure Functions and Logic Apps where volume needs it, validation, the upsert, the error table and alerts, the nightly reconciliation, and the solution, licensing and data loss prevention setup to run it. We hand over runbooks and train whoever will own it, or support it ourselves. Our own senior consultants and developers do the work. The service line is Dynamics 365 and Azure integration services, and the flow side is Power Automate consulting.
Where the applications land in a CRM and the organisation would rather not carry Microsoft licensing, a custom CRM can receive the same webhook with the same pattern. We recommend the right solution: Dynamics 365 (Customer Engagement, Business Central or Finance and Operations), Power Platform, or a custom-built CRM. One team for CRM, ERP and the integration between them.
What do people ask us?
Can Power Automate receive a webhook and write to Dataverse?
Yes. The When a HTTP request is received trigger gives the source system a URL to call, and the flow validates the payload and upserts the record in Dataverse. The trigger is a premium connector.
How do we stop duplicate applications when the sender retries?
Create an alternate key on the source application number and upsert on it instead of creating. The first message creates the row, every repeat updates the same row.
Should we switch off the nightly batch once the webhook works?
No. Rewrite it as a reconciliation that compares recent source changes with Dataverse and upserts what is missing. It catches messages lost during outages and shows how healthy the webhook is.
When is Power Automate not enough as the receiver?
When volume is high or bursty, when the sender signs messages with a hash the flow cannot verify, or when you need a queue between receiving and writing. An Azure Function or Logic App with Azure Service Bus then receives instead.
How do we secure the HTTP trigger URL?
Restrict who can trigger the flow where your version allows it. If the URL must be open, treat it as a secret, check a shared secret or signature on every call, and keep that secret in an environment variable backed by Azure Key Vault.
What happens when the Dataverse write fails?
A branch configured to run after failure stores the payload and error in an error table, alerts the named owner and returns 500 so the sender retries. Fixed messages are replayed through the same upsert.
Does the HTTP trigger need a premium licence?
Yes, the Request connector is premium, so the flow needs premium licensing through its owner or a licence for the flow. Check the current Power Platform licensing guide for the options that fit a service flow.
Where should you go next?
Dynamics 365 and Azure integration services
Service Bus, Logic Apps, Functions and API Management with Dataverse.
Power Automate consulting
Cloud flows, error handling, monitoring and premium licensing audits.
Power Automate 429 throttling at scale
Redesigning flows that hit service limits.
Dataverse API limits
Keeping integrations from slowing down the people using the app.
An API gateway for external consumers
One governed front door when several systems call Dataverse.
Which solution is right for your business?
Tell us what you need. A senior consultant replies within one business day with a recommendation (Customer Engagement, Business Central, Finance and Operations, Power Platform or a custom-built CRM), not a sales script.