Get/Set metadata of azure files via unc - c#

I am accessing the azure files share via UNC. I have it mount in a windows vm and I am able to access/read files. However I also need to read and do things based on the metadata that is being set on those files.
As far I know the metadata are custom key-value pairs that can be stored on a azure file share, folder and files. A different application set it via Rest API sdks.
So, is there any way to get/set those custom metadata by mounting it in a vm?
I am using a c# program to read into the share and list files in order to find newly uploaded files. Although it works on checking last modified date, I still need to filter on a specific metadata to prevent double processing.

The REST metadata can only be accessed from REST and is not available through SMB.
If you wish you may leave your feedback here. All the feedback you share in these forums will be monitored and reviewed by the Microsoft engineering teams responsible for building Azure.

Related

Azure storage files force download to browser

I have my files stored in Azure File System and here are the requirements -
User should be able to view the documents without downloading it to the local
This is working fine for pdf but not any other mime types
I tried setting Content-Type,Content-Disposition (in azure file properties but no luck) and also iframe.
User should be able to edit the doc online without downloading.
I don't think this is possible just with Azure and have to integrate with One Drive may be? Correct me if I am wrong?
I would really appreciate any inputs/thoughts.
Not sure if this is a viable option but using Storage Accounts in Azure, you can map these accounts as a network drives to any client machine. So they would be able to access these files via File Explorer.
This link covers the basic steps in setting it up.
Unfortunately for anyone who wishes to use this feature, they need to be on Windows 8 (or above) to be able to map a network drive successfully as it uses SMB3.
If this option is a no go I will delete the post.

Proper place to store sqlite.db file in azure Web App [duplicate]

Q1: Where do you think is the right place to put a SQLite database file (database.sqlite) in Azure Web App file system? For example:
D:\home\data\database.sqlite
D:\home\site\database.sqlite
D:\home\site\wwwroot\database.sqlite
other?
Q2: What else should be taken into consideration in order to make sure that the database file won't be accessible to public users as well as not being accidentally overwritten during deployments or when the app is scaled up/down? (The Web App is configured for deployments from a Local Git Repository)
Q3: Where to learn more about the file system used in Azure App Service, the official source URL? E.g. how it's shared between multiple VMs within a single Web App, how does it work when the App is scaled up/down, what's the difference between D:\home (persistent) vs D:\local (non-persistent)...
Note that SQLite does not work in Azure Blob Storage, so that one is not an option. Please, don't suggest alternative storage solutions, this question is specifically about SQLite.
References
Appropriate Uses For SQLite
In a Web App, your app is deployed to d:\home\site\wwwroot. This is the area where you may write files. As an example, the ghost deployment writes its SQLite database to d:\home\site\wwwroot\content\data\ghost.db. (easy to see this, if you open up the kudu console via yourapp.scm.azurewebsites.net):
This file area is shared amongst your web app instances. Similar to an SMB file share, but specific to web apps (and different than Azure's File Service).
The content under wwwroot is durable, unless you delete your app service. Scaling up/down impacts the amount of space available. (I have no idea what happens if you scale down and the smaller size has less disk space than what you're consuming already).
I would say the best location would be app_data folder in the site/wwwroot folder. Create the folder if it doesn't exist.
Web Apps can connect to storage accounts so you can in fact use blob storage and connect that to your web app. So in terms of learning more about it then you need to be looking at the appropriate page of documentation.
In your Web App settings you can then select which storage account to use. You can find this under Settings > Data Connections where you can select Storage from the drop down box.

Copy data between two web site directory

I want to host 2 websites (Asp.net MVC) they have one folder with the same name and I want to copy data from one website to another periodically. For example website1/file/ to website2/file/.
That's why I thought to create a Windows service in order to do that.
My question is how can I copy data between these two folders via http.
Personally with the complexity around developing a solution I would look to use some kind of service like DropBox.
Another alternative would be to store the files in a distributed file system. This could be Amazon S3 or Azure Blob Store. This eliminates the need for the entire synchronization in the first place. This can be fronted by a proxy web service that can stream the file to the end user.
The reason I suggest this is because there is a lot of complexity around managing the synchronization of files via HTTP.
I don't think you will get a full solution on StackOverflow but I can make some recommendations.
I would use a master-slave system to co-ordinate synchronization. This would require some design and add to the complexity. But would give you the ability to add more nodes in the future. Implementing a master-slave system can't be easily detailed in a single post and would require you to research it further. There is good resource on here already. How to elect a master node among the nodes running in a cluster?
Calculating delta's for each node. e.g. What files do I have the master does not? What files does the master have that I do not. Are their naming conflicts on other nodes? How to determine what is the most upto date file?
Transfering the files.. Will require some sort of endpoint to connect to either as part of the service or as your existing website.
Http Client to send the files and handle progress/state of transfer for error handling.
Error handling over all, what happens if a file is part transfered to the Master and how to clean up failed files.
That is probably the tip of the complexity of trying to do this. Hence my recommendations of using an existing product or cloud service.

How to properly upload video files to Azure Media Services from angularjs

For my scenario, our current app is begin coded in html5 and angularjs communicating with web api. I have a workflow scenario that I seem to not be able to find an end to end example for. I would like to allow users of my website to upload videos and images to Azure Media Services. I found several examples that seem to move the data from a web page to blob storage and then copy over to azure media services.
Is there a way to upload the file directly to Media Services, instead of having a temporary and permanent blob container(one tied to AMS), as this approach seems to force me to have an additional storage container or is there a way to move the file to blob storage followed by linking the blob file to AMS via IAssetFile?
Can someone provide an end example that demonstrates the flow from web frontend upload to the file ending up in AMS?
Once up there, is there a way to make sure users can view but not download videos?
1.Is there a way to upload the file directly to Media Services:
The Media Services SDK requires you to first create an Asset object in our system. That Asset object is backed by a container in Storage. You can create an empty Asset object, and request a write only SAS URL (We call them "Locators" in our API) to upload your content directly into. You may want to check out this AngularJS module and see if it works. http://ngmodules.org/modules/angular-azure-blob-upload
2.Can someone provide an end example that demonstrates the flow from web frontend upload to the file ending up in AMS?
Your web API/frontend should use the Media Services SDK to create the empty Asset first. Once created, hand create a write only SAS URL and hand that back to your Angular client. The Angular client can then use client side javascript library to upload directly to the blob/container using the SAS URL and a module for azure-blob upload like the one here: http://ngmodules.org/modules/angular-azure-blob-upload
3.Once up there, is there a way to make sure users can view but not download videos?
Once the video is uploaded, you should Delete the Write only SAS "Locator" from your Asset's Locators collection. This way, nobody can use it to write again.
At this point you can create a Streaming Locator. Users will only be able to stream the file through our streaming services. Your file has to be encoded in a format that we can support streaming for, so you may have to first kick off an encoding job to get it into the right format and encoding settings (MP4 files with H264 and AAC audio). If you want to stream from Media Services, you need to make sure you have at least 1 streaming reserved unit enabled on your account. In addition, if you are looking to protect your files, you can take a look at our Content Protection services, which will provide on-the-fly AES 128 or PlayReady DRM encryption to your assets. You can integrate that with JWT tokens and Active Directory to authenticate/auth your users before they are able to decrypt the video on the client side.
I'm not too familiar with Azure Media Services but after looking at this guide http://azure.microsoft.com/en-us/documentation/articles/media-services-rest-get-started/ it appears to me that you can create an asset on Azure Media Services and link it to a blob. This means you'll only have one blob container.
AMS provides Rest API for all media processing capabilities including uploading, encoding, publishing. There is a sample project (postman collection) in GitHub to play around. This sample project is also accompanied by a well-written article. Please find the links below.
https://github.com/Azure-Samples/media-services-v3-rest-postman
https://learn.microsoft.com/en-us/azure/media-services/latest/stream-files-tutorial-with-rest
Hope this will help

Access to a specific file location (c:/folder/file) in an Azure website

A company provides me a .dll with many files.
The dll access to files using this kind of path "C:/folder/file.config".
I'm working on IIS 8 over a dedicated server BUT I would like to migrate the project on Windows Azure.
I know that Windows Azure provides Virtual Machines, But I wouldn't use it just for this need.
In my dream, I would like to use a web site linked to an Azure Storage and the dll which is located on the web site could access to its "C:/folder/file.config".
Could Windows Azure has a storage which support basic path ? ("C:/folder/file.config")
How could I solved this problem without using a Virtual Machine ?
You need to exercise caution before moving onto this Azure solution for the following reasons:
Azure Web Roles will have read/write access only to the Root Website folder and sub-folders. Not to any other.
Also, even if you manage to get permissions to the expected folder, remember that the instance can be recycled anytime. Meaning you need to repeat your startup task of creating the folder structure and putting the file there, setting up permissions etc.
And finally, the web instances are independent of each other with their own copies of the config file. So you need to take care of any sync issues. (just read-only doesn't pose a problem)
Filesystem access requires a bunch of csdef configurations as well along with elevated tasks.
http://blog.codingoutloud.com/2011/06/12/azure-faq-can-i-write-to-the-file-system-on-windows-azure/
In Azure Websites your website located here :
d:\home\site\wwwroot
which actually mapping for :
C:\DWASFiles\Sites\[your website name]
you can't access any parent folder above that folder in C: partition in Azure Websites

Categories

Resources