02 - First Deploy (Premium)¶
Deploy a Python Function App to an Elastic Premium plan (EP1) with always-warm instances, then publish code and verify the app is live.
Prerequisites¶
- You completed 01 - Run Locally.
- You are signed in to Azure CLI and have Contributor access.
- You already exported:
$RG,$APP_NAME,$PLAN_NAME,$STORAGE_NAME,$LOCATION(usekoreacentralfor this guide).
What You'll Build¶
- A Linux Python Function App on Elastic Premium (
EP1) with runtime settings. - Always-warm instances for production latency requirements.
- A first deployment pipeline (
func azure functionapp publish) and endpoint verification.
Network Scenario Choices
This tutorial deploys with public networking. Premium supports VNet integration:
| Scenario | Description | Guide |
|---|---|---|
| Public Only | No VNet (this tutorial) | Current page |
| Private Egress | VNet + Storage PE | Private Egress |
| Private Ingress | + Site Private Endpoint | Private Ingress |
| Fixed Outbound IP | + NAT Gateway | Fixed Outbound |
Looking for a complete private networking deployment? See 02 - First Deploy (Private Networking).
Infrastructure Context
Plan: Premium (EP1) | Network: Public (VNet optional) | Always warm: ✅
Premium deploys with pre-warmed instances, Azure Files content share for deployment, and optional VNet integration. Storage uses connection string authentication by default.
flowchart TD
INET[Internet] -->|HTTPS| FA[Function App\nPremium EP1\nLinux Python 3.11]
subgraph PLAN["Elastic Premium Plan"]
FA
WARM["Pre-warmed instances\nMin: 1"]
end
FA --> ST["Storage Account\nAzure Files content share"]
FA --> AI[Application Insights]
FA -.->|System-Assigned MI| ENTRA[Microsoft Entra ID]
style FA fill:#ff8c00,color:#fff
style PLAN fill:#E8F5E9,stroke:#4CAF50
style ST fill:#FFF3E0
style WARM fill:#FFF3E0,stroke:#FF9800 Steps¶
-
Set environment variables for the deployment.
export RG="rg-func-python-prem-demo" export LOCATION="koreacentral" export STORAGE_NAME="stpyprem0411" export PLAN_NAME="plan-pyprem-04110001" export APP_NAME="func-pyprem-04110001"Command/Parameter Purpose export RG="..."Sets the resource group name for the deployment. export LOCATION="..."Chooses the Azure region for the deployment. export STORAGE_NAME="..."Defines a unique name for the storage account. export PLAN_NAME="..."Sets the name for the Elastic Premium plan. export APP_NAME="..."Defines a globally unique name for the Function App. Globally unique names required
Both
$APP_NAMEand$STORAGE_NAMEmust be globally unique across all Azure subscriptions. If you get a naming conflict, append a random suffix (e.g.,func-pyprem-04111234). -
Authenticate and set subscription context.
Command/Parameter Purpose az loginAuthenticates your CLI session with Azure. az account set --subscriptionTargets the specific Azure subscription for resource creation. -
Create resource group.
Command/Parameter Purpose az group createProvisions a new Azure resource group container. --name "$RG"Specifies the resource group name. --location "$LOCATION"Sets the geographical region for the group. Expected output (abridged):
-
Create storage account.
az storage account create \ --name "$STORAGE_NAME" \ --resource-group "$RG" \ --location "$LOCATION" \ --sku "Standard_LRS" \ --kind "StorageV2" \ --allow-blob-public-access falseCommand/Parameter Purpose az storage account createProvisions a new Azure Storage account. --sku "Standard_LRS"Selects locally-redundant storage for cost-efficiency. --kind "StorageV2"Uses the general-purpose v2 storage account type. --allow-blob-public-access falseDisables public access to blobs for better security. Expected output (abridged):
-
Create the Premium plan (EP1, Linux).
az functionapp plan create \ --name "$PLAN_NAME" \ --resource-group "$RG" \ --location "$LOCATION" \ --sku "EP1" \ --is-linuxCommand/Parameter Purpose az functionapp plan createProvisions an Elastic Premium hosting plan. --sku "EP1"Selects the entry-level Premium tier. --is-linuxConfigures the plan for Linux-based workers. Expected output (abridged):
-
Create the Function App on the Premium plan.
az functionapp create \ --name "$APP_NAME" \ --resource-group "$RG" \ --plan "$PLAN_NAME" \ --storage-account "$STORAGE_NAME" \ --runtime "python" \ --runtime-version "3.11" \ --functions-version "4" \ --os-type "Linux"Command/Parameter Purpose az functionapp createProvisions the core Function App resource. --plan "$PLAN_NAME"Links the app to the Elastic Premium plan. --runtime "python"Selects the Python execution environment. --runtime-version "3.11"Pins the Python version to 3.11. --functions-version "4"Uses version 4 of the Azure Functions runtime host. --os-type "Linux"Deploys the app on a Linux infrastructure. Expected output (abridged):
{ "name": "func-pyprem-04110001", "state": "Running", "kind": "functionapp,linux", "defaultHostName": "func-pyprem-04110001.azurewebsites.net" }Application Insights auto-created
az functionapp createautomatically creates an Application Insights resource with the same name as the function app. TheAPPLICATIONINSIGHTS_CONNECTION_STRINGapp setting is auto-configured.Enterprise policy: Shared key access
Some enterprise subscriptions enforce Azure Policy that sets
allowSharedKeyAccess: falseon all storage accounts. Premium (EP1) requiresWEBSITE_CONTENTAZUREFILECONNECTIONSTRINGwith a connection string that uses shared key access to create the content file share during provisioning. If your subscription has this policy, the Function App creation will fail with a 403 error. Solutions:- Request a policy exemption from your Azure administrator
- Use Flex Consumption (FC1) which supports identity-based blob storage without shared keys
- Use Dedicated (B1) which uses
WEBSITE_RUN_FROM_PACKAGEwithout a content file share
-
Publish the app.
Command/Parameter Purpose cd apps/pythonMoves the terminal into the source code directory. func azure functionapp publishBundles, uploads, and deploys the app source code. Expected output (abridged):
-
Validate deployment.
Command/Parameter Purpose az functionapp function listQueries ARM to retrieve the list of indexed functions. --output tableFormats the function list as a readable text table. Function indexing delay
After the first publish, it may take 30–60 seconds for all functions to appear in the ARM API. If the list is empty, wait and retry.
Expected output (abridged — showing key functions):
Name Language -------------------------------------------- ---------- func-pyprem-04110001/helloHttp python func-pyprem-04110001/health python func-pyprem-04110001/info python func-pyprem-04110001/queueProcessor python func-pyprem-04110001/blobProcessor python func-pyprem-04110001/scheduledCleanup python -
Test the deployed endpoints.
Command/Parameter Purpose curl --request GETSends an HTTP GET request to verify the health endpoint. Expected output:
Command/Parameter Purpose curl --request GETSends an HTTP GET request to verify the hello endpoint. Expected output:
Verification¶
The output confirms that Azure indexed your function definitions and the app serves requests. Verify:
az functionapp function listshows functions with languagepythoncurlto the health endpoint returns200 OKwith{"status":"healthy",...}curlto/api/hello/Azurereturns{"message":"Hello, Azure"}
Next Steps¶
- Add VNet integration: See Private Egress for VNet + Storage PE
- Full private deployment: See 02 - First Deploy (Private Networking)
See Also¶
- Tutorial Overview & Plan Chooser
- Python Language Guide
- Platform: Hosting Plans
- Operations: Deployment
- Recipes Index