I want to use REST API Web Apps – Create One Deploy Operation (https://learn.microsoft.com/en-us/rest/api/appservice/web-apps/create-one-deploy-operation) to deploy to slot in Azure Web App.
I don’t see how to do that. Has someone already faced that?
Thank you!
2
Answers
I actually succeeded into deploying to slot with onedeploy with the following REST API call:
az rest --method PUT --uri https://management.azure.com/subscriptions/<SUBSCRIPTION_ID>/resourceGroups/<RESOURCE_GROUP_NAME>/providers/Microsoft.Web/sites/<AZURE_WEB_APP_NAME>/slots/<SLOT_NAME>/extensions/onedeploy?api-version=2022-03-01 --body '{"properties": {"type": "zip", "packageUri": "'"<PACKAGE_URI>"'"}}'
Need to check below:
Sometimes, web applications will run out of storage capacity while being deployed to any of the slots. In this case, verify the disk space and remove the cache as well as detailed in the blog by @Feng Lu. After that, try to complete the deployment with
one deploy
operation.Goto
Advance editor
. Openkudu
in the browser and go tosite extensions
, search forDisk usage
.Add this to your environment to verify the disk usage and the available space for the deployments.
MSDeploy operation:
Rather than using
one deploy
operation, I would suggest you useMSDeploy
operation as detailed below.One deploy
focuses primarily on simple applications. You can deploy web apps by simply uploading a zip package along with the package URL.MSDeploy
operations work for large and complicated deployments with the specified configurations in the similar way.Request type:
PUT
API call URL:
Request body:
Below are the required parameters to be passed:
Response status:
Once it is succeeded, I checked in the
kudu files -> site extensions
and it displayed the contents as expected.Refer MSDoc for the relevant information.