-
Notifications
You must be signed in to change notification settings - Fork 4.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Support SFTP on the Terraform resource azurerm_storage_account #14736
Comments
This comment was marked as off-topic.
This comment was marked as off-topic.
If you can't wait for this feature and need to add the flag via terraform then using the AzAPI Provider could be a good workaround option for you resource "azurerm_resource_group" "example" {
name = "example-resources"
location = "West Europe"
}
resource "azurerm_storage_account" "example" {
name = "storageaccountname"
resource_group_name = azurerm_resource_group.example.name
location = azurerm_resource_group.example.location
account_tier = "Standard"
account_replication_type = "LRS"
is_hns_enabled = true
is_sftp_enabled = true
tags = {
environment = "staging"
}
}
# Workaround until azurerm_storage_account supports isSftpEnabled property
# see https://github.com/hashicorp/terraform-provider-azurerm/issues/14736
resource "azapi_update_resource" "example_enable_sftp" {
type = "Microsoft.Storage/storageAccounts@2021-09-01"
resource_id = azurerm_storage_account.example.id
body = jsonencode({
properties = {
isSftpEnabled = true
}
})
} |
To add to the answer of @bamarch, the following snippet can be used to add a local user for the SFTP (needs a blob-container with containername):
However, for this particular use case I would like to also retrieve the SSH password with Terraform. For this, I think I need the regeneratePassword command. However, I do not know how to call this using terraform. Does anyone have an example for me? |
To answer my own question. I solved retrieving the password with an external data provider:
where
|
I managed to get password generated entirely within terraform using following azapi action: resource "azapi_resource_action" "generate_sftp_user_password" {
type = "Microsoft.Storage/storageAccounts/localUsers@2022-05-01"
resource_id = azapi_resource.sftp_user.id
action = "regeneratePassword"
body = jsonencode({
username = azapi_resource.sftp_user.name
})
response_export_values = ["sshPassword"]
} The password is then stored in the |
any possibility to have the sftp feature directly integrate to the provider azurerm or we must rely on the azapi_update_resource trick ? |
Are there any plans to implement this feature in azurerm ? I dont see any activity from their team on this issue? |
is there any way to use SSHKyePair instead of SSHPassword, or use both at the same time, as i cannot seem to find anything about using a keypair through terraform for sftp users, only through the portal, but that is not a good option. |
Are there any plans to implement this feature in azurerm provider soon? |
Would love this feature. Even just to enable it, user setup would be great too, but that can be a separate issue. Just the option to enable it in terraform would help a lot. |
This feature would be so useful to have. Hopefully it's added soon |
…m_security_center_server_vulnerability_assessment_virtual_machine` - adding pricing tier in test config Relates-to: hashicorp#14736
…ecurity_solution` Relates-to: hashicorp#14736
Relates-to: hashicorp#14736
Relates-to: hashicorp#14736
Relates-to: hashicorp#14736
…ed` and `is_hns_enabled` (hashicorp#19418) Fix hashicorp#19414 Relates-to: hashicorp#14736
Relates-to: hashicorp#14736
Hey all, just added a PR to enable the service, may look to improving it in the future and add some more features as I'm likely going to need it. |
Relates-to: hashicorp#14736
Closed by #19428 |
…9428) * adds sftp_enabled property to azurerm_storage_account Relates-to: hashicorp#14736 * resolves lint error Relates-to: hashicorp#14736 * resolves comments, bool in notes and error msg format Relates-to: hashicorp#14736
This functionality has been released in v3.34.0 of the Terraform Provider. Please see the Terraform documentation on provider versioning or reach out if you need any assistance upgrading. For further feature requests or bug reports with this functionality, please create a new GitHub issue following the template. Thank you! |
@leesutcliffe Will this also include adding local users? or will that we be a separate resource and will be in a later release? |
@raswinraaj this issue is in relation to enabling the SFTP service only. |
I'm going to lock this issue because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active issues. |
Community Note
Description
This concerns SSH File Transfer Protocol (SFTP) support for Azure Blob Storage.
New or Affected Resource(s)
Potential Terraform Configuration
References
The text was updated successfully, but these errors were encountered: