0
votes

I'm in the middle of writing a routine to create .ics files in .Net, which are updated periodically by the calendar tool in my platform. Each time a change is made to the calendar, an updated .ics file is written out. This all works perfectly if I'm using a standard web folder on a regular old server.

Now, here's the rub. I've migrated the code across to work with Azure Blob storage and the files are written/updated as need be in blob storage. If I subscribe to the calendar in Outlook, everything appears and displays as it should. I can refresh and update the calendar just fine, but only for about 90 seconds. After that point - regardless of whether any changes have been made to the files or not - Outlook is no longer able to update the calendar and shows an error that reads:

"Task Internet Calendar Subscriptions" reported error (0XD49005): Cannot verify or add the calendar to Outlook. Make sure the following link is a valid calendar link:"

If I remove the calendar and re-subscribe, I get the same error. If I republish the ics files and then re-subscribe, all works again, but only for a minute or two.

Is there something I'm missing about Blob storage that means this is not a good way to store the files?

[UPDATE] Sorry about the vagaries on this. The code is simply using a stringbuilder to create the ICS file and then using a memorystream to write the file to blob storage using the UploadFromStream command. I've checked the files themselves and they appear to be fine, pass all validation and have content types of text/calendar all correctly set.

From another post on here, I've run Fiddler to watch the connections. Getting the file from the browser is not an issue, but when Outlook requests the file, it returns this response error:

HTTP/1.1 400 Authentication information is not given in the correct format. Check the value of Authorization header.

I'm a little out of my depth on this, but would I be correct in assuming that Outlook isn't going to be able to get the file as I don't believe I can set the authorisation information in Outlook itself?

1
You might want to consider editing your question to show some code. Right now, it's fairly broad and unclear what, exactly, the problem is.David Makogon

1 Answers

0
votes

So after lots of digging about, I found that Outlook wasn't able to authenticate against the files stored in Azure when syncing. So I quickly added a file handler to my code to grab the address if the URL ended with ".ics", then streamed the file through the website to the response object. Problem sorted.