| title | Quickstart: Deploy Managed Instance on Azure App Service (Preview) | |||||||
|---|---|---|---|---|---|---|---|---|
| description | Learn how to configure Managed Instance on Azure App Service | |||||||
| author | msangapu-msft | |||||||
| ms.author | msangapu | |||||||
| ms.reviewer | maghan | |||||||
| ms.date | 11/18/2025 | |||||||
| ms.service | azure-app-service | |||||||
| ms.topic | quickstart | |||||||
| keywords |
|
Managed Instance on Azure App Service combines the simplicity of platform as a service with the flexibility of infrastructure-level control. Managed Instance is designed for applications that require plan-level isolation, customization, and secure network integration.
[!INCLUDE managed-instance]
In this quickstart, you complete the following steps:
- Use Azure Developer CLI to deploy sample resources.
- Create a Managed Instance on Azure App Service (preview).
- Deploy a sample app.
- Verify the deployment.
-
Azure account: You need an Azure account with an active subscription. If you don't already have one, you can create an account for free.
-
Access to the approved regions: During preview, regions for Managed Instance include: East Asia, East US, North Europe, and West Central US. More regions to follow.
-
Quickstart: Upload, download, and list blobs with the Azure portal
-
Configuration (install) scripts (PowerShell script named
Install.ps1) in a compressed .zip file
You can quickly deploy all the necessary resources in this quickstart using Azure Developer CLI (AZD). The AZD template used in this quickstart is from Azure samples. Just run the following commands in the Azure Cloud Shell, and follow the prompts:
mkdir managed-instance-quickstart
cd managed-instance-quickstart
azd init --template https://github.com/Azure-Samples/managed-instance-azure-app-service-quickstart.git
azd env set AZURE_LOCATION northeurope
azd upThe azd up command does the following actions:
- Creates a user-assigned managed identity.
- Creates an Azure Storage Blob.
- Assigns the managed identity to the storage container and Managed Instance plan.
- Grants Storage-Blob-Data-Contributor access on the storage container.
- Compresses included fonts and Install.ps1 into scripts.zip.
- Upload scripts.zip to the storage container.
Note
The configuration script package (scripts.zip) deployed with the sample resources contains Install.ps1, which copies Microsoft Aptos font files into C:\Windows\Fonts. The sample app you deploy later renders text into an image using these fonts. This process demonstrates how a Managed Instance configuration (install) script can lay down OS-level or framework dependencies before app code runs.
The following PowerShell code is the configuration (install) script used in the template.
# Install.ps1 - Copy and register fonts on Managed Instance
Write-Host "Installing custom fonts on Managed Instance..." -ForegroundColor Green
# Copy all TTF and OTF fonts to Windows Fonts folder and register them
Get-ChildItem -Recurse -Include *.ttf, *.otf | ForEach-Object {
$FontFullName = $_.FullName
$FontName = $_.BaseName + " (TrueType)"
$Destination = "$env:windir\Fonts\$($_.Name)"
Write-Host "Installing font: $($_.Name)"
Copy-Item $FontFullName -Destination $Destination -Force
New-ItemProperty -Path "HKLM:\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Fonts" -Name $FontName -PropertyType String -Value $_.Name -Force | Out-Null
}
Write-Host "Font installation completed." -ForegroundColor GreenThe final output of azd up should look similar to the following example.
=== Deployment Complete ===
Storage Account: stgpjqep6fdlfv6
Container Name: scripts
Managed Identity Client name: id-gpjqep6fdlfv6
Resource Group: rg-managed-instance
The values for Storage Account, Container Name, Managed Identity Client name, Resource Group, and Script URI are used later.
Follow these steps to create a Managed Instance plan and deploy an app to it:
- Sign in to the Azure portal.
- Select + Create a resource.
- Search for managed instance
- Select Web App (for Managed Instance) (preview) in the results.
- Select Create to start the create process.
- On the Basic tab, provide the following details.
| Setting | Value |
|---|---|
| Subscription | Your Azure subscription |
| Resource Group | rg-managed-instance |
| Setting | Value |
|---|---|
| Name | contoso-mi-app |
| Runtime stack | ASPNET V4.8 |
| Region | A region near you |
| Setting | Value |
|---|---|
| Windows Plan | Use default plan or create new (for example, 'contoso-mi-plan') |
| Pricing plans* | Select a pricing plan. If Pv4 or Pmv4 isn't visible in pricing plans, confirm region availability or request more quota. |
On the Advanced tab, provide the following details.
| Setting | Value |
|---|---|
| Storage Account | Use default plan or create new (for example, 'contoso-mi-plan') |
| Container | scripts |
| Zip file | scripts.zip |
| Value | Verify the .zip URL is correct |
| Identity | Select the managed identity that was created earlier |
- Select Review + create and then select Create.
- The following command creates the Managed Instance plan with a configuration (install) script.
az deployment group create \
--resource-group "<resource-group-name>" \
--template-file infra/app-service-plan-managed-instance.json \
--parameters \
location="<location>" \
appServicePlanName="<plan-name>" \
userAssignedIdentityResourceId="<identity-id>" \
installScriptSourceUri="<script-URI>" \
skuName=P1V4 \
skuCapacity=1Deployment takes several minutes while resources provisioned.
- The following command creates a web app on the Managed Instance plan.
az webapp create \
--name "<app-name>" \
--resource-group "<resource-group-name>" \
--plan "<plan-name>" \
--runtime "ASPNET:V4.8"- The following command assigns a Managed Identity to the web app.
az webapp identity assign \
--name "<app-name>" \
--resource-group "<resource-group-name>" \
--identities "<identity-id>"In this step, you use Cloud Shell to deploy a sample app that was included in the AZD template to Managed Instance.
- The following command deploys the web app to your Managed Instance plan. Update
<app-name>and<resource-group>with your values.
az webapp deploy \
--resource-group "<resource-group-name>" \
--name "<app-name>" \
--src-path app.zip \
--type zipTo browse to the created app, select the default domain in the Overview page.
The .NET app is running on a Managed Instance plan. The app uses fonts from C:\Windows\Fonts directory.
:::image type="content" source="media/quickstart-managed-instance/browse-app-hello-world.png" alt-text="Screenshot that shows the sample app using C:\Windows\Fonts\Aptos.TTF.":::
To manage your web app, go to the Azure portal, and search for and select App Services.
On the App Services page, select the name of your web app.
On the Overview page, select the name of your App Service plan. Under Current App Service plan, select the plan name.
In the left menu under Settings, select Configuration to view the configuration details.
In the preceding steps, you created Azure resources in a resource group. If you don't expect to need these resources in the future, you can delete them by deleting the resource group.
- From your web app's Overview page in the Azure portal, select the myResourceGroup link under Resource group.
- On the resource group page, make sure that the listed resources are the ones you want to delete.
- Select Delete resource group, type myResourceGroup in the text box, and then select Delete.
- Confirm again by selecting Delete.
az group delete