Skip to content

Commit 4b7f8cd

Browse files
committed
draft
1 parent ad35600 commit 4b7f8cd

File tree

3 files changed

+70
-58
lines changed

3 files changed

+70
-58
lines changed
Lines changed: 70 additions & 46 deletions
Original file line numberDiff line numberDiff line change
@@ -1,134 +1,158 @@
11
---
22
title: Configure Deployment Credentials
3-
description: Learn what types of deployment credentials are in Azure App Service and how to configure and use them.
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: 06/27/2025
99

1010
---
1111

1212
# 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.
1413

15-
[!INCLUDE [app-service-deploy-credentials](../../includes/app-service-deploy-credentials.md)]
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). App Service supports two types of credentials for secure local app deployment, *user-scope* and *app-scope* credentials. These credentials are different from your Azure subscription credentials.
1615

17-
> [!NOTE]
18-
> When [basic authentication is disabled](configure-basic-auth-disable.md), you can't view or configure deployment credentials in **Deployment Center**.
16+
- **User-scope credentials** provide a user with one set of deployment credentials for their 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 until access is revoked.
1917

20-
## <a name="userscope"></a>Configure user-scope credentials
18+
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. Don't share these credentials with other Azure users.
2119

22-
# [Azure CLI](#tab/cli)
20+
- **App-scope credentials** provide one set of credentials per app, which can be used to deploy that app only. The app-scope credentials for each app are generated automatically during app creation and can't be configured manually, but they can be reset anytime.
21+
22+
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.
23+
24+
>[!IMPORTANT]
25+
>Basic authentication must be enabled to publish via local Git or FTP/S. Basic authentication is less secure than other authentication methods and is disabled by default for new apps. When [basic authentication is disabled](configure-basic-auth-disable.md), you can't view or set deployment credentials in the app's **Deployment Center**.
26+
>
27+
>To enable or disable basic authentication, go to the app's **Configuration** page in the Azure portal.
28+
29+
<a name="userscope"></a>
30+
## Set user-scope credentials
31+
32+
You can configure user-scope credentials by using Azure CLI or the Azure portal. For FTP/S deployment, you need both a user name and password. For local Git deployment, you only need a user name. User names must be unique within Azure.
2333

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.
34+
# [Azure CLI](#tab/cli)
2535

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.
36+
To create user-scope credentials, 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.
2837

2938
```azurecli-interactive
3039
az webapp deployment user set --user-name <username> --password <password>
3140
```
41+
- For FTP/S, the password must be at least eight characters and contain capital letters, lowercase letters, numbers, and symbols. The JSON output shows the password as `null`.
42+
- For local Git, you only need to provide a user name. The user name can't contain the `@` character.
3243

33-
The JSON output shows the password as `null`.
44+
- 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, the username must be in this format to direct the sign-in action to the FTP/S endpoint for the app.
3445

3546
# [Azure PowerShell](#tab/powershell)
3647

37-
You can't configure the user-scope credentials by using Azure PowerShell. Use a different method, or consider [using application-scope credentials](#appscope).
48+
You can't create user-scope credentials by using Azure PowerShell. Use Azure CLI or the Azure portal to create the credentials instead. To deploy to FTP/S or local Git, you can use app-scope credentials.
3849

3950
# [Azure portal](#tab/portal)
4051

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-
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:
52+
You must have at least one app to use for setting user-scope deployment credentials in the [Azure portal](https://portal.azure.com). You can set the credentials in any app that has **SCM Basic Auth** and **FTP Basic Auth** enabled. The credentials then apply to all apps for all subscriptions in your Azure account that have **SCM Basic Auth** and **FTP Basic Auth** enabled.
4453

45-
1. From the left menu of your app, select > **Deployment Center** > **FTPS credentials** or **Local Git/FTPS credentials**.
54+
To configure deployment credentials:
4655

47-
2. Scroll down to **User scope**, configure the **Username** and **Password**, and then select **Save**.
56+
1. Select **Deployment Center** under **Deployment** in the left navigation menu of an app.
57+
1. If **Local Git** is configured as the build source, select the **Local Git/FTPS credentials** tab. Otherwise, select the **FTPS credentials** tab.
58+
1. In the **User-scope** section, add a **Username**. For local Git deployments, the user name can't contain the `@` character.
59+
1. For FTP/S deployments, add and confirm a **Password**. The password must be at least eight characters and contain contain capital letters, lowercase letters, numbers, and symbols.
60+
1. Select **Save**.
4861

49-
After you set your deployment credentials, you can find the Git deployment username in your app's **Overview** page.
62+
After you set the credentials, you can see your deployment user name on your app's **Overview** page. If local Git deployment is configured, the label is **Git/deployment username**. Otherwise, the label is **FTP/deployment username**. The page doesn't show the password.
5063

5164
![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)
5265

53-
If Git deployment is configured, the page shows **Git/deployment username**. Otherwise, it shows **FTP/deployment username**.
66+
-----
5467

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.
68+
### Deploy to FTP/S with user-scope credentials
5769

58-
-----
70+
To authenticate to an FTP/S endpoint by using user-scope credentials, you must prepend the user name with the app name in the format `<app-name>\<user-name>`. Since user-scope credentials are linked to the user and not to the app, the username must be in this format to direct the sign-in action to the correct FTP/S endpoint for the app.
5971

60-
## Use user-scope credentials with FTP/FTPS
72+
<a name="appscope"></a>
73+
## Get application-scope credentials
6174

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

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.
77+
>[!NOTE]
78+
>When you use `git remote add` in shells that use the dollar sign for variable interpolation, such as Bash, you must escape any dollar signs in the username or password by using `\$`, to avoid authentication errors.
6679
67-
## <a name="appscope"></a>Get application-scope credentials
80+
You can get your app-scope credentials by using Azure CLI, Azure PowerShell, or the Azure portal.
6881

6982
# [Azure CLI](#tab/cli)
7083

7184
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:
7285

7386
```azurecli-interactive
74-
az webapp deployment list-publishing-profiles --resource-group <group-name> --name <app-name>
87+
az webapp deployment list-publishing-profiles --resource-group myResourceGroup --name myApp
7588
```
7689

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:
90+
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.
7891

7992
```azurecli-interactive
80-
az webapp deployment list-publishing-credentials --resource-group <group-name> --name <app-name> --query scmUri
93+
az webapp deployment list-publishing-credentials --resource-group myResourceGroup --name myApp --query scmUri
8194
```
8295

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.
96+
The returned Git remote URI doesn't have `/<app-name>.git` at the end. When you add a remote, append `/<app-name>.git` to the URI to avoid an error `22` with `git-http-push`.
8597

8698
# [Azure PowerShell](#tab/powershell)
8799

88100
Get the application-scope credentials by using the [`Get-AzWebAppPublishingProfile`](/powershell/module/az.websites/get-azwebapppublishingprofile) command. For example:
89101

90102
```azurepowershell-interactive
91-
Get-AzWebAppPublishingProfile -ResourceGroupName <group-name> -Name <app-name>
103+
Get-AzWebAppPublishingProfile -ResourceGroupName myResourceGroup -Name myApp
92104
```
93105

94106
# [Azure portal](#tab/portal)
95107

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

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

100114
-----
101115

102116
## Reset application-scope credentials
103117

118+
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 remain at their autogenerated values.
119+
120+
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.
121+
122+
When you reset your deployment credentials, any external integrations and automation stop working and must be reconfigured with the new values.
123+
104124
# [Azure CLI](#tab/cli)
105125

106-
Reset the application-scope credentials by using the [`az resource invoke-action`](/cli/azure/resource#az-resource-invoke-action) command:
126+
Reset the application-scope password by using the [`az resource invoke-action`](/cli/azure/resource#az-resource-invoke-action) command.
107127

108128
```azurecli-interactive
109129
az resource invoke-action --action newpassword --resource-group <group-name> --name <app-name> --resource-type Microsoft.Web/sites
110130
```
111131

132+
Reset the user-scope credentials by rerunning the [`az webapp deployment user set`](/cli/azure/webapp/deployment/user#az-webapp-deployment-user-set) command, supplying new user name and password values.
133+
134+
```azurecli-interactive
135+
az webapp deployment user set --user-name <new-username> --password <new-password>
136+
```
137+
112138
# [Azure PowerShell](#tab/powershell)
113139

114-
Reset the application-scope credentials by using the [`Invoke-AzResourceAction`](/powershell/module/az.resources/invoke-azresourceaction) command:
140+
Reset the application-scope password by using the [`Invoke-AzResourceAction`](/powershell/module/az.resources/invoke-azresourceaction) command:
115141

116142
```azurepowershell-interactive
117143
Invoke-AzResourceAction -ResourceGroupName <group-name> -ResourceType Microsoft.Web/sites -ResourceName <app-name> -Action newpassword
118144
```
119145

120146
# [Azure portal](#tab/portal)
121147

122-
1. From the left menu of your app, select **Deployment Center** > **FTPS credentials** or **Local Git/FTPS credentials**.
123-
124-
2. In the **Application scope** section, select **Reset**.
148+
1. From the left navigation menu of your app, select **Deployment Center** > **FTPS credentials** or **Local Git/FTPS credentials**.
149+
1. To reset your app-scope credentials and get a new password, select **Reset** at the bottom of the **Application-scope** section.
150+
1. To reset your user-scope credentials, select **Reset** at the bottom of the **User-scope** section. This action deletes both user name and password, and disables user-scope credentials. To reenable, enter a new username and password, and select **Save**. This action takes effect across all the apps in your account that use the user-scope credentials.
125151

126152
-----
127153

128-
## Disable basic authentication
129-
130-
See [Disable basic authentication in App Service deployment](configure-basic-auth-disable.md).
131-
132154
## Related content
133155

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).
156+
- [Disable basic authentication in Azure App Service deployments](configure-basic-auth-disable.md)
157+
- [Deploy to Azure App Service by using local Git](deploy-local-git.md)
158+
- [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: 0 additions & 12 deletions
This file was deleted.

0 commit comments

Comments
 (0)