You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: articles/app-service/app-service-web-app-cloning.md
+17-17Lines changed: 17 additions & 17 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,26 +1,26 @@
1
1
---
2
-
title: Clone an App with PowerShell
2
+
title: Clone an App by Using PowerShell
3
3
description: Learn how to clone your App Service app to a new app by using PowerShell. Learn about various cloning scenarios, including Traffic Manager integration.
4
4
ms.assetid: f9a5cfa1-fbb0-41e6-95d1-75d457347a35
5
5
ms.topic: how-to
6
-
ms.date: 01/14/2016
6
+
ms.date: 05/02/2025
7
7
ms.custom: devx-track-azurepowershell
8
8
author: msangapu-msft
9
9
ms.author: msangapu
10
10
---
11
-
# Clone an Azure App Service App by using PowerShell
11
+
# Clone an Azure App Service app by using PowerShell
With the release of Microsoft Azure PowerShell version 1.1.0, there's a new option for `New-AzWebApp`. By using this option, you can clone an existing App Service app to a newly created app in a different region or in the same region. You can deploy multiple apps across different regions quickly and easily.
15
+
This article explains how you can clone an existing App Service app to create a new app in a different region or in the same region. You can deploy multiple apps across different regions quickly and easily.
16
16
17
-
App cloning is supported for Standard, Premium, Premium V2, and Isolated App Service plans. The feature uses the same limitations as the App Service Backup feature, see [Back up an app in Azure App Service](manage-backup.md).
17
+
App cloning is supported in Standard tiers and higher, and in Isolated tiers. The feature has the same limitations as the App Service Backup feature, see [Back up an app in Azure App Service](manage-backup.md).
18
18
19
19
## Clone an existing app
20
20
21
-
Scenario: You want to clone the contents of an existing app in the South Central US region to a new app in the North Central US region. You can use the Azure Resource Manager version of the PowerShell cmdlet to create a new app with the `-SourceWebApp` option.
21
+
Scenario: You want to clone the contents of an existing app in the South Central US region to a new app in the North Central US region. You can use the Azure Resource Manager version of the PowerShell cmdlet to create a new app by using the `-SourceWebApp` option.
22
22
23
-
When you know the name of the resource group that contains the source app, you can use the following PowerShell command to get the source app's information (in this case named `source-webapp`):
23
+
When you know the name of the resource group that contains the source app, you can use the following PowerShell command to get the source app's information, in this case named `source-webapp`:
To clone an existing app, including all associated deployment slots, you need to use the `IncludeSourceWebAppSlots` parameter. The `IncludeSourceWebAppSlots` parameter is supported only for cloning an entire app including all of its slots. The following PowerShell command demonstrates the use of that parameter with the `New-AzWebApp` command:
41
+
To clone an existing app, including all associated deployment slots, you need to use the `IncludeSourceWebAppSlots` parameter. This parameter is supported only for cloning an entire app including all of its slots. The following PowerShell command demonstrates the use of that parameter with the `New-AzWebApp` command:
Scenario: You want to clone the contents of an existing app in the South Central US region to a new app in an existing App Service Environment.
56
56
57
-
When you know the name of the resource group that contains the source app, you can use the following PowerShell command to get the source app's information (in this case named `source-webapp`):
57
+
When you know the name of the resource group that contains the source app, you can use the following PowerShell command to get the source app's information, in this case named `source-webapp`:
@@ -109,8 +109,9 @@ After you have the Traffic Manager ID, the following command demonstrates how to
109
109
```powershell
110
110
$destapp = New-AzWebApp -ResourceGroupName <Resource group name> -Name dest-webapp -Location "South Central US" -AppServicePlan DestinationAppServicePlan -SourceWebApp $srcapp -TrafficManagerProfileId $TMProfileID
111
111
```
112
+
112
113
> [!NOTE]
113
-
> If you're receiving an error that states "SSL validation on the traffic manager hostname is failing," we suggest you use the `-IgnoreCustomHostNames` attribute in the PowerShell cmdlet while you perform the clone operation. The alternative is that you can use the portal.
114
+
> If you receive an error that states **SSL validation on the traffic manager hostname is failing**, we suggest that you use the `-IgnoreCustomHostNames` attribute in the PowerShell cmdlet while you perform the clone operation. Alternatively, you can use the Azure portal.
114
115
115
116
## Current restrictions
116
117
@@ -125,14 +126,13 @@ Here are the known restrictions of app cloning:
125
126
* TiP rules aren't cloned.
126
127
* Database content isn't cloned.
127
128
* Outbound IP addresses change if you clone to a different scale unit.
128
-
* Linux apps: not available.
129
+
* Linux apps aren't available.
129
130
* Managed identities aren't cloned.
130
-
* Function apps: not available.
131
+
* Function apps aren't available.
131
132
132
133
## Related content
133
134
134
-
*[Clone an app in Azure App Service](app-service-web-app-cloning.md)
135
-
*[Back up an app in Azure App Service](manage-backup.md)
136
-
*[Learn about Azure Resource Manager support for Azure Traffic Manager Preview](../traffic-manager/traffic-manager-powershell-arm.md)
137
-
*[Get an introduction to App Service Environment](environment/intro.md)
138
-
*[Use Azure PowerShell with Azure Resource Manager](../azure-resource-manager/management/manage-resources-powershell.md)
135
+
*[Back up and restore your app in Azure App Service](manage-backup.md)
136
+
*[Using PowerShell to manage Traffic Manager](../traffic-manager/traffic-manager-powershell-arm.md)
137
+
*[App Service Environment overview](environment/intro.md)
138
+
*[Manage Azure resources by using Azure PowerShell](../azure-resource-manager/management/manage-resources-powershell.md)
# Continuous deployment with custom containers in Azure App Service
15
15
16
-
Learn how to configure continuous integration and continuous delivery (CI/CD) for a custom container image from managed [Azure Container Registry](https://azure.microsoft.com/services/container-registry/) repositories or [Docker Hub](https://hub.docker.com).
16
+
This article explains how to configure continuous integration and continuous delivery (CI/CD) for a custom container image from managed [Azure Container Registry](https://azure.microsoft.com/services/container-registry/) repositories or [Docker Hub](https://hub.docker.com).
17
17
18
18
## 1. Go to the Deployment Center
19
19
20
20
In the [Azure portal](https://portal.azure.com), go to the management pane for your Azure App Service app.
21
21
22
-
From the left menu, select **Deployment Center** > **Settings**.
22
+
In the sidebar menu under **Deployment**, select **Deployment Center**. Choose the **Settings** tab.
23
23
24
24
::: zone pivot="container-linux"
25
-
## 2. Choose deployment source
25
+
## 2. Select code source
26
26
27
-
Choose the deployment source based on the following criteria:
27
+
From the **Source** dropdown menu, select the deployment source based on the following criteria:
28
28
29
29
***Container registry** sets up CI/CD between your container registry and App Service.
30
30
* Choose the **GitHub Actions** option if you maintain the source code for your container image in GitHub. New commits to your GitHub repository trigger the deploy action, which can run `docker build` and `docker push` directly to your container registry. It then updates your App Service app to run the new image. For more information, see [How CI/CD works with GitHub Actions](#how-cicd-works-with-github-actions).
@@ -43,14 +43,14 @@ After you authorize your Azure account with GitHub, select the **Organization**,
43
43
## 3. Configure registry settings
44
44
45
45
> [!NOTE]
46
-
> Sidecar containers (preview) will succeed multi-container (Docker Compose) apps in App Service. To get started, see [Tutorial: Configure a sidecar container for custom containers in Azure App Service (preview)](tutorial-custom-container-sidecar.md).
46
+
> Sidecar containers will succeed multi-container (Docker Compose) apps in App Service. To get started, see [Tutorial: Configure a sidecar container for custom containers in Azure App Service](tutorial-custom-container-sidecar.md).
47
47
48
48
To deploy a multi-container (Docker Compose) app, select **Docker Compose** in **Container Type**.
49
49
50
50
If you don't see the **Container Type** dropdown list, scroll back up to **Source** and select **Container Registry**.
51
51
::: zone-end
52
52
53
-
In **Registry source**, select where your container registry is. If it's not Azure Container Registry or Docker Hub, select **Private Registry**.
53
+
In **Registry source**, select where your container registry is. If it's not Azure Container Registry or Docker Hub, select **Private registry**.
54
54
55
55
::: zone pivot="container-linux"
56
56
> [!NOTE]
@@ -63,7 +63,7 @@ Follow the next steps by selecting the tab that matches your choice.
63
63
64
64
The **Registry** dropdown list displays the registries in the same subscription as your app. Select the registry you want.
65
65
66
-
To deploy from a registry in a different subscription, select **Private Registry** in **Registry source** instead.
66
+
To deploy from a registry in a different subscription, select **Private registry** in **Registry source** instead.
67
67
68
68
To use managed identities to lock down Azure Container Registry access, see:
69
69
@@ -144,25 +144,18 @@ To verify whether **Basic Auth Publishing Credentials** is enabled, go to your w
144
144
145
145
For other private registries, you can post to the webhook manually or as a step in a CI/CD pipeline. In **Webhook URL**, select the **Copy** button to get the webhook URL.
146
146
147
+
Select **Save** to save your settings.
148
+
147
149
::: zone pivot="container-linux"
148
150
> [!NOTE]
149
151
> Support for multi-container (Docker Compose) apps is limited. For Azure Container Registry, App Service creates a webhook in the selected registry with the registry as the scope. A `docker push` to any repository in the registry (including the ones not referenced by your Docker Compose file) triggers an app restart. You might want to [modify the webhook](/azure/container-registry/container-registry-webhook) to a narrower scope. Docker Hub doesn't support webhooks at the registry level. You must add the webhooks manually to the images specified in your Docker Compose file.
150
152
::: zone-end
151
153
152
-
::: zone pivot="container-windows"
153
-
## 4. Save your settings
154
-
::: zone-end
155
-
::: zone pivot="container-linux"
156
-
## 5. Save your settings
157
-
::: zone-end
158
-
159
-
Select **Save**.
160
-
161
154
::: zone pivot="container-linux"
162
155
163
156
## How CI/CD works with GitHub Actions
164
157
165
-
If you choose **GitHub Actions**in **Source** (see [Choose deployment source](#2-choose-deployment-source)), App Service sets up CI/CD in the following ways:
158
+
If you choose **GitHub Actions**from the [Select code source](#2-select-code-source) dropdown menu, App Service sets up CI/CD in the following ways:
166
159
167
160
* It deposits a GitHub Actions workflow file into your GitHub repository to handle build and deploy tasks to App Service.
168
161
* It adds the credentials for your private registry as GitHub secrets. The generated workflow file runs the [`Azure/docker-login`](https://github.com/Azure/docker-login) action to sign in with your private registry, and then runs `docker push` to deploy to it.
When using App Service, you can scale your apps by scaling the [App Service plan](overview-hosting-plans.md) they run on. When multiple apps are running in the same App Service plan, each scaled-out instance runs all the apps in the plan.
16
+
You can scale your Azure App Service apps by scaling the [App Service plan](overview-hosting-plans.md) they run on. When multiple apps run in the same App Service plan, each scaled-out instance runs all the apps in the plan.
17
17
18
-
*Per-app scaling* can be enabled at the App Service plan level to allow for scaling an app independently from the
18
+
In contrast, *per-app scaling* can be enabled at the App Service plan level to scale an app independently from the
19
19
App Service plan that hosts it. This way, an App Service plan can be scaled to 10 instances, but an app can be set to use only five.
20
20
21
21
> [!NOTE]
22
22
> Per-app scaling is available only for **Standard**, **Premium**, **Premium V2**, **Premium V3**, and **Isolated** pricing tiers.
23
23
>
24
24
25
-
Apps are allocated to available App Service plan using a besteffort approach for an even distribution across instances. While an even distribution is not guaranteed, the platform will make sure that two instances of the same app will not be hosted on the same App Service plan instance.
25
+
Apps are allocated to the available App Service plan using a best-effort approach for an even distribution across instances. While an even distribution isn't guaranteed, the platform makes sure that two instances of the same app aren't hosted on the same App Service plan instance.
26
26
27
-
The platform does not rely on metrics to decide on worker allocation. Applications are rebalanced only when instances are added or removed from the App Service plan.
27
+
The platform doesn't rely on metrics to decide on worker allocation. Applications are rebalanced only when instances are added or removed from the App Service plan.
28
28
29
-
## Perapp scaling using PowerShell
29
+
## Per-app scaling using PowerShell
30
30
31
-
Create a plan with per-app scaling by passing in the ```-PerSiteScaling $true``` parameter to the ```New-AzAppServicePlan``` cmdlet.
31
+
Create a plan with per-app scaling by passing in the `-PerSiteScaling $true` parameter to the `New-AzAppServicePlan` cmdlet.
# Modify the NumberOfWorkers setting to the desired value.
55
+
# Modify the NumberOfWorkers setting to the desired value
60
56
$newapp.SiteConfig.NumberOfWorkers = 2
61
57
62
-
# Post updated app back to azure
58
+
# Post updated app back to Azure
63
59
Set-AzWebApp $newapp
64
60
```
65
61
@@ -70,12 +66,10 @@ Set-AzWebApp $newapp
70
66
71
67
The following Azure Resource Manager template creates:
72
68
73
-
- An App Service plan that's scaled out to 10 instances
74
-
-an app that's configured to scale to a max of five instances.
69
+
- An App Service plan that's scaled out to 10 instances.
70
+
-An app that's configured to scale to a max of five instances.
75
71
76
-
The App Service plan is setting the **PerSiteScaling** property
77
-
to true `"perSiteScaling": true`. The app is setting the **number of workers**
78
-
to use to 5 `"properties": { "numberOfWorkers": "5" }`.
72
+
The App Service plan is setting the `PerSiteScaling` property to true `"perSiteScaling": true`. The app is setting the `number of workers` to use to 5 `"properties": { "numberOfWorkers": "5" }`.
79
73
80
74
```json
81
75
{
@@ -126,20 +120,23 @@ to use to 5 `"properties": { "numberOfWorkers": "5" }`.
126
120
127
121
## Recommended configuration for high-density hosting
128
122
129
-
Perapp scaling is a feature that is enabled in both global Azure regions and [App Service Environments](environment/app-service-app-service-environment-intro.md). However, the recommended strategy is to use App Service Environments to take advantage of their advanced features and the larger App Service plan capacity.
123
+
Per-app scaling is a feature that's enabled in both global Azure regions and [App Service Environments](environment/app-service-app-service-environment-intro.md). However, the recommended strategy is to use App Service Environments to take advantage of their advanced features and the larger App Service plan capacity.
130
124
131
125
Follow these steps to configure high-density hosting for your apps:
132
126
133
127
1. Designate an App Service plan as the high-density plan and scale it out to the desired capacity.
128
+
134
129
1. Set the `PerSiteScaling` flag to true on the App Service plan.
135
-
1. New apps are created and assigned to that App Service plan with the **numberOfWorkers** property set to **1**.
130
+
131
+
1. New apps are created and assigned to that App Service plan with the `numberOfWorkers` property set to *1*.
136
132
- Using this configuration yields the highest density possible.
133
+
137
134
1. The number of workers can be configured independently per app to grant additional resources as needed. For example:
138
-
- A high-use app can set **numberOfWorkers** to **3** to have more processing capacity for that app.
139
-
- Low-use apps would set **numberOfWorkers** to **1**.
135
+
- A high-use app can set `numberOfWorkers` to *3* to have more processing capacity for that app.
136
+
- Low-use apps would set `numberOfWorkers` to *1*.
140
137
141
-
## Next steps
138
+
## Related content
142
139
143
-
-[Azure App Service plans in-depth overview](overview-hosting-plans.md)
144
-
-[Introduction to App Service Environment](environment/app-service-app-service-environment-intro.md)
140
+
-[What are Azure App Service plans?](overview-hosting-plans.md)
141
+
-[App Service Environment overview](environment/overview.md)
145
142
-[Tutorial: Run a load test to identify performance bottlenecks in a web app](../load-testing/tutorial-identify-bottlenecks-azure-portal.md)
0 commit comments