I have the task of making a .NET Core 3.1 console app that will run in a linux docker container on the AWS platform, connect to a Azure File Store to read and write files. I have am a C# programmer but have not had anything to do with the world of containers or Azure as yet.
I have received a Azure connection string in the following format: DefaultEndpointsProtocol=https;AccountName=[ACCOUNT_NAME_HERE];AccountKey=[ACCOUNT_KEY_HERE];EndpointSuffix=core.windows.net
But following the examples I have seen online like this:
- Right click on project in VS2019 and add Connected Service.
- Select Azure Storage from the list.
- Connect to you Azure Storage account
For step 3 you need to use an Azure Account login email/pass.
I don't have that, I just have a connection string.
I have found examples like the following:
But these both use:
Microsoft.Azure.Storage.Common
and under dependencies it has .NET Standard and .NET Framework. I don't think these will run in the linux docker container. Once I have worked out docker containers work I will do a test to confirm this.
Can anyone shed some light on how I can, from a .NET Core 3.1 console app running in a linux docker container on the AWS platform, connect to a Azure File Store to read and write files using the Azure connection string format outlined above?
If you focus on how to add service dependencies in Connected Service, then if you don't have the Azure Account login email/pass you can not add the service.
From your description, seems you just want to read and write files from files share of storage using C# console app. So you don't need to add service of project, just add the code in your console app is ok.
This is a simple code: