0

I use Google Calendar API to download events from my google calendar. It works on local machine fine. But id doesn't work after publish it on Azure because it use FileDataStore and app hasn't access to azure file system.

I also used EFDataStore but it doesn't work on Azure too.

Kirill
  • 429
  • 1
  • 6
  • 18
  • 2
    So where do you *want* to store authentication information? Fundamentally, you need a suitable `IDataStore` implementation, but we don't know where you want to store the data. – Jon Skeet Jan 31 '18 at 10:24
  • I uploaded ASP.NET MVC site on Azure and I need to get events from google calendar. I can't use FileDataStore because web site hasn't access to azure file system – Kirill Jan 31 '18 at 10:32
  • Yes, I understand that, but I'm asking where you want to store the cached authentication tokens as you can't use the file system. (You could do something in memory, but that doesn't work for multiple servers, or across server restarts.) – Jon Skeet Jan 31 '18 at 10:33
  • I can store token file at sqlite db, but I can't use FileDataStore from API with sqlite. I need to set the path – Kirill Jan 31 '18 at 10:39
  • I know you can't use `FileDataStore`. That's why I said you needed a suitable `IDataStore` implementation. I suggest you implement that interface to talk to sqlite. (Although that sounds like an odd situation - sqlite is more often used on clients than servers, as far as I understand it.) – Jon Skeet Jan 31 '18 at 10:40
  • Filedatastore allows you to change the directory where it uploads to https://www.daimto.com/google-net-filedatastore-demystified/ IIR Azure will allow you to write in its current directory. You could dump everything there. Here is a collection of datastores that you may find helpful https://gist.github.com/LindaLawton/a11851d51f13addd70264d01be1928bf – Linda Lawton - DaImTo Jan 31 '18 at 11:13
  • But note that using `FileDataStore` for just a local store has the issues I mentioned earlier in terms of scaling to multiple servers. You may well be better with something like Redis. – Jon Skeet Jan 31 '18 at 11:23
  • On Azure at FileDataStore(Server.MapPath(".")) I got error "Access is denied" – Kirill Jan 31 '18 at 13:05

1 Answers1

1

I'm hosting on Azure too.

I created a datastore using Azure Table Storage.

Here's a link to my gist

Just change it to your connection string and it should work.

Eilimint
  • 307
  • 1
  • 3
  • 11