Deployment Failure of Private Endpoint via Managed Application or ARM template
Purpose:
The purpose of this blog is to share the one of the failure scenarios that users may encounter during the deployment of Private Endpoint via Managed Application or ARM template.
Symptom:
In complete mode (Deployment modes - Azure Resource Manager | Microsoft Learn), the resources in resource group that are not specified in the template will be deleted by Resource Manager. However, during the deployment of Private Endpoint, the Network Interface (NIC) is being generated automatically as a separate resource with random given name so this means that this NIC cannot be defined in the template. As a result, the NIC is not defined in the ARM template will be deleted in the complete mode of deployment, while this action will be blocked because the Private Endpoint is currently referencing this NIC.
As Managed Application uses complete mode for deployment as default, when deploying the Private Endpoint via Managed Application, the deployment would fail in the end. Users may see the similar symptom when deploying standalone Private Endpoint via ARM template using complete mode.
Users could view Activity log to check the details. For example, regarding the deployment of Managed Application, access related managed resource group and the problematic request would be displayed under the "Create Deployment" operation.
1.Click and expand the "Create Deployment" operation.
2.There would be several operations named as "Delete Network Interface" failed with below error.
Network interface /subscriptions/a2d49d28-xxxx-xxxx-xxxx-ada50a035a99/resourceGroups/moshiapp/providers/Microsoft.Network/networkInterfaces/moshitest1pe.nic.3b6f36a1-98e5-4d04-a165-91156eaa9fe2 cannot be deleted because it is currently in use with an private endpoint (/subscriptions/a2d49d28-xxxx-xxxx-xxxx-ada50a035a99/resourceGroups/moshiapp/providers/Microsoft.Network/privateEndpoints/moshitest1
Mitigation Plan:
For Managed Application deployment, users can update the deployment mode from complete mode to incremental mode via REST API.
1.Calling a GET request to retrieve the current configuration setting of the managed application definition in JSON format from response body: Application Definitions - Get - REST API (Azure Managed Applications) | Microsoft Learn.
The below is a sample response which could be modified to update the deployment mode.
{
"properties": {
"notificationPolicy": {
"notificationEndpoints": []
},
"lockingPolicy": {
"allowedActions": [],
"allowedDataActions": []
},
"deploymentPolicy": {
"deploymentMode": "Complete"
},
"authorizations": [],
"isEnabled": true,
"lockLevel": "None",
"managementPolicy": {
"mode": "Managed"
},
"displayName": "moshinicinuse",
"description": "nic in use",
"artifacts": [
{
"name": "ApplicationResourceTemplate",
"type": "Template",
"uri": "xxx"
},
{
"name": "CreateUiDefinition",
"type": "Custom",
"uri": "xxx"
},
{
"name": "MainTemplateParameters",
"type": "Custom",
"uri": "xxx"
}
]
},
"id": "/subscriptions/xxx/resourceGroups/moshiappDefinitionGroup/providers/Microsoft.Solutions/applicationDefinitions/moshinicinuse",
"name": "moshinicinuse",
"type": "Microsoft.Solutions/applicationDefinitions",
"location": "eastus"
}
2.Modify the configuration setting as below:
- Change the deployment mode from "Complete" to "Incremental".
- Add the "packageFileUri" element (including the application package URI) under properties.
- Remove the "id", "name", and "type" elements.
{
"properties": {
"notificationPolicy": {
"notificationEndpoints": []
},
"lockingPolicy": {
"allowedActions": [],
"allowedDataActions": []
},
"deploymentPolicy": {
"deploymentMode": "Incremental"
},
"packageFileUri": "https://xxx.blob.core.windows.net/test/xxx.zip",
"authorizations": [],
"isEnabled": true,
"lockLevel": "None",
"managementPolicy": {
"mode": "Managed"
},
"displayName": "moshinicinuse",
"description": "nic in use",
"artifacts": [
{
"name": "ApplicationResourceTemplate",
"type": "Template",
"uri": "xxx"
},
{
"name": "CreateUiDefinition",
"type": "Custom",
"uri": "xxx"
},
{
"name": "MainTemplateParameters",
"type": "Custom",
"uri": "xxx"
}
]
},
"location": "eastus"
}
3.Copy the above modified configuration and paste in the request body when calling PUT request to update the application definition: Application Definitions - Create Or Update - REST API (Azure Managed Applications) | Microsoft Learn.
4.Calling the GET request again to double check if the deployment mode has been changed.
5. Deploy the Managed App again.
Reference:
Deployment modes - Azure Resource Manager | Microsoft Learn
Application Definitions - Get - REST API (Azure Managed Applications) | Microsoft Learn
Application Definitions - Create Or Update - REST API (Azure Managed Applications) | Microsoft Learn
Published on:
Learn moreRelated posts
Azure Storage - TLS 1.0 and 1.1 retirement
Overview TLS 1.0 and 1.1 retirement on Azure Storage was previously announced for Nov 1st, 2024, and it was postponed recently to 1 year later...
Efficient Management of Append and Page Blobs Using Azure Storage Actions
Overview In Azure Storage, Blob Lifecycle Management (BLM) allows you to automate the management of your data based on rules defined by...
[Azure AI Search] Internal Server Error when creating CMK encrypted objects
Scenario Customers follow the Microsoft doc to create CMK encrypted objects (data source, index etc.), but get the 500 Internal Serv...
Optimizing Azure Table Storage: Automated Data Cleanup using a PowerShell script with Azure Automate
Scenario This blog’s aim is to manage Table Storage data efficiently. Imagine you have a large Azure Table Storage that accumulates logs from ...
Optimizing Azure Table Storage: Automated Data Clean-up using a PowerShell script with Azure Automat
Scenario This blog’s aim is to manage Table Storage data efficiently. Imagine you have a large Azure Table Storage that accumulates logs from ...
Restoring Soft-Deleted Blobs with multithreading in Azure Storage Using C#
Blob soft delete is an essential feature that safeguards your data against accidental deletions or overwrites. By retaining deleted data for a...
Performing simple Azure Table Storage REST API operations using curl command.
The blog provides guidance to perform simple Table Storage REST API operations such as Create table, Delete Table, Insert entity, Delete entit...
Bulk delete all the old jobs from the batch account
Deleting a Job also deletes all Tasks that are part of that Job, and all Job statistics. This also overrides the retention period for Task dat...
Utilizing Azure Storage and Runbooks for scheduled automated backups of Azure SQL Databases
In this article, we are going to provide detailed steps to create a scheduled Azure SQL Database backup to storage account using automation. T...
[Azure Service Bus] JMS messages getting dead-lettered
The article discusses a problem where numerous messages end up in the dead letter queue (DLQ) when the JMS service bus consumer connects to th...