Hi @DSenthil ,
Thankyou for Your Response.
As You mentioned DEPLOYMENT_TARGET
works reliably and Subfolder deployments are successful when DEPLOYMENT_TARGET
is set as an app setting.
--target-path
fails while Using --target-path
directly results in an error ("Invalid directory name").
- Continue using
DEPLOYMENT_TARGET
for Subfolder Deployments.SetDEPLOYMENT_TARGET
as an app setting before deployment.
az webapp config appsettings set \
--name <WEBAPP_NAME> \
--resource-group <RESOURCE_GROUP> \
--settings "DEPLOYMENT_TARGET=C:/home/site/wwwroot/<subfolder>"
az webapp deploy \
--resource-group <RESOURCE_GROUP> \
--name <WEBAPP_NAME> \
--src-path <SOURCE_ZIPFILE> \
--clean true
- Update the
DEPLOYMENT_TARGET
dynamically in the pipeline before deployment.
Avoidsh """ az webapp config appsettings set \ --name ${WEBAPP_NAME} \ --resource-group ${RESOURCE_GROUP} \ --settings "DEPLOYMENT_TARGET=${targetPath}" az webapp deploy \ --resource-group ${RESOURCE_GROUP} \ --name ${WEBAPP_NAME} \ --src-path ${SOURCE_ZIPFILE} \ --clean true """ sh """ az webapp config appsettings set \ --name ${WEBAPP_NAME} \ --resource-group ${RESOURCE_GROUP} \ --settings "DEPLOYMENT_TARGET=${targetPath}" az webapp deploy \ --resource-group ${RESOURCE_GROUP} \ --name ${WEBAPP_NAME} \ --src-path ${SOURCE_ZIPFILE} \ --clean true """
--target-path
Until Resolved this parameter is unreliable; raise a GitHub issue with Azure CLI for further investigation.
Azure App Service - Configure App Settings
Azure Web App Deployment CLI Docs
Azure Deployment Logs and Troubleshooting
You can mark it 'Accept Answer' and 'Upvote' if this helped you