Skip to content

Commit 6e6029a

Browse files
authored
Merge pull request #301995 from v-thepet/app10
Freshness: Azure App Service 10
2 parents ccdfd0b + 10c00e4 commit 6e6029a

File tree

3 files changed

+91
-56
lines changed

3 files changed

+91
-56
lines changed
Lines changed: 84 additions & 52 deletions
Original file line numberDiff line numberDiff line change
@@ -1,134 +1,166 @@
11
---
2-
title: Configure Deployment Credentials
3-
description: Learn what types of deployment credentials are in Azure App Service and how to configure and use them.
2+
title: Manage Deployment Credentials
3+
description: Learn about the types of deployment credentials for deploying local apps to Azure App Service and how to configure and use them.
44
author: cephalin
55
ms.author: cephalin
66
ms.reviewer: byvinyal
77
ms.topic: how-to
8-
ms.date: 01/26/2024
8+
ms.date: 07/01/2025
99

1010
---
1111

12-
# Configure deployment credentials for Azure App Service
13-
To secure app deployment from a local computer, [Azure App Service](./overview.md) supports two types of credentials for [local Git deployment](deploy-local-git.md) and [FTP/FTPS deployment](deploy-ftp.md). These credentials are different from your Azure subscription credentials.
12+
# Manage deployment credentials for Azure App Service
13+
14+
You can deploy local apps to [Azure App Service](overview.md) by using [local Git deployment](deploy-local-git.md) or [FTP/S deployment](deploy-ftp.md). This article explains how to create and manage deployment credentials for local Git or FTP/S deployment.
15+
16+
Deployment credentials are different from your Azure subscription credentials. App Service supports two types of credentials for secure local app deployment: *user-scope* and *app-scope* credentials.
1417

1518
[!INCLUDE [app-service-deploy-credentials](../../includes/app-service-deploy-credentials.md)]
1619

17-
> [!NOTE]
18-
> When [basic authentication is disabled](configure-basic-auth-disable.md), you can't view or configure deployment credentials in **Deployment Center**.
20+
## Prerequisites
1921

20-
## <a name="userscope"></a>Configure user-scope credentials
22+
To set, reset, access, or use deployment credentials, you must have **Contributor**-level permissions on the App Service app.
2123

22-
# [Azure CLI](#tab/cli)
24+
<a name="disable-basic-authentication"></a>
25+
### Basic authentication requirement
2326

24-
Run the [`az webapp deployment user set`](/cli/azure/webapp/deployment/user#az-webapp-deployment-user-set) command. Replace `<username>` and `<password>` with a deployment user's username and password.
27+
To publish App Service apps via local Git or FTP/S, you must enable basic authentication. **SCM Basic Auth Publishing Credentials** and **FTP Basic Auth Publishing Credentials** must both be set to **On** on the app's **Configuration** page in the Azure portal.
2528

26-
- The username must be unique within Azure, and for local Git pushes, must not contain the @ symbol.
27-
- The password must be at least eight characters long, with two of the following three elements: letters, numbers, and symbols.
29+
Basic authentication is less secure than other authentication methods and is disabled by default for new apps. If basic authentication is disabled, you can't view or set deployment credentials in the app's **Deployment Center** or use these credentials for publishing. For more information, see [Disable basic authentication in Azure App Service deployments](configure-basic-auth-disable.md).
2830

29-
```azurecli-interactive
30-
az webapp deployment user set --user-name <username> --password <password>
31-
```
31+
<a name="userscope"></a>
32+
## Set user-scope credentials
3233

33-
The JSON output shows the password as `null`.
34+
For FTP/S deployment, you need both a user name and a password. Local Git deployment requires only a user name. The user name must be unique within Azure.
3435

35-
# [Azure PowerShell](#tab/powershell)
36+
For local Git deployment, the user name can't contain the `@` character.
3637

37-
You can't configure the user-scope credentials by using Azure PowerShell. Use a different method, or consider [using application-scope credentials](#appscope).
38+
For FTP/S deployment:
3839

39-
# [Azure portal](#tab/portal)
40+
- The user name must follow the format `<app-name>\<user-name>`. Since user-scope credentials are linked to the user and not to the app, this format directs the sign-in action to the correct FTP/S endpoint for the app.
4041

41-
You can configure your user-scope credentials in any app's [resource page](../azure-resource-manager/management/manage-resources-portal.md#manage-resources). Regardless of which app you use to configure these credentials, the credentials apply to all apps for all subscriptions in your Azure account.
42+
- The password must be at least eight characters and contain capital letters, lowercase letters, numbers, and symbols. The Azure portal doesn't show the user-scope password, and the JSON output shows it as `null`. If you lose or forget your password, you can [reset your credentials](#reset-credentials) to get a new one.
4243

43-
You must have at least one app in the [Azure portal](https://portal.azure.com) before you can access the deployment credentials page. To configure your user-scope credentials:
44+
You can configure user-scope credentials by using Azure CLI or the Azure portal.
4445

45-
1. From the left menu of your app, select > **Deployment Center** > **FTPS credentials** or **Local Git/FTPS credentials**.
46+
# [Azure CLI](#tab/cli)
4647

47-
2. Scroll down to **User scope**, configure the **Username** and **Password**, and then select **Save**.
48+
To create user-scope credentials using Azure CLI, run the [`az webapp deployment user set`](/cli/azure/webapp/deployment/user#az-webapp-deployment-user-set) command, replacing `<username>` and `<password>` with values you select.
4849

49-
After you set your deployment credentials, you can find the Git deployment username in your app's **Overview** page.
50+
```azurecli-interactive
51+
az webapp deployment user set --user-name <username> --password <password>
52+
```
5053

51-
![Screenshot that shows you how to find the Git deployment user name on your app's Overview page.](./media/app-service-deployment-credentials/deployment_credentials_overview.png)
54+
# [Azure PowerShell](#tab/powershell)
5255

53-
If Git deployment is configured, the page shows **Git/deployment username**. Otherwise, it shows **FTP/deployment username**.
56+
You can't create user-scope credentials by using Azure PowerShell. Use Azure CLI or the Azure portal to create the credentials, or use app-scope credentials to deploy to FTP/S or local Git.
5457

55-
> [!NOTE]
56-
> Azure doesn't show your user-scope deployment password. If you forget the password, you can follow the steps in this section to reset your credentials.
58+
# [Azure portal](#tab/portal)
59+
60+
In the [Azure portal](https://portal.azure.com), you must have at least one app to use for setting user-scope credentials. The credentials then apply to all apps for all subscriptions in your Azure account that have **SCM Basic Auth** and **FTP Basic Auth** enabled.
61+
62+
1. Select **Deployment Center** under **Deployment** in the left navigation menu of an app.
63+
1. Select the **FTPS credentials** tab, or if **Local Git** is configured as the build source, the **Local Git/FTPS credentials** tab.
64+
1. In the **User-scope** section, add a **Username**.
65+
1. Add and confirm a **Password**.
66+
1. Select **Save**.
5767

5868
-----
5969

60-
## Use user-scope credentials with FTP/FTPS
70+
After you set user-scope credentials, you can see your deployment user name on your app's **Overview** page in the Azure portal. If local Git deployment is configured, the label is **Git/Deployment username**. Otherwise, the label is **FTP/Deployment username**.
71+
72+
![Screenshot that shows the Git deployment user name on an app's Overview page.](./media/app-service-deployment-credentials/deployment_credentials_overview.png)
73+
74+
<a name="appscope"></a>
75+
## Get application-scope credentials
6176

62-
To authenticate to an FTP/FTPS endpoint by using user-scope credentials, your username must follow this format:
63-
`<app-name>\<user-name>`
77+
The application-scope credentials are automatically created at app creation. The FTP/S app-scope user name always follows the format `app-name\$app-name`. The local Git app-scope user name uses the format `$app-name`.
6478

65-
Since user-scope credentials are linked to the user and not to a specific resource, the username must be in this format to direct the sign-in action to the right app endpoint.
79+
>[!NOTE]
80+
>When you use `git remote add` in shells that use the dollar sign for variable interpolation, such as Bash, you must use `\$` to escape any dollar signs in the username or password to avoid authentication errors.
6681
67-
## <a name="appscope"></a>Get application-scope credentials
82+
You can get your app-scope credentials by using Azure CLI, Azure PowerShell, or the Azure portal.
6883

6984
# [Azure CLI](#tab/cli)
7085

71-
Get the application-scope credentials by using the [`az webapp deployment list-publishing-profiles`](/cli/azure/webapp/deployment#az-webapp-deployment-list-publishing-profiles) command. For example:
86+
In Azure CLI, get the application-scope credentials by using the [`az webapp deployment list-publishing-profiles`](/cli/azure/webapp/deployment#az-webapp-deployment-list-publishing-profiles) command. For example:
7287

7388
```azurecli-interactive
74-
az webapp deployment list-publishing-profiles --resource-group <group-name> --name <app-name>
89+
az webapp deployment list-publishing-profiles --resource-group myResourceGroup --name myApp
7590
```
7691

77-
For [local Git deployment](deploy-local-git.md), you can also use the [`az webapp deployment list-publishing-credentials`](/cli/azure/webapp/deployment#az-webapp-deployment-list-publishing-credentials) command. When you use this command, you get a Git remote URI for your app that has the application-scope credentials already embedded. For example:
92+
For [local Git deployment](deploy-local-git.md), you can also use the [`az webapp deployment list-publishing-credentials`](/cli/azure/webapp/deployment#az-webapp-deployment-list-publishing-credentials) command. The following example returns a Git remote URI that has the application-scope credentials for the app already embedded.
7893

7994
```azurecli-interactive
80-
az webapp deployment list-publishing-credentials --resource-group <group-name> --name <app-name> --query scmUri
95+
az webapp deployment list-publishing-credentials --resource-group myResourceGroup --name myApp --query scmUri
8196
```
8297

83-
> [!NOTE]
84-
> The returned Git remote URI doesn't contain `/<app-name>.git` at the end. When you add the remote URI, make sure to append `/<app-name>.git` to avoid an error 22 with `git-http-push`. Additionally, when using `git remote add ... ` via shells that use the dollar sign for variable interpolation (such as bash), escape any dollar signs `\$` in the username or password. Failure to escape this character can result in authentication errors.
98+
The returned Git remote URI doesn't have `/<app-name>.git` at the end. If you use the URI to add a remote, append `/<app-name>.git` to the URI to avoid an error `22` with `git-http-push`.
8599

86100
# [Azure PowerShell](#tab/powershell)
87101

88-
Get the application-scope credentials by using the [`Get-AzWebAppPublishingProfile`](/powershell/module/az.websites/get-azwebapppublishingprofile) command. For example:
102+
In Azure PowerShell, get the application-scope credentials by using the [`Get-AzWebAppPublishingProfile`](/powershell/module/az.websites/get-azwebapppublishingprofile) command. For example:
89103

90104
```azurepowershell-interactive
91-
Get-AzWebAppPublishingProfile -ResourceGroupName <group-name> -Name <app-name>
105+
Get-AzWebAppPublishingProfile -ResourceGroupName myResourceGroup -Name myApp
92106
```
93107

94108
# [Azure portal](#tab/portal)
95109

96-
1. From the left menu of your app, select **Deployment Center** > **FTPS credentials** or **Local Git/FTPS credentials**.
110+
To get the application-scope credentials in the Azure portal:
97111

98-
2. In the **Application scope** section, select the **Copy** link to copy the username or password.
112+
1. Select **Deployment Center** under **Deployment** in the left navigation menu of your app.
113+
1. On the **Deployment Center** page, select the **FTPS credentials** or **Local Git/FTPS credentials** tab.
114+
1. In the **Application-scope** section, view the **FTPS username**, **Local Git username**, and **Password**. Select the copy icons to copy the values.
99115

100116
-----
101117

102-
## Reset application-scope credentials
118+
## Reset credentials
119+
120+
You can use Azure CLI, Azure PowerShell, or the Azure portal to reset your application-scope deployment credentials and get a new password. The app-scope user names retain their autogenerated values.
121+
122+
In Azure CLI and the Azure portal, you can also reset your user-scope credentials by creating new ones. This action affects all the apps in your account that use the user-scope credentials.
123+
124+
When you reset your deployment credentials, any external integrations and automation via the publishing profile stop working and must be reconfigured with the new values.
103125

104126
# [Azure CLI](#tab/cli)
105127

106-
Reset the application-scope credentials by using the [`az resource invoke-action`](/cli/azure/resource#az-resource-invoke-action) command:
128+
In Azure CLI, reset the application-scope password by using the [`az resource invoke-action`](/cli/azure/resource#az-resource-invoke-action) command with the `newpassword` action.
107129

108130
```azurecli-interactive
109131
az resource invoke-action --action newpassword --resource-group <group-name> --name <app-name> --resource-type Microsoft.Web/sites
110132
```
111133

134+
Reset the user-scope credentials by rerunning the [`az webapp deployment user set`](/cli/azure/webapp/deployment/user#az-webapp-deployment-user-set) command to create new user name and password values.
135+
136+
```azurecli-interactive
137+
az webapp deployment user set --user-name <new-username> --password <new-password>
138+
```
139+
112140
# [Azure PowerShell](#tab/powershell)
113141

114-
Reset the application-scope credentials by using the [`Invoke-AzResourceAction`](/powershell/module/az.resources/invoke-azresourceaction) command:
142+
In Azure PowerShell, reset the application-scope password by using the [`Invoke-AzResourceAction`](/powershell/module/az.resources/invoke-azresourceaction) command with the `newpassword` action:
115143

116144
```azurepowershell-interactive
117145
Invoke-AzResourceAction -ResourceGroupName <group-name> -ResourceType Microsoft.Web/sites -ResourceName <app-name> -Action newpassword
118146
```
119147

120148
# [Azure portal](#tab/portal)
121149

122-
1. From the left menu of your app, select **Deployment Center** > **FTPS credentials** or **Local Git/FTPS credentials**.
150+
In the Azure portal, select **Deployment Center** from your app's left navigation menu, and then select the **FTPS credentials** or **Local Git/FTPS credentials** tab.
123151

124-
2. In the **Application scope** section, select **Reset**.
152+
- To reset your app-scope credentials and get a new password, select **Reset** at the bottom of the **Application-scope** section.
125153

126-
-----
154+
- To reset your user-scope credentials:
155+
1. Select **Reset** at the bottom of the **User-scope** section. This selection deletes both user name and password, and disables user-scope credentials.
156+
1. To reset and reenable your user-scope credentials, enter a new username and password, and select **Save**.
127157

128-
## Disable basic authentication
158+
This action takes effect across all the apps in your account that use the user-scope credentials.
129159

130-
See [Disable basic authentication in App Service deployment](configure-basic-auth-disable.md).
160+
-----
131161

132162
## Related content
133163

134-
Find out how to use these credentials to deploy your app from a [local Git](deploy-local-git.md) or by using [FTP/FTPS](deploy-ftp.md).
164+
- [Disable basic authentication in Azure App Service deployments](configure-basic-auth-disable.md)
165+
- [Deploy to Azure App Service by using local Git](deploy-local-git.md)
166+
- [Deploy your app to Azure App Service using FTP/S](deploy-ftp.md)
31.8 KB
Loading

includes/app-service-deploy-credentials.md

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,14 @@
22
author: cephalin
33
ms.service: azure-app-service
44
ms.topic: include
5-
ms.date: 04/20/2020
5+
ms.date: 06/30/2025
66
ms.author: cephalin
77
---
88

9-
* **User-level credentials**: One set of credentials for the entire Azure account. These credentials can be used to deploy to App Service for any app in any subscription that the Azure account has permission to access. This credentials set is the default that surfaces in the portal's graphical environment, like in **Overview** and **Properties**
10-
on the app's [resource pane](/azure/azure-resource-manager/management/manage-resources-portal#manage-resources). When a user is granted app access via role-based access control (RBAC) or coadministrator permissions, they can use their user-level credentials until access is revoked. Don't share these credentials with other Azure users.
9+
- **User-scope** or user-level credentials provide one set of deployment credentials for a user's entire Azure account. A user who is granted app access via role-based access control (RBAC) or coadministrator permissions can use their user-level credentials as long as they have those permissions.
1110

12-
* **App-level credentials**: One set of credentials for each app. These credentials can be used to deploy to that app only. The credentials for each app are generated automatically at app creation. They can't be configured manually, but can be reset anytime. To grant a user access to app-level credentials via RBAC, that user must have **Contributor** level or higher permissions on the app (including the built-in **Website Contributor** role). Readers aren't allowed to publish, and can't access those credentials.
11+
You can use your user-scope credentials to deploy any app to App Service via local Git or FTP/S in any subscription that your Azure account has permission to access. You don't share these credentials with any other Azure users. You can reset your user-scope credentials anytime.
12+
13+
- **App-scope** or application-level credentials are one set of credentials per app that can be used to deploy that app only. These credentials are generated automatically for each app at creation and can't be configured manually, but the password can be reset anytime.
14+
15+
A user must have at least **Contributor** level permissions on an app, including the built-in **Website Contributor** role, to be granted access to app-level credentials via RBAC. **Reader** role can't publish and can't access these credentials.

0 commit comments

Comments
 (0)