You can configure ImageKit.io to fetch images from your Azure blob storage. This allows you to start leveraging ImageKit.io real-time image resizing, optimization, and fast CDN delivery for thousands or millions of existing images within minutes.
Note: We do not start copying images from your storage as soon as you add it. Instead, we will fetch the particular image when you request it through ImageKit.io URL-endpoint. Learn more to understand how this works. The images accessed from this origin will not appear in your Media library.
The following tutorial will help you create a Shared Access Signature (SAS) token that will allow ImageKit to access the images in your Azure storage container. This allows you to restrict ImageKit to only reading objects from your container. i.e. ImageKit will not be able to create/delete/update objects in your container.
In case you find the following instructions invalid/outdated, you can refer to Azure's official, albeit more verbose instructions on this page.
If you have granted anonymous public access to your Azure container, you can choose to configure your container as a web server. Provide your container URL as the web server URL in the web server configuration steps. See how to configure a web server.
However, note that it is advisable to configure your origin using secure integration as explained below.
Step 1: Generate a Shared Access Signature (SAS) Token
Step 2: Configure your Azure storage container with your ImageKit account
We have now created a SAS token for ImageKit and granted it the Read permission for your container, which means that ImageKit can do nothing more than just read objects in your container. At this point, you should have the following values with you:
Azure storage account name: The name of your storage account.
Azure storage container name: Name of the container that you want to integrate.
SAS Token: As generated in step 1.
Now, go to the External Storage section in the dashboard, click on the Add New Origin button, select Azure Storage in the Origin Type field, and enter the corresponding values, and click submit.
Step 3: Access the image through ImageKit.io URL-endpoint
When you add your first origin in the dashboard, the origin is by default made accessible through the default URL-endpoint of your ImageKit.io account. For subsequent origins, you can either create a separate URL-endpoint or edit the existing URL-endpoint (including default) and make this newly added origin accessible by editing the origin preference list.
So when you request https://ik.imagekit.io/your_imagekit_id/rest-of-the-path.jpg,
ImageKit.io uses the SAS token provided by you to fetch the original image from the path rest-of-the-path.jpg in the Azure container using the official Azure SDK.