question

CosminStirbu-1831 avatar image
0 Votes"
CosminStirbu-1831 asked Christian-8189 commented

[Azure WebApp] Copy Production Slot into Staging Slot

Hello,

I'm trying to use https://docs.microsoft.com/en-us/rest/api/appservice/web-apps/copy-production-slot however I'm receiving the following error:

 Bad Request({"Code":"BadRequest","Message":"Clone into Production slot not supported.","Target":null,"Details":[{"Message":"Clone into Production slot not supported."},{"Code":"BadRequest"},{"ErrorEntity":{"ExtendedCode":"04237","MessageTemplate":"Clone into Production slot not supported.","Parameters":[],"Code":"BadRequest","Message":"Clone into Production slot not supported."}}],"Innererror":null})


This is the actual call

az rest --method post --url https://management.azure.com/subscriptions/{...}/resourceGroups/{...}/providers/Microsoft.Web/sites/{...}/slotcopy?api-version=2019-08-01 --body "{\"targetSlot\": \"staging\"}"

Thank you,
Cosmin

azure-webapps
· 1
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

Hi @CosminStirbu-1831,

Thanks for brining this to our attention. I am checking internally with the engineering team to see if this is a known issue. I will update this thread once I hear back from them

Grace

0 Votes 0 ·
Grmacjon-MSFT avatar image
0 Votes"
Grmacjon-MSFT answered CosminStirbu-1831 commented

Hi @CosminStirbu-1831,

The engineering team confirmed you can only copy from production to staging slots, or from a staging slot to another non-prod slot but not from staging into prod slot (which is why you're getting that error). It’s to prevent you from accidentally copying over your production config and losing it.

The API you shared is there so you can copy content and config from one slot into a new slot, or after swapping into production, you can copy production content and config back into the staging environment.

Hope that helps. Please let us know if you have further questions.

-Grace

· 3
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

Hi @Grmacjon-MSFT - any news on this?

1 Vote 1 ·

Hi @Grmacjon-MSFT ,

The API I have shared is named "Web Apps - Copy Production Slot". This is exactly what I'm trying to do, I try to copy content and config from Production slot to a Staging slot.

What API should I use to copy content and config from a Production slot to a Staging slot if the one that I'm trying to use doesn't do what it is documented that it does?

Thank you,
Cosmin

0 Votes 0 ·

I have tried with the same Sample Request (updated the path parameters with my own resources) https://docs.microsoft.com/en-us/rest/api/appservice/web-apps/copy-production-slot#copy-slot and I get the same error.

0 Votes 0 ·
jdomian-5379 avatar image
0 Votes"
jdomian-5379 answered Christian-8189 commented

This would be super helpful to in a sense duplicate a production slot as a new deploy slot. Right now we currently have to use a "dual FTP" browser I run on my local machine to simply copy production slots to deploy slots. This take a very long time and consumes bandwidth. Then that way we can make production pushes, test them in the deploy slot, then swap them out without any downtime and the ability to revert quick.

I tried this and got the same error as above that "Clone into Production slot not supported." But I am not trying to clone "into" a production slot, I am trying to "Copy & Paste" production into a new slot with all of its contents to go with it.
https://docs.microsoft.com/en-us/rest/api/appservice/web-apps/copy-slot-slot#code-try-0

· 2
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

Having the same problem.

0 Votes 0 ·

I am having the same issue using the try me option I am trying to copy the production deployment into a slot but it keeps giving me the same error
{
"Code": "BadRequest",
"Message": "Clone into Production slot not supported.",
"Target": null,
"Details": [
{
"Message": "Clone into Production slot not supported."
},
{
"Code": "BadRequest"
},
{
"ErrorEntity": {
"ExtendedCode": "04237",
"MessageTemplate": "Clone into Production slot not supported.",
"Parameters": [],
"Code": "BadRequest",
"Message": "Clone into Production slot not supported."
}
}
],
"Innererror": null
}

0 Votes 0 ·