Web Apps - Copy Production Slot

Copies a deployment slot to another deployment slot of an app.

POST https://management.azure.com/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slotcopy?api-version=2020-10-01

URI Parameters

Name In Required Type Description
name
path True

string

Name of the app.

resourceGroupName
path True

string

Name of the resource group to which the resource belongs.

Regex pattern: ^[-\w\._\(\)]+[^\.]$

subscriptionId
path True

string

Your Azure subscription ID. This is a GUID-formatted string (e.g. 00000000-0000-0000-0000-000000000000).

api-version
query True

string

API Version

Request Body

Name Required Type Description
siteConfig True

SiteConfig

The site object which will be merged with the source slot site to produce new destination slot site object. null to just copy source slot content. Otherwise a Site object with properties to override source slot site.

targetSlot True

string

Destination deployment slot during copy operation.

Responses

Name Type Description
200 OK

OK.

202 Accepted

Operation is in progress.

Other Status Codes

DefaultErrorResponse

App Service error response.

Security

azure_auth

Azure Active Directory OAuth2 Flow

Type: oauth2
Flow: implicit
Authorization URL: https://login.microsoftonline.com/common/oauth2/authorize

Scopes

Name Description
user_impersonation impersonate your user account

Examples

Copy slot

Sample Request

POST https://management.azure.com/subscriptions/34adfa4f-cedf-4dc0-ba29-b6d1a69ab345/resourceGroups/testrg123/providers/Microsoft.Web/sites/tests346/slotcopy?api-version=2020-10-01

{
  "targetSlot": "staging",
  "siteConfig": {
    "numberOfWorkers": 1,
    "httpLoggingEnabled": true
  }
}

Sample Response

Definitions

Name Description
ApiDefinitionInfo

Information about the formal API definition for the app.

ApiManagementConfig

Azure API management (APIM) configuration linked to the app.

AutoHealActions

Actions which to take by the auto-heal module when a rule is triggered.

AutoHealActionType

Predefined action to be taken.

AutoHealCustomAction

Custom action to be executed when an auto heal rule is triggered.

AutoHealRules

Rules that can be defined for auto-heal.

AutoHealTriggers

Triggers for auto-heal.

ConnectionStringType

Type of database.

ConnStringInfo

Database connection string information.

CorsSettings

Cross-Origin Resource Sharing (CORS) settings for the app.

createdByType

The type of identity that created the resource.

CsmCopySlotEntity

Copy deployment slot parameters.

DefaultErrorResponse

App Service error response.

Details
Error

Error model.

Experiments

Routing rules in production experiments.

FtpsState

State of FTP / FTPS service

HandlerMapping

The IIS handler mappings used to define which handler processes HTTP requests with certain extension. For example, it is used to configure php-cgi.exe process to handle all HTTP requests with *.php extension.

IpFilterTag

Defines what this IP filter will be used for. This is to support IP filtering on proxies.

IpSecurityRestriction

IP security restriction on an app.

ManagedPipelineMode

Managed pipeline mode.

NameValuePair

Name value pair.

PushSettings

Push settings for the App.

RampUpRule

Routing rules for ramp up testing. This rule allows to redirect static traffic % to a slot or to gradually change routing % based on performance.

RequestsBasedTrigger

Trigger based on total requests.

ScmType

SCM type.

SiteConfig

Configuration of an App Service app.

SiteLimits

Metric limits set on an app.

SiteLoadBalancing

Site load balancing.

SiteMachineKey

MachineKey of an app.

SlowRequestsBasedTrigger

Trigger based on request execution time.

StatusCodesBasedTrigger

Trigger based on status code.

SupportedTlsVersions

MinTlsVersion: configures the minimum version of TLS required for SSL requests

systemData

Metadata pertaining to creation and last modification of the resource.

VirtualApplication

Virtual application in an app.

VirtualDirectory

Directory for virtual application.

ApiDefinitionInfo

Information about the formal API definition for the app.

Name Type Description
url

string

The URL of the API definition.

ApiManagementConfig

Azure API management (APIM) configuration linked to the app.

Name Type Description
id

string

APIM-Api Identifier.

AutoHealActions

Actions which to take by the auto-heal module when a rule is triggered.

Name Type Description
actionType

AutoHealActionType

Predefined action to be taken.

customAction

AutoHealCustomAction

Custom action to be taken.

minProcessExecutionTime

string

Minimum time the process must execute before taking the action

AutoHealActionType

Predefined action to be taken.

Name Type Description
CustomAction

string

LogEvent

string

Recycle

string

AutoHealCustomAction

Custom action to be executed when an auto heal rule is triggered.

Name Type Description
exe

string

Executable to be run.

parameters

string

Parameters for the executable.

AutoHealRules

Rules that can be defined for auto-heal.

Name Type Description
actions

AutoHealActions

Actions to be executed when a rule is triggered.

triggers

AutoHealTriggers

Conditions that describe when to execute the auto-heal actions.

AutoHealTriggers

Triggers for auto-heal.

Name Type Description
privateBytesInKB

integer

A rule based on private bytes.

requests

RequestsBasedTrigger

A rule based on total requests.

slowRequests

SlowRequestsBasedTrigger

A rule based on request execution time.

statusCodes

StatusCodesBasedTrigger[]

A rule based on status codes.

ConnectionStringType

Type of database.

Name Type Description
ApiHub

string

Custom

string

DocDb

string

EventHub

string

MySql

string

NotificationHub

string

PostgreSQL

string

RedisCache

string

SQLAzure

string

SQLServer

string

ServiceBus

string

ConnStringInfo

Database connection string information.

Name Type Description
connectionString

string

Connection string value.

name

string

Name of connection string.

type

ConnectionStringType

Type of database.

CorsSettings

Cross-Origin Resource Sharing (CORS) settings for the app.

Name Type Description
allowedOrigins

string[]

Gets or sets the list of origins that should be allowed to make cross-origin calls (for example: http://example.com:12345). Use "*" to allow all.

supportCredentials

boolean

Gets or sets whether CORS requests with credentials are allowed. See https://developer.mozilla.org/en-US/docs/Web/HTTP/CORS#Requests_with_credentials for more details.

createdByType

The type of identity that created the resource.

Name Type Description
Application

string

Key

string

ManagedIdentity

string

User

string

CsmCopySlotEntity

Copy deployment slot parameters.

Name Type Description
siteConfig

SiteConfig

The site object which will be merged with the source slot site to produce new destination slot site object. null to just copy source slot content. Otherwise a Site object with properties to override source slot site.

targetSlot

string

Destination deployment slot during copy operation.

DefaultErrorResponse

App Service error response.

Name Type Description
error

Error

Error model.

Details

Name Type Description
code

string

Standardized string to programmatically identify the error.

message

string

Detailed error description and debugging information.

target

string

Detailed error description and debugging information.

Error

Error model.

Name Type Description
code

string

Standardized string to programmatically identify the error.

details

Details[]

Detailed errors.

innererror

string

More information to debug error.

message

string

Detailed error description and debugging information.

target

string

Detailed error description and debugging information.

Experiments

Routing rules in production experiments.

Name Type Description
rampUpRules

RampUpRule[]

List of ramp-up rules.

FtpsState

State of FTP / FTPS service

Name Type Description
AllAllowed

string

Disabled

string

FtpsOnly

string

HandlerMapping

The IIS handler mappings used to define which handler processes HTTP requests with certain extension. For example, it is used to configure php-cgi.exe process to handle all HTTP requests with *.php extension.

Name Type Description
arguments

string

Command-line arguments to be passed to the script processor.

extension

string

Requests with this extension will be handled using the specified FastCGI application.

scriptProcessor

string

The absolute path to the FastCGI application.

IpFilterTag

Defines what this IP filter will be used for. This is to support IP filtering on proxies.

Name Type Description
Default

string

ServiceTag

string

XffProxy

string

IpSecurityRestriction

IP security restriction on an app.

Name Type Description
action

string

Allow or Deny access for this IP range.

description

string

IP restriction rule description.

headers

object

IP restriction rule headers. X-Forwarded-Host (https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/X-Forwarded-Host#Examples). The matching logic is ..

  • If the property is null or empty (default), all hosts(or lack of) are allowed.
  • A value is compared using ordinal-ignore-case (excluding port number).
  • Subdomain wildcards are permitted but don't match the root domain. For example, *.contoso.com matches the subdomain foo.contoso.com but not the root domain contoso.com or multi-level foo.bar.contoso.com
  • Unicode host names are allowed but are converted to Punycode for matching.

X-Forwarded-For (https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/X-Forwarded-For#Examples). The matching logic is ..

  • If the property is null or empty (default), any forwarded-for chains (or lack of) are allowed.
  • If any address (excluding port number) in the chain (comma separated) matches the CIDR defined by the property.

X-Azure-FDID and X-FD-HealthProbe. The matching logic is exact match.

ipAddress

string

IP address the security restriction is valid for. It can be in form of pure ipv4 address (required SubnetMask property) or CIDR notation such as ipv4/mask (leading bit match). For CIDR, SubnetMask property must not be specified.

name

string

IP restriction rule name.

priority

integer

Priority of IP restriction rule.

subnetMask

string

Subnet mask for the range of IP addresses the restriction is valid for.

subnetTrafficTag

integer

(internal) Subnet traffic tag

tag

IpFilterTag

Defines what this IP filter will be used for. This is to support IP filtering on proxies.

vnetSubnetResourceId

string

Virtual network resource id

vnetTrafficTag

integer

(internal) Vnet traffic tag

ManagedPipelineMode

Managed pipeline mode.

Name Type Description
Classic

string

Integrated

string

NameValuePair

Name value pair.

Name Type Description
name

string

Pair name.

value

string

Pair value.

PushSettings

Push settings for the App.

Name Type Description
id

string

Resource Id.

kind

string

Kind of resource.

name

string

Resource Name.

properties.dynamicTagsJson

string

Gets or sets a JSON string containing a list of dynamic tags that will be evaluated from user claims in the push registration endpoint.

properties.isPushEnabled

boolean

Gets or sets a flag indicating whether the Push endpoint is enabled.

properties.tagWhitelistJson

string

Gets or sets a JSON string containing a list of tags that are in the allowed list for use by the push registration endpoint.

properties.tagsRequiringAuth

string

Gets or sets a JSON string containing a list of tags that require user authentication to be used in the push registration endpoint. Tags can consist of alphanumeric characters and the following: '_', '@', '#', '.', ':', '-'. Validation should be performed at the PushRequestHandler.

systemData

systemData

The system metadata relating to this resource.

type

string

Resource type.

RampUpRule

Routing rules for ramp up testing. This rule allows to redirect static traffic % to a slot or to gradually change routing % based on performance.

Name Type Description
actionHostName

string

Hostname of a slot to which the traffic will be redirected if decided to. E.g. myapp-stage.azurewebsites.net.

changeDecisionCallbackUrl

string

Custom decision algorithm can be provided in TiPCallback site extension which URL can be specified. See TiPCallback site extension for the scaffold and contracts. https://www.siteextensions.net/packages/TiPCallback/

changeIntervalInMinutes

integer

Specifies interval in minutes to reevaluate ReroutePercentage.

changeStep

number

In auto ramp up scenario this is the step to add/remove from ReroutePercentage until it reaches \nMinReroutePercentage or MaxReroutePercentage. Site metrics are checked every N minutes specified in ChangeIntervalInMinutes.\nCustom decision algorithm can be provided in TiPCallback site extension which URL can be specified in ChangeDecisionCallbackUrl.

maxReroutePercentage

number

Specifies upper boundary below which ReroutePercentage will stay.

minReroutePercentage

number

Specifies lower boundary above which ReroutePercentage will stay.

name

string

Name of the routing rule. The recommended name would be to point to the slot which will receive the traffic in the experiment.

reroutePercentage

number

Percentage of the traffic which will be redirected to ActionHostName.

RequestsBasedTrigger

Trigger based on total requests.

Name Type Description
count

integer

Request Count.

timeInterval

string

Time interval.

ScmType

SCM type.

Name Type Description
BitbucketGit

string

BitbucketHg

string

CodePlexGit

string

CodePlexHg

string

Dropbox

string

ExternalGit

string

ExternalHg

string

GitHub

string

LocalGit

string

None

string

OneDrive

string

Tfs

string

VSO

string

VSTSRM

string

SiteConfig

Configuration of an App Service app.

Name Type Default Value Description
acrUseManagedIdentityCreds

boolean

Flag to use Managed Identity Creds for ACR pull

acrUserManagedIdentityID

string

If using user managed identity, the user managed identity ClientId

alwaysOn

boolean

true if Always On is enabled; otherwise, false.

apiDefinition

ApiDefinitionInfo

Information about the formal API definition for the app.

apiManagementConfig

ApiManagementConfig

Azure API management settings linked to the app.

appCommandLine

string

App command line to launch.

appSettings

NameValuePair[]

Application settings.

autoHealEnabled

boolean

true if Auto Heal is enabled; otherwise, false.

autoHealRules

AutoHealRules

Auto Heal rules.

autoSwapSlotName

string

Auto-swap slot name.

connectionStrings

ConnStringInfo[]

Connection strings.

cors

CorsSettings

Cross-Origin Resource Sharing (CORS) settings.

defaultDocuments

string[]

Default documents.

detailedErrorLoggingEnabled

boolean

true if detailed error logging is enabled; otherwise, false.

documentRoot

string

Document root.

experiments

Experiments

This is work around for polymorphic types.

ftpsState

FtpsState

State of FTP / FTPS service

handlerMappings

HandlerMapping[]

Handler mappings.

healthCheckPath

string

Health check path

http20Enabled

boolean

True

Http20Enabled: configures a web site to allow clients to connect over http2.0

httpLoggingEnabled

boolean

true if HTTP logging is enabled; otherwise, false.

ipSecurityRestrictions

IpSecurityRestriction[]

IP security restrictions for main.

javaContainer

string

Java container.

javaContainerVersion

string

Java container version.

javaVersion

string

Java version.

limits

SiteLimits

Site limits.

linuxFxVersion

string

Linux App Framework and version

loadBalancing

SiteLoadBalancing

Site load balancing.

localMySqlEnabled

boolean

False

true to enable local MySQL; otherwise, false.

logsDirectorySizeLimit

integer

HTTP logs directory size limit.

machineKey

SiteMachineKey

Site MachineKey.

managedPipelineMode

ManagedPipelineMode

Managed pipeline mode.

managedServiceIdentityId

integer

Managed Service Identity Id

minTlsVersion

SupportedTlsVersions

MinTlsVersion: configures the minimum version of TLS required for SSL requests

netFrameworkVersion

string

v4.6

.NET Framework version.

nodeVersion

string

Version of Node.js.

numberOfWorkers

integer

Number of workers.

phpVersion

string

Version of PHP.

powerShellVersion

string

Version of PowerShell.

preWarmedInstanceCount

integer

Number of preWarmed instances. This setting only applies to the Consumption and Elastic Plans

publishingUsername

string

Publishing user name.

push

PushSettings

Push endpoint settings.

pythonVersion

string

Version of Python.

remoteDebuggingEnabled

boolean

true if remote debugging is enabled; otherwise, false.

remoteDebuggingVersion

string

Remote debugging version.

requestTracingEnabled

boolean

true if request tracing is enabled; otherwise, false.

requestTracingExpirationTime

string

Request tracing expiration time.

scmIpSecurityRestrictions

IpSecurityRestriction[]

IP security restrictions for scm.

scmIpSecurityRestrictionsUseMain

boolean

IP security restrictions for scm to use main.

scmMinTlsVersion

SupportedTlsVersions

ScmMinTlsVersion: configures the minimum version of TLS required for SSL requests for SCM site

scmType

ScmType

SCM type.

tracingOptions

string

Tracing options.

use32BitWorkerProcess

boolean

true to use 32-bit worker process; otherwise, false.

virtualApplications

VirtualApplication[]

Virtual applications.

vnetName

string

Virtual Network name.

vnetPrivatePortsCount

integer

The number of private ports assigned to this app. These will be assigned dynamically on runtime.

vnetRouteAllEnabled

boolean

Virtual Network Route All enabled. This causes all outbound traffic to have Virtual Network Security Groups and User Defined Routes applied.

webSocketsEnabled

boolean

true if WebSocket is enabled; otherwise, false.

windowsFxVersion

string

Xenon App Framework and version

xManagedServiceIdentityId

integer

Explicit Managed Service Identity Id

SiteLimits

Metric limits set on an app.

Name Type Description
maxDiskSizeInMb

integer

Maximum allowed disk size usage in MB.

maxMemoryInMb

integer

Maximum allowed memory usage in MB.

maxPercentageCpu

number

Maximum allowed CPU usage percentage.

SiteLoadBalancing

Site load balancing.

Name Type Description
LeastRequests

string

LeastResponseTime

string

RequestHash

string

WeightedRoundRobin

string

WeightedTotalTraffic

string

SiteMachineKey

MachineKey of an app.

Name Type Description
decryption

string

Algorithm used for decryption.

decryptionKey

string

Decryption key.

validation

string

MachineKey validation.

validationKey

string

Validation key.

SlowRequestsBasedTrigger

Trigger based on request execution time.

Name Type Description
count

integer

Request Count.

timeInterval

string

Time interval.

timeTaken

string

Time taken.

StatusCodesBasedTrigger

Trigger based on status code.

Name Type Description
count

integer

Request Count.

status

integer

HTTP status code.

subStatus

integer

Request Sub Status.

timeInterval

string

Time interval.

win32Status

integer

Win32 error code.

SupportedTlsVersions

MinTlsVersion: configures the minimum version of TLS required for SSL requests

Name Type Description
1.0

string

1.1

string

1.2

string

systemData

Metadata pertaining to creation and last modification of the resource.

Name Type Description
createdAt

string

The timestamp of resource creation (UTC).

createdBy

string

The identity that created the resource.

createdByType

createdByType

The type of identity that created the resource.

lastModifiedAt

string

The timestamp of resource last modification (UTC)

lastModifiedBy

string

The identity that last modified the resource.

lastModifiedByType

createdByType

The type of identity that last modified the resource.

VirtualApplication

Virtual application in an app.

Name Type Description
physicalPath

string

Physical path.

preloadEnabled

boolean

true if preloading is enabled; otherwise, false.

virtualDirectories

VirtualDirectory[]

Virtual directories for virtual application.

virtualPath

string

Virtual path.

VirtualDirectory

Directory for virtual application.

Name Type Description
physicalPath

string

Physical path.

virtualPath

string

Path to virtual application.