Gatsby Cloud integrates with Azure Storage, which is a storage service that can be used for hosting a Gatsby site so you can build and deploy seamlessly.
This guide assumes you already:
- have an Azure Storage account
- have a Gatsby Cloud site created
You can use either of the following site creation options if you don't have one already:
Configuring Azure Storage Settings
You’ll first need to create an Azure Storage Account. After you have a Storage Account created, navigate to its “Settings” and then “Access keys”. Here you’ll find your “Storage account name” and “Connection string”, which you’ll need to setup the hosting integration with Gatsby Cloud. Select the connection string from the “key1” section.
You’ll also need to setup your Azure Storage Account to host a static website. Refer to the Azure docs on using Azure Storage for static website hosting for more information on configuring specific settings for your Azure Storage Account in the Azure Portal.
Note that this will create the a
$webcontainer in your Azure Storage Account. All files deployed from Gatsby Cloud will be uploaded to this container.
Setting Up the Hosting Integration
Once your site is available inside Gatsby Cloud you can “view details” and navigate to the “Site Settings” tab.
Inside Site Settings there is an “Integrations” link. Select this menu item and scroll down to the section titled “Hosting Integrations”.
This is where you’ll see the Azure logo. Click the “Connect” button to the right of that logo and you’ll be prompted to add some information:
- Connection String
- Storage Account Name
Enter the values that you recorded above and once you hit save, builds will automatically be deployed to Azure Storage.
And that’s it! Your site is now set up to build and deploy. Gatsby Cloud will handle everything for you.
Note that you can only have one hosting integration. If you choose to configure another provider, that will override your existing Azure Storage integration.
Can I put a CDN in front of Azure Storage?
Yes, you can configure Azure CDN to serve the files from Azure Storage, or connect your storage account to another preferred CDN.