|
1 | 1 | ---
|
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. |
4 | 4 | author: cephalin
|
5 | 5 | ms.author: cephalin
|
6 | 6 | ms.reviewer: byvinyal
|
7 | 7 | ms.topic: how-to
|
8 |
| -ms.date: 01/26/2024 |
| 8 | +ms.date: 07/01/2025 |
9 | 9 |
|
10 | 10 | ---
|
11 | 11 |
|
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. |
14 | 17 |
|
15 | 18 | [!INCLUDE [app-service-deploy-credentials](../../includes/app-service-deploy-credentials.md)]
|
16 | 19 |
|
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 |
19 | 21 |
|
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. |
21 | 23 |
|
22 |
| -# [Azure CLI](#tab/cli) |
| 24 | +<a name="disable-basic-authentication"></a> |
| 25 | +### Basic authentication requirement |
23 | 26 |
|
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. |
25 | 28 |
|
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). |
28 | 30 |
|
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 |
32 | 33 |
|
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. |
34 | 35 |
|
35 |
| -# [Azure PowerShell](#tab/powershell) |
| 36 | +For local Git deployment, the user name can't contain the `@` character. |
36 | 37 |
|
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: |
38 | 39 |
|
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. |
40 | 41 |
|
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. |
42 | 43 |
|
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. |
44 | 45 |
|
45 |
| -1. From the left menu of your app, select > **Deployment Center** > **FTPS credentials** or **Local Git/FTPS credentials**. |
| 46 | +# [Azure CLI](#tab/cli) |
46 | 47 |
|
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. |
48 | 49 |
|
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 | +``` |
50 | 53 |
|
51 |
| - |
| 54 | +# [Azure PowerShell](#tab/powershell) |
52 | 55 |
|
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. |
54 | 57 |
|
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**. |
57 | 67 |
|
58 | 68 | -----
|
59 | 69 |
|
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 | + |
| 73 | + |
| 74 | +<a name="appscope"></a> |
| 75 | +## Get application-scope credentials |
61 | 76 |
|
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`. |
64 | 78 |
|
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. |
66 | 81 |
|
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. |
68 | 83 |
|
69 | 84 | # [Azure CLI](#tab/cli)
|
70 | 85 |
|
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: |
72 | 87 |
|
73 | 88 | ```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 |
75 | 90 | ```
|
76 | 91 |
|
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. |
78 | 93 |
|
79 | 94 | ```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 |
81 | 96 | ```
|
82 | 97 |
|
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`. |
85 | 99 |
|
86 | 100 | # [Azure PowerShell](#tab/powershell)
|
87 | 101 |
|
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: |
89 | 103 |
|
90 | 104 | ```azurepowershell-interactive
|
91 |
| -Get-AzWebAppPublishingProfile -ResourceGroupName <group-name> -Name <app-name> |
| 105 | +Get-AzWebAppPublishingProfile -ResourceGroupName myResourceGroup -Name myApp |
92 | 106 | ```
|
93 | 107 |
|
94 | 108 | # [Azure portal](#tab/portal)
|
95 | 109 |
|
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: |
97 | 111 |
|
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. |
99 | 115 |
|
100 | 116 | -----
|
101 | 117 |
|
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. |
103 | 125 |
|
104 | 126 | # [Azure CLI](#tab/cli)
|
105 | 127 |
|
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. |
107 | 129 |
|
108 | 130 | ```azurecli-interactive
|
109 | 131 | az resource invoke-action --action newpassword --resource-group <group-name> --name <app-name> --resource-type Microsoft.Web/sites
|
110 | 132 | ```
|
111 | 133 |
|
| 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 | + |
112 | 140 | # [Azure PowerShell](#tab/powershell)
|
113 | 141 |
|
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: |
115 | 143 |
|
116 | 144 | ```azurepowershell-interactive
|
117 | 145 | Invoke-AzResourceAction -ResourceGroupName <group-name> -ResourceType Microsoft.Web/sites -ResourceName <app-name> -Action newpassword
|
118 | 146 | ```
|
119 | 147 |
|
120 | 148 | # [Azure portal](#tab/portal)
|
121 | 149 |
|
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. |
123 | 151 |
|
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. |
125 | 153 |
|
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**. |
127 | 157 |
|
128 |
| -## Disable basic authentication |
| 158 | +This action takes effect across all the apps in your account that use the user-scope credentials. |
129 | 159 |
|
130 |
| -See [Disable basic authentication in App Service deployment](configure-basic-auth-disable.md). |
| 160 | +----- |
131 | 161 |
|
132 | 162 | ## Related content
|
133 | 163 |
|
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) |
0 commit comments