Note
Access to this page requires authorization. You can try signing in or changing directories.
Access to this page requires authorization. You can try changing directories.
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.
Important
Managed Instance is in preview, available for Windows web apps in select regions, and limited to Pv4 and Pmv4 pricing plans. More regions to follow. Linux and containers aren't supported.
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.
Prerequisites
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
Deploy sample resources
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 up
The 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 Green
The 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.
Deploy a Managed Instance plan
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.
Project details
| Setting | Value |
|---|---|
| Subscription | Your Azure subscription |
| Resource Group | rg-managed-instance |
App details
| Setting | Value |
|---|---|
| Name | contoso-mi-app |
| Runtime stack | ASPNET V4.8 |
| Region | A region near you |
Pricing plans
| 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.
Configuration (install) script
| 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.
Deploy a sample app to Managed Instance
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 zip
Browse to the app
To 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.
Manage the Managed Instance plan
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.
Clean up resources
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.