Azure Web App - Create One Deploy Operation to Slot

404 views Asked by At

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

There are 2 answers

2
Jahnavi On

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. Open kudu in the browser and go to site extensions, search for Disk usage.

enter image description here

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 use MSDeploy 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:

https://management.azure.com/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/extensions/MSDeploy?api-version=2022-03-01

Request body:

{
  "kind": "Microsoft.Web/sites",
  "properties":{}
}

Below are the required parameters to be passed:

enter image description here

Response status:

enter image description here

Once it is succeeded, I checked in the kudu files -> site extensions and it displayed the contents as expected.

enter image description here

Refer MSDoc for the relevant information.

0
Bertrand Pons On

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>"'"}}'