Skip to content
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

Added support for file share #969

Open
wants to merge 92 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 55 commits
Commits
Show all changes
92 commits
Select commit Hold shift + click to select a range
8d71072
changed something
gapra-msft Jun 15, 2022
d33e4e6
setup AzConnection interface for FileShare; unsure of struct properties
meganliu-msft Jun 17, 2022
eef655c
finalized fileshare properties
meganliu-msft Jun 17, 2022
cefa10f
added "return nil" for empty methods
meganliu-msft Jun 17, 2022
a227a7d
changed bool return value from nil to false
meganliu-msft Jun 17, 2022
85813ca
renamed "Container" to "Share"
meganliu-msft Jun 17, 2022
48741fa
added file as a data type in config file
meganliu-msft Jun 20, 2022
9a29046
changed FilesFuse to BlobFuse2
meganliu-msft Jun 20, 2022
3df489a
changed filesfuse to blobfuse2
meganliu-msft Jun 21, 2022
1e008c4
added fileshare type to config and functionality allowing for object …
meganliu-msft Jun 21, 2022
6afb2b4
Merge pull request #817 from Azure/interfaceSetup
meganliu-msft Jun 21, 2022
d6533d8
Merge pull request #822 from Azure/fileTypeSetup
meganliu-msft Jun 21, 2022
afc0f0c
file auth for shared key and sas
meganliu-msft Jun 25, 2022
22c377d
auth testing for file share
meganliu-msft Jun 28, 2022
757f72b
add files to yaml pipeline scripts
meganliu-msft Jun 28, 2022
afb8b8a
implemented methods that call getAzAuth, including SetupPipeline and …
meganliu-msft Jun 29, 2022
a934655
Merge pull request #827 from Azure/filesAuth
meganliu-msft Jun 29, 2022
9d7fb19
implemented List()
meganliu-msft Jul 5, 2022
a17bb3e
implemented GetAttr(), Exists(), and ListShares()
meganliu-msft Jul 6, 2022
42e783f
address pr comments--cleanup code
meganliu-msft Jul 11, 2022
3041a09
implement SetPrefixPath()
meganliu-msft Jul 11, 2022
56ffcd9
update log err
meganliu-msft Jul 11, 2022
32cefbd
implement file setup methods
meganliu-msft Jul 13, 2022
937897b
implement WriteFromBuffer(); used in file setup methods
meganliu-msft Jul 13, 2022
2b1e6f4
Merge pull request #833 from Azure/filesMvpInterfaceMethods
meganliu-msft Jul 13, 2022
844a94f
implement file and directory operations (create, delete, rename); Ren…
meganliu-msft Jul 14, 2022
d4522ef
add files and directory set up methods + some testing
meganliu-msft Jul 18, 2022
3b39547
Update component/azstorage/file_share.go
meganliu-msft Jul 18, 2022
bd9c22a
add printed errors
meganliu-msft Jul 20, 2022
1dd942d
Merge pull request #840 from Azure/fileAndDirSetupMethods
meganliu-msft Jul 20, 2022
914b0e4
implement file read and write methods + some unit testing; git corrup…
meganliu-msft Aug 2, 2022
e395bd1
add more unit tests + fix small bugs in file_share.go
meganliu-msft Aug 6, 2022
c7b5294
make progress on unit tests; some bugs with file sizing (from SDK ver…
meganliu-msft Aug 8, 2022
fa7d16f
add more unit tests
meganliu-msft Aug 9, 2022
7fdfc12
fix: log fileerr instead of err
meganliu-msft Aug 9, 2022
b2b30f5
Merge branch 'main' into filesFuseMain2
gapra-msft Aug 9, 2022
151dd3b
make method name/logs/comments consistent
meganliu-msft Aug 9, 2022
86d1568
Merge branch 'filesFuseMain2' into fileReadWriteMethods
meganliu-msft Aug 9, 2022
6b81c51
fix list reference in GetFileBlockOffsets()
meganliu-msft Aug 10, 2022
ea3db94
fix RenameDirectory() and comment out test not working
meganliu-msft Aug 10, 2022
02544fd
fix method name in the log
meganliu-msft Aug 10, 2022
64dfa3e
catch edge case in RenameDirectory() with preexisting target dir
meganliu-msft Aug 11, 2022
ee78967
add unit tests for writing, symlinks, getattr, chmod
meganliu-msft Aug 12, 2022
4b9de78
add TestFileRangeSize()
meganliu-msft Aug 12, 2022
ed84d5d
add dynamic file sizing and more unit tests
meganliu-msft Aug 19, 2022
2522905
finish unit tests and updating dependency on SDK for rename methods
meganliu-msft Aug 21, 2022
15d0b70
fix conflicts after pulling from remote
meganliu-msft Aug 22, 2022
bdc251a
cleanup code
meganliu-msft Aug 22, 2022
65f41e6
fix typo
meganliu-msft Aug 22, 2022
babca5b
Merge pull request #859 from Azure/fileReadWriteMethods
meganliu-msft Aug 23, 2022
0b55c85
Merge branch 'main' into filesFuseMain2
gapra-msft Aug 24, 2022
9ee191e
filesfuse e2e testing (#876)
meganliu-msft Sep 12, 2022
885a491
Merge branch 'main' into filesFuseMain2
gapra-msft Nov 7, 2022
a26129a
Fixed build issue
gapra-msft Nov 7, 2022
7951ab8
Cleaned up e2e tests
gapra-msft Nov 7, 2022
5ee4f32
Fix codespell
gapra-msft Nov 7, 2022
7dd75eb
Undo release distro tests
gapra-msft Nov 7, 2022
e2283f4
Added new features
gapra-msft Nov 8, 2022
8c67be4
Set md5 to nil instead of empty array on not setting
gapra-msft Nov 8, 2022
955efb3
Set md5 to nil instead of empty array on not setting
gapra-msft Nov 8, 2022
b97d5c8
added md5 tests
gapra-msft Nov 8, 2022
29faf31
Merge branch 'main' into filesFuseMain2
gapra-msft Nov 10, 2022
67df7bd
Added file share data validation
gapra-msft Nov 10, 2022
766110e
Added fileshare param to e2e tests
gapra-msft Nov 10, 2022
a27e94d
Added share cleanup
gapra-msft Nov 10, 2022
d0bdcc1
Added file share to distro tests
gapra-msft Nov 10, 2022
60ae4bc
fix pipeline
gapra-msft Nov 10, 2022
45a5f7f
Remove stream cases from distro tests
gapra-msft Nov 10, 2022
22cd6e8
clean up manual e2e tests to e2e tests spcl
gapra-msft Nov 10, 2022
23672dd
Separate Blob and ADLS base tests
gapra-msft Nov 10, 2022
7e0a6e2
Add exhaustive test
gapra-msft Nov 10, 2022
9aacc2c
skip ut
gapra-msft Nov 10, 2022
ac13743
remove file share
gapra-msft Nov 10, 2022
6f6654d
Add name
gapra-msft Nov 10, 2022
c1bc516
Only print azurite file if testing it
gapra-msft Nov 10, 2022
08da4b9
turn git clone off for file share
gapra-msft Nov 11, 2022
11d4ecd
Merge branch 'gapra/distroTestsCleanup' into filesFuseMain2
gapra-msft Nov 11, 2022
a8c0c4f
Add file share to nightly
gapra-msft Nov 11, 2022
8db514e
added values for spn
gapra-msft Nov 11, 2022
1f6168e
Added temp and mount dir
gapra-msft Nov 11, 2022
1a51d96
Fix condition runs and vm name
gapra-msft Nov 14, 2022
f3c2430
sync with main
vibhansa-msft Apr 26, 2023
403c4a0
Merge remote-tracking branch 'origin/main' into filesFuseMain2
vibhansa-msft Apr 28, 2023
2b14f03
Correcting copyright
vibhansa-msft May 8, 2023
037eadd
Increasing timeout of stage
vibhansa-msft May 8, 2023
fb411f4
Sync with main
vibhansa-msft May 10, 2023
19df00f
Correcting go format
vibhansa-msft May 10, 2023
1530253
Correcting pipeline creation steps
vibhansa-msft May 11, 2023
f363d4c
Correcting file pipeline
vibhansa-msft May 11, 2023
5c9fc21
correcting default values"
vibhansa-msft May 12, 2023
ac3de03
Adding tags to missing e2e tests
vibhansa-msft May 15, 2023
1ea5f1a
correcting stage names
vibhansa-msft May 15, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions azure-pipeline-templates/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -117,14 +117,18 @@ steps:
echo "{" > $cnfFile
echo "\"block-acct\"": "\"$(AZTEST_BLOCK_ACC_NAME)\"", >> $cnfFile
echo "\"adls-acct\"": "\"$(AZTEST_ADLS_ACC_NAME)\"", >> $cnfFile
echo "\"file-acct\"": "\"$(AZTEST_FILE_ACC_NAME)\"", >> $cnfFile
echo "\"block-cont\"": "\"${{ parameters.container }}\"", >> $cnfFile
echo "\"adls-cont\"": "\"${{ parameters.container }}\"", >> $cnfFile
echo "\"file-cont\"": "\"${{ parameters.container }}\"", >> $cnfFile
echo "\"block-key\"": "\"$(AZTEST_BLOCK_KEY)\"", >> $cnfFile
echo "\"adls-key\"": "\"$(AZTEST_ADLS_KEY)\"", >> $cnfFile
echo "\"file-key\"": "\"$(AZTEST_FILE_KEY)\"", >> $cnfFile
echo "\"block-sas\"": "\"$(AZTEST_BLOCK_SAS)\"", >> $cnfFile
echo "\"block-cont-sas-ubn-18\"": "\"$(AZTEST_BLOCK_CONT_SAS_UBN_18)\"", >> $cnfFile
echo "\"block-cont-sas-ubn-20\"": "\"$(AZTEST_BLOCK_CONT_SAS_UBN_20)\"", >> $cnfFile
echo "\"adls-sas\"": "\"$(AZTEST_ADLS_SAS)\"", >> $cnfFile
echo "\"file-sas\"": "\"$(AZTEST_FILE_SAS)\"", >> $cnfFile
echo "\"msi-appid\"": "\"$(AZTEST_APP_ID)\"", >> $cnfFile
echo "\"msi-resid\"": "\"$(AZTEST_RES_ID)\"", >> $cnfFile
echo "\"msi-objid\"": "\"$(AZTEST_OBJ_ID)\"", >> $cnfFile
Expand Down
4 changes: 3 additions & 1 deletion azure-pipeline-templates/e2e-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@ parameters:
type: step
- name: adls
type: boolean
- name: fileshare
type: boolean
- name: clone
type: boolean
default: false
Expand Down Expand Up @@ -51,7 +53,7 @@ steps:
- task: Go@0
inputs:
command: 'test'
arguments: '-v -timeout=2h ./... -args -mnt-path=${{ parameters.mount_dir }} -adls=${{parameters.adls}} -clone=${{parameters.clone}} -tmp-path=${{parameters.temp_dir}} -quick-test=${{parameters.quick_test}} -stream-direct-test=${{parameters.stream_direct_test}} -distro-name="${{parameters.distro_name}}"'
arguments: '-v -timeout=2h ./... -args -mnt-path=${{ parameters.mount_dir }} -adls=${{parameters.adls}} -fileshare=false -clone=${{parameters.clone}} -tmp-path=${{parameters.temp_dir}} -quick-test=${{parameters.quick_test}} -stream-direct-test=${{parameters.stream_direct_test}} -distro-name="${{parameters.distro_name}}"'
workingDirectory: ${{ parameters.working_dir }}/test/e2e_tests
displayName: 'E2E Test: ${{ parameters.idstring }}'
timeoutInMinutes: 120
Expand Down
47 changes: 47 additions & 0 deletions azure-pipeline-templates/release-distro-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -132,6 +132,53 @@ steps:
blobfuse2 unmount ${{ parameters.mount_dir }}
displayName: 'Unmount ADLS'

# - script: |
# blobfuse2 gen-test-config --config-file=${{ parameters.root_dir }}/azure-storage-fuse/testdata/config/azure_key.yaml --container-name=${{ parameters.container }} --temp-path=${{ parameters.temp_dir }} --output-file=${{ parameters.root_dir }}/file_share_config.yaml
# displayName: 'Create File Share Config File'
# env:
# NIGHTLY_STO_ACC_NAME: $(AZTEST_FILE_ACC_NAME)
# NIGHTLY_STO_ACC_KEY: $(AZTEST_FILE_KEY)
# ACCOUNT_TYPE: 'file'
# ACCOUNT_ENDPOINT: 'https://$(AZTEST_FILE_ACC_NAME).file.core.windows.net'
# VERBOSE_LOG: false
# USE_HTTP: false
# continueOnError: false

# - script: |
# cat ${{ parameters.root_dir }}/file_share_config.yaml
# displayName: 'Print File Share Config File'

# - script: |
# blobfuse2 unmount all
# sudo fusermount -u ${{ parameters.mount_dir }}
# blobfuse2 mount ${{ parameters.mount_dir }} --config-file=${{ parameters.root_dir }}/file_share_config.yaml
# displayName: 'Mount File Share'

# # Wait for some time to let the container come up
# - script: |
# sleep 10s
# displayName: 'Waiting for Mount'

# - script: |
# df
# echo "-------------------------------------------------------------------"
# df | grep blobfuse2
# exit $?
# displayName: 'Verify Mount'

# - task: Go@0
# inputs:
# command: 'test'
# arguments: '-v -timeout=2h -run Test.i.* -args -mnt-path=${{ parameters.mount_dir }} -adls=false -fileshare=true -clone=false -tmp-path=${{ parameters.temp_dir }} -quick-test=true'
# workingDirectory: ${{ parameters.work_dir }}/test/e2e_tests
# displayName: 'E2E Test: File Share'
# timeoutInMinutes: 120
# continueOnError: false

- script: |
blobfuse2 unmount ${{ parameters.mount_dir }}
displayName: 'Unmount File Share'

- script: |
cat blobfuse2-logs.txt
displayName: 'View Logs'
Expand Down
6 changes: 5 additions & 1 deletion blobfuse2-ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -65,14 +65,18 @@ jobs:
echo "{" > $cnfFile
echo "\"block-acct\"": "\"$(AZTEST_BLOCK_ACC_NAME)\"", >> $cnfFile
echo "\"adls-acct\"": "\"$(AZTEST_ADLS_ACC_NAME)\"", >> $cnfFile
echo "\"file-acct\"": "\"$(AZTEST_FILE_ACC_NAME)\"", >> $cnfFile
echo "\"block-cont\"": "\"$(containerName)\"", >> $cnfFile
echo "\"adls-cont\"": "\"$(containerName)\"", >> $cnfFile
cho "\"file-cont\"": "\"$(containerName)\"", >> $cnfFile
echo "\"block-key\"": "\"$(AZTEST_BLOCK_KEY)\"", >> $cnfFile
echo "\"adls-key\"": "\"$(AZTEST_ADLS_KEY)\"", >> $cnfFile
echo "\"file-key\"": "\"$(AZTEST_FILE_KEY)\"", >> $cnfFile
echo "\"block-sas\"": "\"$(AZTEST_BLOCK_SAS)\"", >> $cnfFile
echo "\"adls-sas\"": "\"$(adlsSas)\"", >> $cnfFile
echo "\"file-sas\"": "\"$(AZTEST_FILE_SAS)\"", >> $cnfFile
echo "\"block-cont-sas-ubn-18\"": "\"$(AZTEST_BLOCK_CONT_SAS_UBN_18)\"", >> $cnfFile
echo "\"block-cont-sas-ubn-20\"": "\"$(AZTEST_BLOCK_CONT_SAS_UBN_20)\"", >> $cnfFile
echo "\"adls-sas\"": "\"$(adlsSas)\"", >> $cnfFile
echo "\"msi-appid\"": "\"$(AZTEST_APP_ID)\"", >> $cnfFile
echo "\"msi-resid\"": "\"$(AZTEST_RES_ID)\"", >> $cnfFile
echo "\"msi-objid\"": "\"$(AZTEST_OBJ_ID)\"", >> $cnfFile
Expand Down
22 changes: 22 additions & 0 deletions component/azstorage/azauth.go
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,8 @@ func getAzAuth(config azAuthConfig) azAuth {
return getAzAuthBlob(config)
} else if EAccountType.ADLS() == config.AccountType {
return getAzAuthBfs(config)
} else if EAccountType.FILE() == config.AccountType {
return getAzAuthFile(config)
}
return nil
}
Expand Down Expand Up @@ -159,6 +161,26 @@ func getAzAuthBfs(config azAuthConfig) azAuth {
return nil
}

func getAzAuthFile(config azAuthConfig) azAuth {
base := azAuthBase{config: config}
if config.AuthMode == EAuthType.KEY() {
return &azAuthFileKey{
azAuthKey{
azAuthBase: base,
},
}
} else if config.AuthMode == EAuthType.SAS() {
return &azAuthFileSAS{
azAuthSAS{
azAuthBase: base,
},
}
} else {
log.Crit("azAuth::getAzAuthBfs : Auth type %s not supported. Failed to create Auth object", config.AuthMode)
}
return nil
}

type azAuthBase struct {
config azAuthConfig
}
Expand Down
69 changes: 69 additions & 0 deletions component/azstorage/azauth_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -53,17 +53,22 @@ type storageTestConfiguration struct {
// Get the mount path from command line argument
BlockAccount string `json:"block-acct"`
AdlsAccount string `json:"adls-acct"`
FileAccount string `json:"file-acct"`
BlockContainer string `json:"block-cont"`
AdlsContainer string `json:"adls-cont"`
FileContainer string `json:"file-cont"`
// AdlsDirectory string `json:"adls-dir"`
BlockContainerHuge string `json:"block-cont-huge"`
AdlsContainerHuge string `json:"adls-cont-huge"`
FileContainerHuge string `json:"file-cont-huge"`
BlockKey string `json:"block-key"`
AdlsKey string `json:"adls-key"`
FileKey string `json:"file-key"`
BlockSas string `json:"block-sas"`
BlockContSasUbn18 string `json:"block-cont-sas-ubn-18"`
BlockContSasUbn20 string `json:"block-cont-sas-ubn-20"`
AdlsSas string `json:"adls-sas"`
FileSas string `json:"file-sas"`
// AdlsDirSasUbn18 string `json:"adls-dir-sas-ubn-18"`
// AdlsDirSasUbn20 string `json:"adls-dir-sas-ubn-20"`
MsiAppId string `json:"msi-appid"`
Expand Down Expand Up @@ -143,6 +148,8 @@ func generateEndpoint(useHttp bool, accountName string, accountType AccountType)
endpoint += ".dfs."
} else if accountType == EAccountType.BLOCK() {
endpoint += ".blob."
} else if accountType == EAccountType.FILE() {
endpoint += ".file."
}
endpoint += "core.windows.net/"
return endpoint
Expand Down Expand Up @@ -338,6 +345,37 @@ func (suite *authTestSuite) TestHttpAdlsSharedKey() {
suite.validateStorageTest("TestHttpAdlsSharedKey", stgConfig)
}

func (suite *authTestSuite) TestFileSharedKey() {
defer suite.cleanupTest()
stgConfig := AzStorageConfig{
container: storageTestConfigurationParameters.FileContainer,
authConfig: azAuthConfig{
AuthMode: EAuthType.KEY(),
AccountType: EAccountType.FILE(),
AccountName: storageTestConfigurationParameters.FileAccount,
AccountKey: storageTestConfigurationParameters.FileKey,
Endpoint: generateEndpoint(false, storageTestConfigurationParameters.FileAccount, EAccountType.FILE()),
},
}
suite.validateStorageTest("TestFileSharedKey", stgConfig)
}

func (suite *authTestSuite) TestHttpFileSharedKey() {
defer suite.cleanupTest()
stgConfig := AzStorageConfig{
container: storageTestConfigurationParameters.FileContainer,
authConfig: azAuthConfig{
AuthMode: EAuthType.KEY(),
AccountType: EAccountType.FILE(),
AccountName: storageTestConfigurationParameters.FileAccount,
AccountKey: storageTestConfigurationParameters.FileKey,
UseHTTP: true,
Endpoint: generateEndpoint(true, storageTestConfigurationParameters.FileAccount, EAccountType.FILE()),
},
}
suite.validateStorageTest("TestHttpFileSharedKey", stgConfig)
}

func (suite *authTestSuite) TestBlockInvalidSasKey() {
defer suite.cleanupTest()
stgConfig := AzStorageConfig{
Expand Down Expand Up @@ -521,6 +559,37 @@ func (suite *authTestSuite) TestHttpAdlsSasKey() {
suite.validateStorageTest("TestHttpAdlsSasKey", stgConfig)
}

func (suite *authTestSuite) TestFileSasKey() {
defer suite.cleanupTest()
stgConfig := AzStorageConfig{
container: storageTestConfigurationParameters.FileContainer,
authConfig: azAuthConfig{
AuthMode: EAuthType.SAS(),
AccountType: EAccountType.FILE(),
AccountName: storageTestConfigurationParameters.FileAccount,
SASKey: storageTestConfigurationParameters.FileSas,
Endpoint: generateEndpoint(false, storageTestConfigurationParameters.FileAccount, EAccountType.FILE()),
},
}
suite.validateStorageTest("TestFileSasKey", stgConfig)
}

func (suite *authTestSuite) TestHttpFileSasKey() {
defer suite.cleanupTest()
stgConfig := AzStorageConfig{
container: storageTestConfigurationParameters.FileContainer,
authConfig: azAuthConfig{
AuthMode: EAuthType.SAS(),
AccountType: EAccountType.FILE(),
AccountName: storageTestConfigurationParameters.FileAccount,
SASKey: storageTestConfigurationParameters.FileSas,
UseHTTP: true,
Endpoint: generateEndpoint(true, storageTestConfigurationParameters.FileAccount, EAccountType.FILE()),
},
}
suite.validateStorageTest("TestHttpFileSasKey", stgConfig)
}

// func (suite *authTestSuite) TestAdlsDirSasKey() {
// defer suite.cleanupTest()
// assert := assert.New(suite.T())
Expand Down
23 changes: 23 additions & 0 deletions component/azstorage/azauthkey.go
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ import (

"github.com/Azure/azure-storage-azcopy/v10/azbfs"
"github.com/Azure/azure-storage-blob-go/azblob"
"github.com/Azure/azure-storage-file-go/azfile"
)

// Verify that the Auth implement the correct AzAuth interfaces
Expand Down Expand Up @@ -87,3 +88,25 @@ func (azkey *azAuthBfsKey) getCredential() interface{} {

return credential
}

type azAuthFileKey struct {
azAuthKey
}

// GetCredential : Gets shared key based storage credentials for datalake
func (azkey *azAuthFileKey) getCredential() interface{} {
if azkey.config.AccountKey == "" {
log.Err("azAuthFileKey::getCredential : Shared key for account is empty, cannot authenticate user")
return nil
}

credential, err := azfile.NewSharedKeyCredential(
azkey.config.AccountName,
azkey.config.AccountKey)
if err != nil {
log.Err("azAuthFileKey::getCredential : Failed to create shared key credentials")
return nil
}

return credential
}
15 changes: 15 additions & 0 deletions component/azstorage/azauthsas.go
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ import (

"github.com/Azure/azure-storage-azcopy/v10/azbfs"
"github.com/Azure/azure-storage-blob-go/azblob"
"github.com/Azure/azure-storage-file-go/azfile"
)

// Verify that the Auth implement the correct AzAuth interfaces
Expand Down Expand Up @@ -91,3 +92,17 @@ func (azsas *azAuthBfsSAS) getCredential() interface{} {

return azbfs.NewAnonymousCredential()
}

type azAuthFileSAS struct {
azAuthSAS
}

// GetCredential : Gets SAS based credentials for blob
func (azsas *azAuthFileSAS) getCredential() interface{} {
if azsas.config.SASKey == "" {
log.Err("azAuthFileSAS::getCredential : SAS key for account is empty, cannot authenticate user")
return nil
}

return azfile.NewAnonymousCredential()
}
4 changes: 4 additions & 0 deletions component/azstorage/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,10 @@ func (AccountType) ADLS() AccountType {
return AccountType(2)
}

func (AccountType) FILE() AccountType {
return AccountType(3)
}

func (f AccountType) String() string {
return enum.StringInt(f, reflect.TypeOf(f))
}
Expand Down
7 changes: 7 additions & 0 deletions component/azstorage/connection.go
Original file line number Diff line number Diff line change
Expand Up @@ -140,6 +140,13 @@ func NewAzStorageConnection(cfg AzStorageConfig) AzConnection {
stg := &Datalake{}
_ = stg.Configure(cfg)
return stg
} else if cfg.authConfig.AccountType == EAccountType.FILE() {
stg := &FileShare{}
if err := stg.Configure(cfg); err != nil {
log.Err("NewAzStorageConnection : Failed to configure FileShare object (%s)", err.Error())
return nil
}
return stg
}

return nil
Expand Down
Loading