Highlights
What if your cloud infrastructure lived in the same language as your application? Pulumi makes that possible. Instead of learning a separate configuration syntax, you write TypeScript, Python, Go, C# or Java and get loops, functions, packages and tests along the way. This guide shows how Pulumi works, how it compares with Terraform, and how to provision an Azure Functions environment, step by step. You will also see how it fits into CI/CD, where AI can help without taking control, and when Pulumi is not the right call. Less guesswork, more repeatable deployments, and infrastructure your whole team can review.
Imagine describing your cloud in the same language you write your apps in. No new syntax to wrestle with, just code you already know how to read.
The problem nobody warns you about
Any deployment starts out small and neat. And then comes success. Five services turn into fifteen, and each wants their own database, storage, network, and permissions. Maintaining such infrastructure requires a lot of effort from developers, DevOps, and cloud professionals.
Let’s throw in the environment. Dev, QA, PreProd, and Prod should ideally be brothers, but somebody changes something in Dev, forgets about the others, and discovers a problem in PreProd on Friday. This happens to all of us.
Infrastructure automation is the answer. Automation makes deployments repeatable, inspectable, and manageable. But automation has left us with a question we couldn’t answer: was it possible to achieve everything with the same tools we are already using? Less manual intervention, better-known tools, and portability of knowledge between clouds.
This question led us to Pulumi.
What this post covers
Over the next few minutes, we will look at what Pulumi is and how it works, set it beside Terraform, provision the infrastructure for a small proof of concept on Azure, and finish with an honest view of when it is worth adopting and when it is not. A set of FAQs closes things out.
A quick word on Infrastructure as Code (IaC)
Infrastructure as Code simply means describing your networks, databases, storage, servers and permissions in code, rather than clicking through a cloud portal and hoping you remember what you did.
Teams adopt it because it gives them:
- Repeatability: versioned definitions and controlled inputs make environments easier to reproduce consistently.
- Reviewability: infrastructure changes can travel through pull requests, just like application code.
- History: source control and deployment history show what changed when those workflows are used.
- Speed: automation can turn manual environment provisioning into a repeatable deployment process.
- Living documentation: the code itself shows how the setup is meant to look.
Manual setup is perfectly fine for a first experiment. As things grow, though, it turns into a memory test nobody wants to sit. IaC replaces that with something easier to manage, reproduce, and evolve.
If you want to go deeper into the broader IaC approach, Explained: Automate Cloud Ops with Infrastructure as Code (IaC) looks at how IaC brings software development practices such as version control and automated deployment into cloud operations.
Looking at how Infrastructure Code is evolving beyond today’s workflows?

Discover how modern IaC practices are driving smarter, faster, and more secure cloud operations.
What Is Pulumi and How Does It Work?
Pulumi is an open-source platform for Infrastructure as Code that has an optional managed service known as Pulumi Cloud. The core concept is refreshingly straightforward: you can define your infrastructure using code.
Pulumi supports TypeScript, JavaScript, Python, Go, .NET, Java, YAML, and HCL.
When you choose a general-purpose programming language, you can use familiar constructs and tools such as functions, loops, conditions, classes, packages, and testing utilities.
How Pulumi Works
At a high level, Pulumi follows a straightforward infrastructure lifecycle:
1. Define Infrastructure
Write code in a supported language, such as TypeScript, Python, or C#, to describe the desired infrastructure.
↓
2. Compare with Recorded State
Pulumi evaluates the program to determine the desired state and compares it with the latest state recorded in the selected backend.
If infrastructure might have been changed outside Pulumi, such as directly through a cloud portal or CLI, pulumi refresh can be used to reconcile the recorded state.
↓
3. Preview Changes
Review the proposed changes before applying them.
↓
4. Apply Changes
Pulumi provisions, updates, or deletes resources through the appropriate provider.
↓
5. Save Updated State
Pulumi records the updated state so it can continue tracking the managed infrastructure during future changes.
Define → Compare → Preview → Apply → Save State
Pulumi and Terraform
Terraform and Pulumi are both Infrastructure as Code tools, and both work around the idea of describing a desired infrastructure state.
One of the major differences is how you describe that state.
Terraform primarily uses HashiCorp Configuration Language (HCL). Pulumi supports general-purpose languages including TypeScript, Python, Go, C#, and Java, alongside YAML and HCL.
For teams already comfortable with traditional programming languages, this can reduce the amount of unfamiliar tooling developers need to learn. It also means functions, loops, classes, packages, testing tools, and other familiar programming concepts can be used when building infrastructure.
That does not automatically make Pulumi the better choice.
Terraform has a mature ecosystem, an active community, and a substantial amount of existing knowledge around it. If your organization already has a Terraform setup that works well, changing tools simply for the sake of changing tools may not justify the migration effort.
The practical question is less about which tool wins and more about which approach fits your team.
| Pulumi | Terraform | |
|---|---|---|
| Language support | TypeScript, JavaScript, Python, Go, .NET, Java, YAML and HCL | Primarily HCL |
| Ecosystem | Wide provider coverage, with an optional managed service in Pulumi Cloud | Mature ecosystem, active community and years of shared knowledge |
| Flexibility | Full programming constructs: loops, conditions, functions, classes and packages, plus familiar testing tools | A declarative approach, with variables, expressions and modules for reuse |
| Typical use cases | Multi-environment delivery, reusable components and platform engineering, where infrastructure sits close to application code | Standardised, declarative provisioning across clouds, especially where modules and workflows are already established |
| Choose it when | Your team is comfortable in a programming language and wants to reuse those skills | Your team prefers declarative configuration, or a Terraform setup already works well |
How to Provision Azure Infrastructure Using Pulumi
This proof of concept uses Pulumi to provision the Azure infrastructure for an existing TypeScript feedback API. The application exposes POST and GET endpoints and stores feedback in Azure Table Storage.
The Function App implementation itself is outside the scope of this walkthrough. We will assume that the application code and endpoints already exist.
| Method | Route | Purpose | Response |
|---|---|---|---|
| POST | /api/feedback | Save a message and an optional author. | 201 with an id; 400 for invalid JSON or a missing message. |
| GET | /api/feedback | List saved feedback. | 200 with an array of records. |
Prerequisites
- Node.js 22 and npm
- Azure Functions Core Tools v4 (func)
- Azure CLI and an Azure subscription
- Pulumi CLI and a Pulumi Cloud account, or a local Pulumi backend
- A Bash-compatible shell
Assumptions
The Azure Functions application already exists under:
Plain Text
feedback-func/
└── app/
├── host.json
├── package.json
├── tsconfig.json
└── src/
└── functions/
└── feedback.ts
The feedback-func/infra directory has not yet been created.
We will also assume that:
- The Function App already contains the POST and GET endpoints described above.
- The endpoints are anonymous and publicly accessible.
- The example is being used only with non-sensitive test data.
- The Azure resources created during this PoC may incur charges.
Security note: This compact PoC uses an account connection string and anonymous HTTP triggers. The storage account key provides broad access to the storage account. For production, authenticate the Function App, use its managed identity for table access, and grant only the required Azure Storage table data role at the appropriate scope.
1. Set up the Pulumi project
From the feedback-func directory:
- Shell
- mkdir infra
- cd infra
- pulumi login
- pulumi new typescript –generate-only
- npm install @pulumi/azure@”^6.40.0″ @pulumi/random@”^4.0.0″
Accept the default template prompts. The template creates the Pulumi project files. –generate-only generates the project without creating a stack or installing dependencies.
Replace the generated index.ts in infra with:
TypeScript
import * as pulumi from "@pulumi/pulumi";
import * as azure from "@pulumi/azure";
import * as random from "@pulumi/random";
const stack = pulumi.getStack();
const suffix = new random.RandomString("suffix", {
length: 6,
special: false,
upper: false,
});
const resourceGroup = new azure.core.ResourceGroup("rg", {
name: pulumi.interpolate`rg-feedback-${stack}-${suffix.result}`,
location: new pulumi.Config("azure").require("location"),
tags: { env: stack, project: "feedback-poc" },
});
const storage = new azure.storage.Account("storage", {
name: pulumi.interpolate`stfeedback${suffix.result}`,
resourceGroupName: resourceGroup.name,
location: resourceGroup.location,
accountTier: "Standard",
accountReplicationType: "LRS",
tags: { env: stack },
});
const table = new azure.storage.Table("feedback", {
name: "feedback",
storageAccountName: storage.name,
});
const deploymentContainer = new azure.storage.Container("deployments", {
name: "app-package",
storageAccountId: storage.id,
containerAccessType: "private",
});
const plan = new azure.appservice.ServicePlan("plan", {
resourceGroupName: resourceGroup.name,
location: resourceGroup.location,
skuName: "FC1",
osType: "Linux",
});
const functionAppName =
pulumi.interpolate`func-feedback-${stack}-${suffix.result}`;
const functionApp = new azure.appservice.AppFlexConsumption("api", {
name: functionAppName,
resourceGroupName: resourceGroup.name,
location: resourceGroup.location,
servicePlanId: plan.id,
storageContainerType: "blobContainer",
storageContainerEndpoint:
pulumi.interpolate`${storage.primaryBlobEndpoint}${deploymentContainer.name}`,
storageAuthenticationType: "StorageAccountConnectionString",
storageAccessKey: storage.primaryAccessKey,
runtimeName: "node",
runtimeVersion: "22",
maximumInstanceCount: 40,
instanceMemoryInMb: 2048,
appSettings: {
TABLE_CONNECTION_STRING: storage.primaryConnectionString,
TABLE_NAME: table.name,
},
siteConfig: {},
tags: { env: stack },
});
export const resourceGroupName = resourceGroup.name;
export const functionAppNameOut = functionAppName;
export const apiUrl =
pulumi.interpolate`https://${functionApp.defaultHostname}/api/feedback`;
Pulumi creates the Function App, its Flex Consumption plan, the storage account, feedback table, and deployment container. It also supplies the table connection settings to the Function App.
The storage connection string is represented as a Pulumi Output<T>. Passing this output into the Function App gives Pulumi the information needed to understand the dependency between the resources.
2. Sign in and configure the stack
Why is stack configuration required?
Pulumi needs to know where and how to deploy before it can create anything, and stack configuration supplies that information. In this PoC, the program reads the Azure region from the stack’s config and stops with an error if it is missing. The subscription ID tells the Azure provider which account to deploy into. Each stack, such as dev, test or prod, keeps its own configuration, so the same code can be deployed to different environments by changing only these values, with nothing hardcoded in index.ts.
Let us set that up. From infra, sign in to Azure and find your subscription ID and a region that supports Flex Consumption:
bash
az login az account show --query id -o tsv az functionapp list-flexconsumption-locations
Then create the stack and set its configuration:
bash
npm install pulumi stack init dev pulumi config set azure:location "<region>" pulumi config set azure:subscriptionId "<subscription-id>"
Replace <region> and <subscription-id> with the values for your Azure environment.
3. Deploy the infrastructure
First, inspect the planned changes with pulumi preview.
Then run pulumi up to begin the deployment. Pulumi shows the proposed changes again before asking you to confirm them.
What Pulumi is about to create

Fig: Preview phase of pulumi up, showing the resources Pulumi will create for the feedback API.
The screenshot shows eight Pulumi resources planned for creation: the Pulumi stack, random string, Azure Resource Group, Service Plan, Storage Account, deployment container, feedback table, and Azure Function App.
The outputs apiUrl, functionAppNameOut, and resourceGroupName appear as [unknown] during the preview because their final values depend on infrastructure that has not yet been created.
Once the proposed changes look correct, select yes to continue with the deployment.
4. Build and publish the app
Pulumi creates the infrastructure; Azure Functions Core Tools deploys the existing application code separately.
From the app directory:
Shell
cd ../app npm install npm run build func azure functionapp publish "$(pulumi -C ../infra stack output functionAppNameOut)"
5. Test the API
Retrieve the API URL:
Shell
URL=$(pulumi -C ../infra stack output apiUrl)
Send a feedback message:
Shell
curl -X POST "$URL" \
-H "Content-Type: application/json" \
-d '{"message":"Pulumi is neat","author":"me"}'
Then retrieve the stored feedback:
Shell
curl "$URL"
Assuming the existing Function App implements the API contract described above, the POST should return an ID and the GET should return the stored records.
If the Function App returns a 500 immediately after publishing, allow the application time to restart and retry the request.
6. Clean up
When the PoC is complete, destroy the stack resources:
Shell
cd ../infra pulumi destroy
Review and confirm the operation.
This deletes the resources created by the stack, including the feedback data stored in the storage account.
Where Pulumi fits
The example above is intentionally small, but Pulumi becomes more useful once infrastructure starts spreading across environments and teams.
Dev, QA, PreProd, and Prod might all use the same broad architecture while differing in sizing, configuration, scaling, or security requirements. Representing that infrastructure in code makes those differences explicit rather than leaving them hidden behind manually configured resources.

Fig: Reusable infrastructure keeps the architecture consistent while allowing each environment to have its own configuration.
It also means infrastructure can participate in an engineering workflow rather than sitting outside it.
A change can be written, reviewed in a pull request, previewed before deployment, approved, and then applied. If the infrastructure needs to evolve again, the history of the previous change is already there.
This is one of the practical benefits of treating infrastructure more like software.
Pulumi in CI/CD
Pulumi fits naturally into the CI/CD practices teams already use for application code. When an infrastructure change is raised through a pull request, pulumi preview can show reviewers what will be created, updated, or deleted before anything reaches the environment.
Once the change is reviewed and approved, pulumi up can apply it through the deployment pipeline. For production, teams can add approval gates and policy checks before high-impact changes are allowed through.
The workflow stays simple:
Change → Preview → Review → Approve → Deploy
Taking that idea further, How Does Platform Engineering Help Scale DevOps Across Modern Teams? looks at what happens when standardized infrastructure and deployment workflows need to scale across multiple engineering teams.
For more advanced scenarios, Pulumi’s Automation API can bring the same provisioning capabilities into internal platforms, applications, and services.
How AI Can Support Pulumi Development
AI changes this workflow again.
AI coding assistants can help developers generate Pulumi code, explain existing infrastructure, review definitions, refactor repetitive code, and troubleshoot problems.
There is a wider shift happening here, too. From DevOps to AutoOps: Will AI-Native SDLC Run Itself in 2026? Looks at how AI is moving deeper into DevOps and the SDLC while human decision-making continues to play an important role in engineering workflows.
AI integration: assistants and agents that help generate, review, troubleshoot and manage changes.
Pulumi also provides AI-oriented capabilities that can help compatible assistants work with infrastructure context and support agent-based infrastructure tasks.
But infrastructure should not become a case of generating code and blindly applying it.
An infrastructure change can expose an endpoint, modify permissions, delete data, affect availability, or increase cloud costs. The safeguards around AI-generated infrastructure matter just as much as the generation itself.
That means keeping a human in the loop, reviewing generated code, using least-privilege access, applying automated policy checks, and checking pulumi preview before allowing a change to reach a real environment.
Infrastructure used to be something we configured. With the right tools, it becomes something we build.
Key Takeaways
- Pulumi brings infrastructure closer to application development. Teams can use familiar general-purpose languages such as TypeScript, Python, Go, .NET, and Java alongside YAML and HCL.
- Pulumi makes infrastructure changes visible before deployment. Its preview workflow helps teams inspect intended changes before applying them.
- Pulumi and Terraform solve similar problems differently. The right choice depends on team skills, existing tooling, migration effort, and the way infrastructure is already managed.
- Pulumi can become part of CI/CD. Infrastructure can follow a controlled Change → Preview → Review → Approve → Deploy workflow.
- Pulumi becomes particularly valuable as environments grow. Reusable infrastructure code can help teams manage differences across Dev, QA, PreProd, and Prod.
- AI can accelerate infrastructure development without making the final decision. Human review, policy checks, least-privilege access, and previews remain important when infrastructure affects availability, security, data, or cloud cost.
Have a cloud or infrastructure challenge? Explore Nitor’s Cloud Services and contact Nitor Infotech to find the right solution.