Open larry-lau opened 1 year ago
Thanks for reporting Larry 👍 Let me route this to the ARM team. At the meantime, could you share the template and the PowerShell script to start the deployment? (Be sure to remove sensitive information).
Thanks for the feedback! We are routing this to the appropriate team for follow-up. cc @satyavel, @apclouds.
Author: | larry-lau |
---|---|
Assignees: | - |
Labels: | `Service Attention`, `question`, `ARM - Templates`, `customer-reported` |
Milestone: | - |
Here is my template and powershell command
{
"name": "[variables('adminCenterAppName')]",
"type": "Microsoft.Web/sites",
"apiVersion": "2022-03-01",
"location": "[parameters('location')]",
"dependsOn": [
"[resourceId(parameters('hostingPlanGroup'), 'Microsoft.Web/serverfarms', parameters('hostingPlanName'))]"
],
"identity": {
"type": "UserAssigned",
"userAssignedIdentities": {
"[resourceId('Microsoft.ManagedIdentity/userAssignedIdentities', variables('managedIdentityName'))]": {}
}
},
"properties": {
"serverFarmId": "[resourceId(parameters('hostingPlanGroup'), 'Microsoft.Web/serverfarms', parameters('hostingPlanName'))]",
"httpsOnly": true,
"siteConfig": {
"alwaysOn": true,
"appSettings": [
]
}
},
"tags": {
"displayName": "AppService"
}
},
{
"type": "Microsoft.Web/sites/config",
"apiVersion": "2022-03-01",
"name": "[concat(variables('adminCenterAppName'), '/web')]",
"location": "[parameters('location')]",
"dependsOn": [
"[resourceId('Microsoft.Web/sites', variables('adminCenterAppName'))]"
],
"tags": {
"displayName": "AppService Config"
},
"properties": {
"numberOfWorkers": 1,
"netFrameworkVersion": "v7.0",
"use32BitWorkerProcess": false,
"webSocketsEnabled": false,
"alwaysOn": true,
"http20Enabled": true,
"minTlsVersion": "1.2"
}
}
New-AzResourceGroupDeployment -Name ((Get-ChildItem $TemplateFile).BaseName + '-' + ((Get-Date).ToUniversalTime()).ToString('MMdd-HHmm')) -ResourceGroupName $ResourceGroupName
-TemplateFile $TemplateFile -TemplateParameterFile $TemplateParametersFile
@OptionalParameters -Force -Verbose
-ErrorVariable ErrorMessages
Description
Every time I run New-AzResourceGroupDeployment on an existing app service, the code on the app service seems to be wiped. I have to publish my dotnet code again after each deployment. Is there a way to keep the code between ARM deployment?
Script or Debug output
No response
Environment data
Module versions
Error output
No response