-
Notifications
You must be signed in to change notification settings - Fork 437
[Modules] Storage Accounts : Add SFTP feature to storage account module # 2378 #2514
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
Merged
karthikvenkat17
merged 27 commits into
Azure:main
from
karthikvenkat17:kavenka-sftp-feature
Dec 30, 2022
Merged
Changes from all commits
Commits
Show all changes
27 commits
Select commit
Hold shift + click to select a range
c7c33b0
sftp feature add
5404eab
added version.json
7d9f92e
added outputs
ac383d5
updated output name
5bad81f
updated readme
ecd6be6
readme updates
a46c391
readme updates
21920b2
readme updates
26df57c
readme updates
baaa436
update api version of localuser resource
a3d1940
add homedirectory to test bicep
d0994f6
readme update
9400d48
removed home directory from test.bicep
e623e2d
updated main module with null parameter scenarios
374a5ea
update version.json
b45c84a
updated parameter type for sharedkey
b9bf660
revert settings.yml
76118d5
change enable nfs/sftp flags to boolean
e0e19bb
fix errors reported by linter checks
56e4735
settings.yml update
9edac23
Merge branch 'main' into kavenka-sftp-feature
karthikvenkat17 13d1187
Update settings.yml
karthikvenkat17 4ca9bfd
updated as per review comments
58acdb3
settings.yml to run pipeline
3f24c38
settings.yml updates
b89ddb4
updated settings.yml
2acd7bf
restore settings.yml from upstream
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
65 changes: 65 additions & 0 deletions
65
modules/Microsoft.Storage/storageAccounts/localUsers/deploy.bicep
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,65 @@ | ||
| @maxLength(24) | ||
| @description('Conditional. The name of the parent Storage Account. Required if the template is used in a standalone deployment.') | ||
| param storageAccountName string | ||
|
|
||
| @description('Required. The name of the local user used for SFTP Authentication.') | ||
| param name string | ||
|
|
||
| @description('Optional. Indicates whether shared key exists. Set it to false to remove existing shared key.') | ||
| param hasSharedKey bool = false | ||
|
|
||
| @description('Required. Indicates whether SSH key exists. Set it to false to remove existing SSH key.') | ||
| param hasSshKey bool | ||
|
|
||
| @description('Required. Indicates whether SSH password exists. Set it to false to remove existing SSH password.') | ||
| param hasSshPassword bool | ||
|
|
||
| @description('Optional. The local user home directory.') | ||
| param homeDirectory string = '' | ||
|
|
||
| @description('Required. The permission scopes of the local user.') | ||
| param permissionScopes array | ||
|
|
||
| @description('Optional. The local user SSH authorized keys for SFTP.') | ||
| param sshAuthorizedKeys array = [] | ||
|
|
||
| @description('Optional. Enable telemetry via a Globally Unique Identifier (GUID).') | ||
| param enableDefaultTelemetry bool = true | ||
|
|
||
| resource defaultTelemetry 'Microsoft.Resources/deployments@2021-04-01' = if (enableDefaultTelemetry) { | ||
| name: 'pid-47ed15a6-730a-4827-bcb4-0fd963ffbd82-${uniqueString(deployment().name)}' | ||
| properties: { | ||
| mode: 'Incremental' | ||
| template: { | ||
| '$schema': 'https://schema.management.azure.com/schemas/2019-04-01/deploymentTemplate.json#' | ||
| contentVersion: '1.0.0.0' | ||
| resources: [] | ||
| } | ||
| } | ||
| } | ||
|
|
||
| resource storageAccount 'Microsoft.Storage/storageAccounts@2021-09-01' existing = { | ||
| name: storageAccountName | ||
| } | ||
|
|
||
| resource localUsers 'Microsoft.Storage/storageAccounts/localUsers@2022-05-01' = { | ||
| name: name | ||
| parent: storageAccount | ||
| properties: { | ||
| hasSharedKey: hasSharedKey | ||
| hasSshKey: hasSshKey | ||
| hasSshPassword: hasSshPassword | ||
| homeDirectory: homeDirectory | ||
| permissionScopes: permissionScopes | ||
| sshAuthorizedKeys: !empty(sshAuthorizedKeys) ? sshAuthorizedKeys : null | ||
| } | ||
| } | ||
|
|
||
| @description('The name of the deployed local user.') | ||
| output name string = localUsers.name | ||
|
|
||
| @description('The resource group of the deployed local user.') | ||
| output resourceGroupName string = resourceGroup().name | ||
|
|
||
| @description('The resource ID of the deployed local user.') | ||
| output resourceId string = localUsers.id |
55 changes: 55 additions & 0 deletions
55
modules/Microsoft.Storage/storageAccounts/localUsers/readme.md
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,55 @@ | ||
| # StorageAccounts LocalUsers `[Microsoft.Storage/storageAccounts/localUsers]` | ||
|
|
||
| This module deploys LocalUsers used for SFTP authentication. | ||
|
|
||
| ## Navigation | ||
|
|
||
| - [Resource Types](#Resource-Types) | ||
| - [Parameters](#Parameters) | ||
| - [Outputs](#Outputs) | ||
| - [Cross-referenced modules](#Cross-referenced-modules) | ||
|
|
||
| ## Resource Types | ||
|
|
||
| | Resource Type | API Version | | ||
| | :-- | :-- | | ||
| | `Microsoft.Storage/storageAccounts/localUsers` | [2022-05-01](https://docs.microsoft.com/en-us/azure/templates/Microsoft.Storage/2022-05-01/storageAccounts/localUsers) | | ||
|
|
||
| ## Parameters | ||
|
|
||
| **Required parameters** | ||
|
|
||
| | Parameter Name | Type | Description | | ||
| | :-- | :-- | :-- | | ||
| | `hasSshKey` | bool | Indicates whether SSH key exists. Set it to false to remove existing SSH key. | | ||
| | `hasSshPassword` | bool | Indicates whether SSH password exists. Set it to false to remove existing SSH password. | | ||
| | `name` | string | The name of the local user used for SFTP Authentication. | | ||
| | `permissionScopes` | array | The permission scopes of the local user. | | ||
|
|
||
| **Conditional parameters** | ||
|
|
||
| | Parameter Name | Type | Description | | ||
| | :-- | :-- | :-- | | ||
| | `storageAccountName` | string | The name of the parent Storage Account. Required if the template is used in a standalone deployment. | | ||
|
|
||
| **Optional parameters** | ||
|
|
||
| | Parameter Name | Type | Default Value | Description | | ||
| | :-- | :-- | :-- | :-- | | ||
| | `enableDefaultTelemetry` | bool | `True` | Enable telemetry via a Globally Unique Identifier (GUID). | | ||
| | `hasSharedKey` | bool | `False` | Indicates whether shared key exists. Set it to false to remove existing shared key. | | ||
| | `homeDirectory` | string | `''` | The local user home directory. | | ||
| | `sshAuthorizedKeys` | array | `[]` | The local user SSH authorized keys for SFTP. | | ||
|
|
||
|
|
||
| ## Outputs | ||
|
|
||
| | Output Name | Type | Description | | ||
| | :-- | :-- | :-- | | ||
| | `name` | string | The name of the deployed local user. | | ||
| | `resourceGroupName` | string | The resource group of the deployed local user. | | ||
| | `resourceId` | string | The resource ID of the deployed local user. | | ||
|
|
||
| ## Cross-referenced modules | ||
|
|
||
| _None_ |
4 changes: 4 additions & 0 deletions
4
modules/Microsoft.Storage/storageAccounts/localUsers/version.json
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,4 @@ | ||
| { | ||
| "$schema": "https://raw.githubusercontent.com/dotnet/Nerdbank.GitVersioning/master/src/NerdBank.GitVersioning/version.schema.json", | ||
| "version": "0.1" | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.