I am using Azure CDN, where i have published all my images,css,js files.Now I would like to get all the assets from CDN instead of DAM.
Could you please suggest me?
Thanks in advance.
See the Creating a custom content app trail in the documentation - it shows how to integrate images from Flickr, you can customize it to integrate Azure.
Actually I would suggest to just add extra step to your publishing process that, when publishing resources from dam will also publish them to azure CDN using their API. Similarly when unpublishing, you remove resources from there too.
You should do that as a first step in publishing, and upon receiving identifier for the resource from CDN, you should store that in assets metadata and only then pass it over to the next publishing step to have dam resource published to your Magnolia public instance.
Then on the public instance, you would need to replace LinkTransformers (and also LinkTransformerManager) and/or maybe just Asset implementation (if you use that exclusively for assets) with a custom implementation that when requesting link to dam asset will use CDN identifier in the assets metadata to construct correct link pointing to the CDN rather than back to Magnolia.