Create Azure Storage account
Now that you have a static website, let's deploy it to the cloud using Azure Storage. Azure Storage is simple file store/CDN with a built-in web server which makes it great for hosting static sites extremely fast.
In this section, we will setup our Azure Storage account and blob container.
Login to Azure Portal
Select Storage accounts from the left side menu bar.
Note: If you don't see Storage accounts, select All services from the top of the menu, find it in the full list, and star it to dock it in your menu bar.
Click either + Add or Create Storage Accounts to create a new account.
Fill in a Name for your storage account and the Resource group.
Note the storage account name must be globally unique, so just add some random numbers to the end if the name you want is taken. Everything else can be left at the default value.
When you're ready click Create and wait for the account to get created.
When account creation is complete, you will get a notification (the bell icon in the top menu bar).
Click Go to resource.
Click Blobs in the Services section
Click the "+ Container", name your container, and set the access level to Blob.
If everything was creating successfully, you should see your container and storage account information in the Blob service blade. Keep this window open, you'll need this information later.
Setting relative paths
create-react-app assumes that your app will live in the server's root directory, however our app will be in a container which adds an extra folder level to every path.
Luckily, there is an easy fix for this. Add the following to
package.json with your own values in place of
This setting will make sure that all URLs generated during
npm build contain the correct relative path that we need to serve the app. You can read more about relative paths in
create-react-app on their GitHub README.