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.
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:
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"
}
}
}
]