The Simplest Way to Make Azure Functions and Pulumi Work Like They Should
Teams use azure functions and pulumi to build and deploy serverless apps with code. Pulumi creates the cloud resources, while Azure Functions runs the event-driven app logic. This setup lets developers write both cloud rules and app code in one language. You do not need to switch between web menus and local scripts. Your team can review every cloud change in a standard pull request. When the code merges, the pipeline updates the cloud resources and deploys the app. How azure functions and pul
Your coding agents run with your access.
Claude Code reaches prod with a developer's credentials, and approval prompts get clicked through. hoop.dev checks every query, masks sensitive data, and holds risky changes for a human.
Teams use azure functions and pulumi to build and deploy serverless apps with code. Pulumi creates the cloud resources, while Azure Functions runs the event-driven app logic.
This setup lets developers write both cloud rules and app code in one language. You do not need to switch between web menus and local scripts. Your team can review every cloud change in a standard pull request. When the code merges, the pipeline updates the cloud resources and deploys the app.
How azure functions and pulumi share keys and data
Pulumi talks to the cloud API to set up your serverless app. First, it creates a resource group and a storage account for the function. Next, it builds the hosting plan and the function app resource itself. Pulumi also sets up a managed identity for the new function app.
Your function app needs permissions to read queues, databases, or secret stores. Pulumi assigns specific cloud roles to the function identity during the deployment run. The deployment tool reads outputs from one resource and passes them to the next. For example, Pulumi takes a database name and writes it into the app settings.
Pulumi stores all these resource details inside a central state file. If you mark a value as secret, Pulumi encrypts that value in the state. The function app then reads these settings as local variables when it runs. Data flows from the Pulumi state into the cloud API, then into your app.
Common failure modes and how to scope roles
Many teams make the mistake of using one shared service account for deployments. If that account has broad owner rights, a bad script can delete production data. Developers also copy keys from the state file to run local tests. Those keys often stay on laptops for months and create a big risk.
Another common issue happens when teams put plain text secrets into app settings. Anyone who can read the cloud panel can then see those database keys. Also, if engineers fix broken functions by hand, the live cloud drifts from Pulumi. The next deployment will overwrite those manual fixes and break the app again.
Azure RBAC + Cloud Functions IAM: architecture patterns and best practices
Continue reading? Get the full guide.
Free. No spam. Unsubscribe anytime.
To fix this, give your Pulumi pipeline a role scoped to one resource group. Use short-lived federated tokens in your build pipeline instead of static client keys. Give each function app its own managed identity with only the roles it needs. Do not let five different function apps share the same identity.
Lock down the network paths between your function apps and your data stores. Put the function app inside a virtual network and block public traffic to databases. Log every deployment run and every database query so you can track all actions.
Managing state and code updates across teams
A common mistake is coupling cloud changes and app code in one slow step. If a developer changes one line of app logic, Pulumi checks every cloud resource. You can split your project into two stacks to keep deployments fast and safe.
One stack sets up the base network, storage accounts, and data stores. The second stack deploys the function app code and reads outputs from the first. This split limits the blast radius when a team member pushes a quick fix. Platform teams can own the base stack while app teams own the function stack.
Keep your state files in a remote backend that supports state locking. Locking stops two engineers from running an update at the exact same time. Always run a preview check in your pull requests before you merge any changes. This check shows the team every resource that Pulumi plans to add or delete.
Check database and API queries on the wire
Identity tools, roles, and network rules decide who opens a session. Setup alone cannot check what each query does or mask sensitive values in a response once a session starts. When workflows touch Postgres, MySQL, SQL Server, MongoDB, ClickHouse, Kubernetes APIs, SSH, or internal HTTP APIs, hoop.dev runs beside those services as an open-source proxy, a sidecar for your Postgres or API. It inspects requests coming in and results going back on the wire.
Your login details and client tools stay as they are while hoop.dev guardrails refuse bad deletes or drops before they run. On responses, hoop.dev data masking rewrites matched sensitive values in memory. Furthermore, hoop.dev holds SOC 2 Type II, is MIT licensed, and writes every query and decision to an audit trail that generates evidence for HIPAA, GDPR, and PCI DSS. See the source on GitHub.
Frequently asked questions
Should Pulumi deploy the function code or just the cloud resources?
Pulumi can do both tasks well for small and medium projects. For large apps, use Pulumi for cloud resources and a build tool for code.
How do we stop secrets from leaking in the Pulumi state file?
Wrap every sensitive value in the secret helper before passing it to a resource. Better yet, pass a secret store reference instead of the raw secret value.
Why does my function app fail to start after a Pulumi update?
This usually happens when the storage account key or app settings get out of sync. Check that your Pulumi code sets all required runtime settings and storage roles.
Related guides
In this post