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
@@ -68,10 +67,10 @@ Register the `SFTP Entra ID Support` preview feature on your Azure subscription.
68
67
69
68
Generate the OpenSSH certificate with the Azure CLI [az sftp](/cli/azure/sftp) command as shown in the following example.
70
69
71
-
```azurecli
72
-
az login
73
-
az sftp cert --file /my_cert.pub
74
-
```
70
+
```azurecli
71
+
az login
72
+
az sftp cert --file /my_cert.pub
73
+
```
75
74
For security reasons, the certificate is valid for only 65 minutes. After it expires, you need to rerun the command to get a new certificate.
76
75
77
76
> [!NOTE]
@@ -81,9 +80,9 @@ Optionally, you can generate your own SSH key pair and use it when downloading t
81
80
82
81
Generate SSH key pair: You must use RSA keys, as Microsoft Entra ID supports only RSA certificates.
83
82
84
-
```bash
85
-
ssh-keygen -t rsa
86
-
```
83
+
```bash
84
+
ssh-keygen -t rsa
85
+
```
87
86
88
87
The following key files will be generated:
89
88
@@ -94,127 +93,127 @@ The following key files will be generated:
94
93
95
94
Use the following command to generate the SSH certificate with the generated keys:
96
95
97
-
```azurecli
98
-
az login
99
-
az sftp cert --public-key-file /id_rsa.pub --file /my_cert.pub
100
-
```
96
+
```azurecli
97
+
az login
98
+
az sftp cert --public-key-file /id_rsa.pub --file /my_cert.pub
99
+
```
101
100
102
101
If you're using a service principal, you can sign in by using either a client secret or a certificate:
103
102
104
103
To sign in by using a certificate, use the following command:
105
104
106
-
```azurecli
107
-
az login --service-principal -u <application_id_or_client_id> --tenant <tenant_id> --certificate <path_to_certificate>
108
-
```
105
+
```azurecli
106
+
az login --service-principal -u <application_id_or_client_id> --tenant <tenant_id> --certificate <path_to_certificate>
107
+
```
109
108
110
109
To sign in by using a client secret, use the following command:
111
110
112
-
```azurecli
113
-
az login --service-principal -u <application_id_or_client_id> -p <secret_value> --tenant <tenant_id>
114
-
```
111
+
```azurecli
112
+
az login --service-principal -u <application_id_or_client_id> -p <secret_value> --tenant <tenant_id>
113
+
```
115
114
116
115
After authentication, run the same command to download the certificate:
117
116
118
-
```azurecli
119
-
az sftp cert --public-key-file /id_rsa.pub --file /my_cert.pub
120
-
```
117
+
```azurecli
118
+
az sftp cert --public-key-file /id_rsa.pub --file /my_cert.pub
119
+
```
121
120
122
121
#### [Azure PowerShell](#tab/azurepowershell)
123
122
124
123
Sign in to your Azure subscription with the `Connect-AzAccount` command and follow the on-screen directions. Service principals and managed identity authorization is not yet supported for generating a certificate.
125
124
126
-
```powershell
127
-
Connect-AzAccount
128
-
```
125
+
```powershell
126
+
Connect-AzAccount
127
+
```
129
128
130
129
Generate the OpenSSH certificate by using [PowerShell Az.Sftp](https://www.powershellgallery.com/packages/Az.Sftp/0.1.0) as shown in the following example:
0 commit comments