<!-- mobian-agent-page publisher="dailydev" canonical="https://daily.dev/posts/lightweight-php-application-deployment-to-windows-azure-totnutk8y" -->

---
title: Lightweight PHP application deployment to Windows Azure
description: A manual, lightweight alternative to the Windows Azure Eclipse tooling or command-line tools for packaging and deploying PHP applications is demonstrated by...
canonical: https://daily.dev/posts/lightweight-php-application-deployment-to-windows-azure-totnutk8y
twitter:card: summary_large_image
twitter:site: @dailydotdev
og:type: website
og:site_name: daily.dev
og:title: Lightweight PHP application deployment to Windows Azure | daily.dev
og:description: A manual, lightweight alternative to the Windows Azure Eclipse tooling or command-line tools for packaging and deploying PHP applications is demonstrated by...
og:url: https://daily.dev/posts/lightweight-php-application-deployment-to-windows-azure-totnutk8y
og:image: https://api.daily.dev/og/posts/TOtNutk8Y.png
og:image:alt: Lightweight PHP application deployment to Windows Azure
og:image:width: 1200
og:image:height: 630
og:locale: en
---

> ## Documentation Index
> Fetch the complete documentation index at: https://daily.dev/llms.txt
> Use this file to discover all available pages before exploring further.

# Lightweight PHP application deployment to Windows Azure

**[Maarten Balliauw](https://daily.dev/sources/maartenballiauw)** · 8 min read · 0 upvotes · 0 comments

## Summary

A manual, lightweight alternative to the Windows Azure Eclipse tooling or command-line tools for packaging and deploying PHP applications is demonstrated by building a .cspkg from scratch. The walkthrough covers creating the ServiceDefinition.csdef and ServiceConfiguration.cscfg files, auto-installing PHP via a startup task using the WebPI command-line tool, fixing missing environment variables under Full IIS mode with a PowerShell script, and automating packaging with a batch script that calls cspack.exe. The approach applies equally to .NET or Ruby applications, not just PHP.

## Full article

daily.dev links to this article rather than hosting it. Read it at the original source: <https://blog.maartenballiauw.be/posts/2011-04-04-lightweight-php-application-deployment-to-windows-azure>

## Questions this post answers

### How do I auto-install PHP when a Windows Azure web role VM boots?

Use a Windows Azure startup task that calls the WebPI command-line tool with the /Products:PHP53 /AcceptEula flags. A batch script named install-php.cmd placed under the web role's bin folder creates a local app data folder, registers it in the registry, invokes webpicmdline to install PHP 5.3.x, and logs output to a startup-tasks log file.

_Teams scripting PHP installs on Windows Azure can track Azure tooling changes on daily.dev._

### Why are environment variables like RoleName and DeploymentId missing in a PHP app running on Windows Azure Full IIS?

Full IIS web roles run inside the real IIS process, which is separate from the process that launched the VM, so the usual role environment variables aren't inherited. A startup task running a PowerShell script can read these values from the Microsoft.WindowsAzure.ServiceRuntime assembly and write them into machine-level environment variables, restarting the instance if they changed so IIS and PHP pick up the new values.

_Developers debugging Azure Full IIS quirks can follow related infrastructure fixes on daily.dev._

### How do I build a Windows Azure .cspkg deployment package manually without the SDK tooling?

A Windows Azure package is an OpenXML (ZIP-like) archive built from a folder structure containing ServiceDefinition.csdef, ServiceConfiguration.cscfg, and a web role folder with bin and resources subfolders. A batch script can copy the application into this template and call cspack.exe from the Windows Azure SDK v1.4 to produce the .cspkg and .cscfg files for upload.

_Anyone scripting custom Azure packaging steps can keep deployment workflow tips flowing via daily.dev._

## Similar posts on daily.dev

- [How I Deployed a PHP Web App on Azure App Service](https://daily.dev/posts/how-i-deployed-a-php-web-app-on-azure-app-service-voouyftxc) · Medium · 0 upvotes · 0 comments
- [Bootstrapping a Frameworkless PHP Application \#](https://daily.dev/posts/bootstrapping-a-frameworkless-php-application--3rihpy6af) · Maxime Gosselin · 24 upvotes · 1 comments
- [.NET Aspire 6: Deployment Using Azure Container Apps](https://daily.dev/posts/net-aspire-6-deployment-using-azure-container-apps-ajnipjxrw) · Telerik · 0 upvotes · 0 comments

---

Tags: [#cicd](https://daily.dev/tags/cicd), [#php](https://daily.dev/tags/php), [#.net](https://daily.dev/tags/.net), [#powershell](https://daily.dev/tags/powershell)

[View this post on daily.dev](https://daily.dev/posts/lightweight-php-application-deployment-to-windows-azure-totnutk8y)

```json
{"@context":"https://schema.org","@graph":[{"@type":"Organization","@id":"https://daily.dev/#organization","name":"daily.dev","url":"https://daily.dev","logo":{"@type":"ImageObject","url":"https://daily.dev/apple-touch-icon.png","width":180,"height":180},"sameAs":["https://twitter.com/dailydotdev","https://github.com/dailydotdev","https://www.linkedin.com/company/daily-dev-ltd"]},{"@type":"WebSite","@id":"https://daily.dev/#website","url":"https://daily.dev","name":"daily.dev","publisher":{"@id":"https://daily.dev/#organization"},"potentialAction":{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https://daily.dev/search?q={search_term_string}"},"query-input":"required name=search_term_string"}}]}
{"@context":"https://schema.org","@type":"TechArticle","headline":"Lightweight PHP application deployment to Windows Azure","url":"https://daily.dev/posts/lightweight-php-application-deployment-to-windows-azure-totnutk8y","mainEntityOfPage":{"@type":"WebPage","@id":"https://daily.dev/posts/lightweight-php-application-deployment-to-windows-azure-totnutk8y"},"datePublished":"2026-10-04T13:05:59.735Z","dateModified":"2026-10-04T13:08:49.981Z","description":"A manual, lightweight alternative to the Windows Azure Eclipse tooling or command-line tools for packaging and deploying PHP applications is demonstrated by...","image":"https://media.daily.dev/image/upload/f_auto,q_auto/v1/posts/91610c2d7b064e2c86d52945217285ea?_a=AQAEuop","thumbnailUrl":"https://media.daily.dev/image/upload/f_auto,q_auto/v1/posts/91610c2d7b064e2c86d52945217285ea?_a=AQAEuop","isAccessibleForFree":true,"articleSection":"Maarten Balliauw","inLanguage":"en","publisher":{"@type":"Organization","name":"daily.dev","url":"https://daily.dev","logo":{"@type":"ImageObject","url":"https://daily.dev/apple-touch-icon.png","width":180,"height":180}},"author":{"@type":"Organization","name":"Maarten Balliauw","logo":"https://media.daily.dev/image/upload/s--rOTg3VYO--/f_auto,q_auto/v1791119043/logos/maartenballiauw?_a=BAMAMicg0","url":"https://daily.dev/sources/maartenballiauw"},"commentCount":0,"discussionUrl":"https://daily.dev/posts/lightweight-php-application-deployment-to-windows-azure-totnutk8y","interactionStatistic":[{"@type":"InteractionCounter","interactionType":{"@type":"LikeAction"},"userInteractionCount":0},{"@type":"InteractionCounter","interactionType":{"@type":"CommentAction"},"userInteractionCount":0}],"keywords":"cicd,php,.net,powershell","timeRequired":"PT8M"}
{"@context":"https://schema.org","@type":"BreadcrumbList","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https://daily.dev"},{"@type":"ListItem","position":2,"name":"Maarten Balliauw","item":"https://daily.dev/sources/maartenballiauw"},{"@type":"ListItem","position":3,"name":"Lightweight PHP application deployment to Windows Azure"}]}
{"@context":"https://schema.org","@type":"FAQPage","@id":"https://daily.dev/posts/lightweight-php-application-deployment-to-windows-azure-totnutk8y#faq","mainEntity":[{"@type":"Question","name":"How do I auto-install PHP when a Windows Azure web role VM boots?","acceptedAnswer":{"@type":"Answer","text":"Use a Windows Azure startup task that calls the WebPI command-line tool with the /Products:PHP53 /AcceptEula flags. A batch script named install-php.cmd placed under the web role's bin folder creates a local app data folder, registers it in the registry, invokes webpicmdline to install PHP 5.3.x, and logs output to a startup-tasks log file. Teams scripting PHP installs on Windows Azure can track Azure tooling changes on daily.dev."}},{"@type":"Question","name":"Why are environment variables like RoleName and DeploymentId missing in a PHP app running on Windows Azure Full IIS?","acceptedAnswer":{"@type":"Answer","text":"Full IIS web roles run inside the real IIS process, which is separate from the process that launched the VM, so the usual role environment variables aren't inherited. A startup task running a PowerShell script can read these values from the Microsoft.WindowsAzure.ServiceRuntime assembly and write them into machine-level environment variables, restarting the instance if they changed so IIS and PHP pick up the new values. Developers debugging Azure Full IIS quirks can follow related infrastructure fixes on daily.dev."}},{"@type":"Question","name":"How do I build a Windows Azure .cspkg deployment package manually without the SDK tooling?","acceptedAnswer":{"@type":"Answer","text":"A Windows Azure package is an OpenXML (ZIP-like) archive built from a folder structure containing ServiceDefinition.csdef, ServiceConfiguration.cscfg, and a web role folder with bin and resources subfolders. A batch script can copy the application into this template and call cspack.exe from the Windows Azure SDK v1.4 to produce the .cspkg and .cscfg files for upload. Anyone scripting custom Azure packaging steps can keep deployment workflow tips flowing via daily.dev."}}]}
```

