az functionapp create: Create a Function App
az functionapp create provisions an Azure Functions app on a consumption or premium plan.
Serverless deploys start with a function app backed by a storage account. functionapp create wires the two together and sets the runtime stack.
What it does
az functionapp create provisions a Functions app, attaching a storage account for runtime state and choosing a hosting plan. On consumption you pass --consumption-plan-location; the runtime stack and version come from --runtime and --functions-version.
Common usage
az functionapp create \
--resource-group rg-app --name func-ci \
--storage-account stappci20260630 \
--consumption-plan-location eastus \
--runtime node --runtime-version 20 \
--functions-version 4Subcommands and flags
| Flag | What it does |
|---|---|
| --name, -n | Function app name (global hostname) |
| --storage-account | Backing storage account |
| --consumption-plan-location | Region for a consumption plan |
| --runtime | node, python, dotnet, java, etc. |
| --runtime-version | Stack version, e.g. 20 for Node |
| --functions-version | Functions host version, e.g. 4 |
In CI
Create the storage account first; the function app depends on it. After creation, set app settings with az webapp config appsettings set (function apps share that surface) and deploy code with a publish step. The identity needs Contributor on the group.
Common errors in CI
"Storage account ... not found" means --storage-account is wrong or in another group. "WebsiteName ... is not available" means the global name is taken. A bad --runtime-version for the chosen --functions-version is rejected with an unsupported combination error; check the supported matrix.