To have a local storage during development on own environment (see https://experienceleaguecommunities.adobe.com/t5/project-firefly-questions/aio-local-action-with-err...) I thought I could use my access to Azure and setup containers to be used in the sdk init.
But aio-lib-lifes failed with error like "request to url XXX failed - getaddrinfo EAI_AGAIN" and aio-lib-files succeded but I was not able to write any keys...
is there any documentation on how to setup MS Azure to handle aio-lib-files and aio-lib-state? is it possible to use this access when running the "aio app run --local"? thanks for any help in this case!
Solved! Go to Solution.
Topics help categorize Community content and increase your ability to discover relevant content.
Views
Replies
Total Likes
Hi @Urs_Boller , I managed to init the State SDK and write / read operations with this.
const state = await stateLib.init({ cosmos: { endpoint, masterKey, databaseId, containerId, partitionKey } })
My "endpoint" value is like https://<tenant-name>.documents.azure.com:443.
Do you have the same?
Hi @Urs_Boller , I managed to init the State SDK and write / read operations with this.
const state = await stateLib.init({ cosmos: { endpoint, masterKey, databaseId, containerId, partitionKey } })
My "endpoint" value is like https://<tenant-name>.documents.azure.com:443.
Do you have the same?
hi @duypnguyen my endpoint looks as this. I don't think it's an issue with the connection for state, since there is no error (i just don't get any old values - means state.get returns always "undefined".
Views
Replies
Total Likes
Update: can see that aio-lib-states writes the values into storage, but I can't read (returns "undefined")
Views
Replies
Total Likes
next update: We tried to access the Azure with Postman, were able to receive the list of values. but as soon as we tried to access a single ressource on ../docs/{docsId} there was an error like "Partition key XXX is invalid". so it looks like under the hood there is an issue with the "partition key", but whatever we tryed, it we didn't succeed.
Remark: we needed to add an additional header "x-ms-documentdb-partitionkey" to get so far ...
Views
Replies
Total Likes
hi @Urs_Boller, I was able to reproduce your issue by giving the "partition key path" any value other than "/partitionKey". I think you have to set this exact value to make it work. See screenshot.
If you want to customize this path, there might be a way in the Files SDK. But I'm yet to look into it.
Views
Replies
Total Likes
Views
Replies
Total Likes
Views
Replies
Total Likes
@duypnguyen maybe you can give me a hint on the aio-lib-files:
I am able to init aio-lib-files and then with files.list() I can see the files and with files.read("xxx") I can read a file.
But the function files.write fails with the following error message:
@adobe/aio-lib-files:error {
"sdk": "FilesLib",
"sdkDetails": {
"filePath": "mydir/test.txt",
"contentType": "Buffer"
},
"code": "ERROR_BAD_CREDENTIALS",
"message": "[FilesLib:ERROR_BAD_CREDENTIALS] cannot access `cloud storage provider`, make sure your credentials are valid"
"stacktrace": "FilesLibError: [FilesLib:ERROR_BAD_CREDENTIALS] ...
}
any ideas what I need to change? seems strange to have read access but write doesn't work ...
Update: I tested what happens if I change the "storageAccessKey" to have the wrong value. In this case I can't even access the existing file and I get the "ERROR_BAD_CREDENTIALS" already on the "files.list" function ... that means, my credentials seem to be all right and the issue is somewhere else...
Views
Replies
Total Likes
Views
Replies
Total Likes
Views
Likes
Replies
Views
Likes
Replies