You can replace any automated job with Azure CLI directly with:
# Delete the previous deployed artifacts
> az storage azcopy blob delete -c "\$web" --recursive
# Deploy the new ones
> az storage azcopy blob upload -c "\$web" -s "<artifact-dir>/*" --recursive
Utility CLI to deploy webapps to Azure Blob storage.
This CLI use azure-storage
under the hood so an AZURE_STORAGE_CONNECTION_STRING
env var is required to
grant access.
Install the CLI globally with:
# global install with npm
npm i -g @mondora/azure-cdn-cli
# or yarn
yarn add global @mondora/azure-cdn-cli
# CLI usage
azure-cdn-cli deploy --static --erase
Install @mondora/azure-cdn-cli
as a dev dependency:
yarn add --dev @mondora/azure-cdn-cli
Update your package.json
:
{
"scripts": {
"deploy": "azure-cdn-cli deploy --static --erase"
}
}
The only command provided: deploy your app or directory to Azure Blob storage.
App directory to deploy.
Defaults to: "./build".
Azure Blob container name. See here for further information.
Defaults to: "./$root".
Mimics directory hierarchy as in a traditional file system.
Schema: AzureStorageAccountName/Container/Folder/**
.
Container creation options. See here for further documentation.
Metadata to be attached to blobs.
Number of parallel active network requests.
Delete recursively the content of the Azure Blob storage.
Use zip during file upload.
Flag for dry run.
Flag used as a shorthand for the following azure-storage
configs.
Should be a sane default to deploy SPAs.
Container name | Public access | Cache control |
---|---|---|
$web | blob | "private, no-cache, no-store, must-revalidate" |