Deployments with Managed Identity slow

Muriuki, Levi M 246 Reputation points
2022-11-08T21:20:27.793+00:00

It takes up to 11 minutes to deploy applications with managed identity/ARM template with 'UnmonitoredAuto' upgrade mode. Without the managed identity, it takes an average of 3 minutes. What gives? Is there a way to make the deployments go faster? I tried setting recreateApplication to true, and it took about 7 minutes, which is still not great for DEV deployments. I understand the monitored upgrade is good for PROD scenarios to avoid downtime. But for lower environments it would be nice if deployments went by fast.

258491-150881622-e244e360-972b-4e3a-aaea-a5b48294f5be.png

We used to use this Azure pipelines extension to deploy and it had this 'Overwrite behavior' setting to remove application, but I could not find a similar setting in ARM:

258415-image.png

We have our package files in a storage account.

Here's the ARM template:

   "resources": [  
       {  
         "apiVersion": "2021-06-01",  
         "type": "Microsoft.ServiceFabric/clusters/applicationTypes",  
         "name": "[concat(parameters('sf_ClusterName'), '/', parameters('sf_MS_typeName'))]",  
         "location": "[resourceGroup().location]",  
         "dependsOn": [],  
         "properties": {  
         }  
       },  
       {  
         "apiVersion": "2021-06-01",  
         "type": "Microsoft.ServiceFabric/clusters/applicationTypes/versions",  
         "name": "[concat(parameters('sf_ClusterName'), '/', parameters('sf_MS_typeName'), '/', parameters('sf_MS_typeVersion'))]",  
         "location": "[resourceGroup().location]",  
         "dependsOn": [  
           "[concat('Microsoft.ServiceFabric/clusters/', parameters('sf_ClusterName'), '/applicationTypes/', parameters('sf_MS_typeName'))]"  
         ],  
         "properties": {  
           "appPackageUrl": "[concat(parameters('appPackageBaseUrl'), parameters('appPackageSasToken'))]"  
         }  
       },  
       {  
         "name": "[parameters('sf_MS_managedIdentityName')]",  
         "type": "Microsoft.ManagedIdentity/userAssignedIdentities",  
         "apiVersion": "2018-11-30",  
         "tags": {  
           "resourceType": "Service Fabric",  
           "displayName": "Managed Identity",  
         },  
         "location": "[resourceGroup().location]"  
       },  
       {  
         "apiVersion": "2019-11-01-preview",  
         "type": "Microsoft.ServiceFabric/clusters/applications",  
         "name": "[concat(parameters('sf_ClusterName'), '/', parameters('sf_MS_name'))]",  
         "location": "[resourceGroup().location]",  
         "dependsOn": [  
           "[concat('Microsoft.ServiceFabric/clusters/', parameters('sf_ClusterName'), '/applicationTypes/', parameters('sf_MS_typeName'), '/versions/', parameters('sf_MS_typeVersion'))]",  
           "[resourceId('Microsoft.ManagedIdentity/userAssignedIdentities/', parameters('sf_MS_managedIdentityName'))]"  
         ],  
         "identity": {  
           "type": "userAssigned",  
           "userAssignedIdentities": {  
             "[resourceId('Microsoft.ManagedIdentity/userAssignedIdentities/', parameters('sf_MS_managedIdentityName'))]": {}  
           }  
         },  
         "properties": {  
           "typeName": "[parameters('sf_MS_typeName')]",  
           "typeVersion": "[parameters('sf_MS_typeVersion')]",  
           "parameters": "[parameters('applicationParameters')]",  
           "managedIdentities": [  
             {  
               "name": "[parameters('sf_MS_managedIdentityName')]",  
               "principalId": "[reference(resourceId('Microsoft.ManagedIdentity/userAssignedIdentities/', parameters('sf_MS_managedIdentityName')), '2018-11-30').principalId]"  
             }  
           ],  
           "upgradePolicy": {  
             "upgradeMode": "UnmonitoredAuto"  
           }  
         }  
       }  
     ]  
Azure Service Fabric
Azure Service Fabric
An Azure service that is used to develop microservices and orchestrate containers on Windows and Linux.
252 questions
{count} votes

1 answer

Sort by: Most helpful
  1. JimmySalian-2011 41,916 Reputation points
    2022-11-08T21:34:11.527+00:00

    Hi M,

    I can suggest you can try to throttle the Cluster configuration and try out the deployment process, you will need to tune it to speed up the process as your setting up cluster applications. I suspect load on the clusters could be slowing down. Check this page for detailed information service-fabric-cluster-resource-manager-advanced-throttling

    Alco check out the capacity and scaling recommendations that might help to navigate this issue.

    Hope this helps.
    JS

    ==
    Please Accept the answer if the information helped you. This will help us and others in the community as well.

    0 comments No comments