01 - Run Locally (Premium)¶
Scaffold and run a PowerShell Azure Functions app locally before deploying to the Premium (EP1) plan.
Prerequisites¶
| Tool | Version | Purpose |
|---|---|---|
| PowerShell | 7.4+ | Local runtime matching the worker |
| Azure Functions Core Tools | v4 | Start the local host and publish |
| Azure CLI | 2.61+ | Provision and configure Azure resources |
| Azurite (optional) | latest | Local Storage emulator for triggers |
Premium (EP1) basics
Premium (EP1) is pre-warmed instances that eliminate cold start, with VNet and slots. PowerShell runs on version 7.4 on this plan.
What You'll Build¶
You will scaffold a PowerShell function app with an anonymous HTTP trigger, run it on the local Functions host, and verify the endpoint responds.
Steps¶
Step 1 - Scaffold the project¶
func init MyPsApp --powershell
cd MyPsApp
func new --name HttpExample --template "HTTP trigger" --authlevel anonymous
Step 2 - Configure local settings¶
local.settings.json:
{
"IsEncrypted": false,
"Values": {
"AzureWebJobsStorage": "UseDevelopmentStorage=true",
"FUNCTIONS_WORKER_RUNTIME": "powershell",
"FUNCTIONS_WORKER_RUNTIME_VERSION": "7.4"
}
}
Step 3 - Review the function¶
HttpExample/run.ps1:
param($Request, $TriggerMetadata)
$name = $Request.Query.Name
if (-not $name) { $name = $Request.Body.Name }
$body = if ($name) { "Hello, $name." } else { "Pass a name in the query string or body." }
Push-OutputBinding -Name Response -Value ([HttpResponseContext]@{
StatusCode = [System.Net.HttpStatusCode]::OK
Body = $body
})
Step 4 - Start the host¶
Step 5 - Call the endpoint¶
Verification¶
The curl call returns Hello, Azure.
Next Steps¶
You now have local parity and can deploy to Premium (EP1).
Next: 02 - First Deploy
See Also¶
- Tutorial Overview & Plan Chooser
- PowerShell Language Guide
- Platform: Hosting Plans
- Operations: Deployment
- Recipes Index