feat(docs): add Azure Blob Storage

This commit is contained in:
vitorgrenzel
2021-01-20 17:21:07 -03:00
committed by Tiago A. Simões
parent c777df180a
commit 42494c7e91
4 changed files with 34 additions and 30 deletions
+1 -1
View File
@@ -113,7 +113,7 @@ providers are used.
| Local Filesystem of Backstage app | Yes ✅ |
| Google Cloud Storage (GCS) | Yes ✅ |
| Amazon Web Services (AWS) S3 | Yes ✅ |
| Azure Storage | Yes ✅ |
| Azure Blob Storage | Yes ✅ |
[Reach out to us](#feedback) if you want to request more platforms.
+11 -9
View File
@@ -44,7 +44,7 @@ techdocs:
# or you want to use External storage providers like Google Cloud Storage, AWS S3, etc.
publisher:
# techdocs.publisher.type can be - 'local' or 'googleGcs' or 'awsS3' (azureStorage to be available in future).
# techdocs.publisher.type can be - 'local' or 'googleGcs' or 'awsS3' or 'azureBlobStorage'.
# When set to 'local', techdocs-backend will create a 'static' directory at its root to store generated documentation files.
# When set to 'googleGcs', techdocs-backend will use a Google Cloud Storage Bucket to store generated documentation files.
# When set to 'awsS3', techdocs-backend will use an Amazon Web Service (AWS) S3 bucket to store generated documentation files.
@@ -85,16 +85,18 @@ techdocs:
region:
$env: AWS_REGION
# Required when techdocs.publisher.type is set to 'azureStorage'. Skip otherwise.
# Required when techdocs.publisher.type is set to 'azureBlobStorage'. Skip otherwise.
azureStorage:
# An API key is required to write to a storage container.
azureBlobStorage:
# (Required) Azure Blob Storage Container Name
containerName: 'techdocs-storage'
# (Optional) An API key is required to write to a storage container.
# If not set, environment variables will be used to authenticate.
#https://docs.microsoft.com/en-us/azure/storage/common/storage-auth?toc=/azure/storage/blobs/toc.json
credentials:
account:
$env: TECHDOCS_AZURE_STORAGE_ACCOUNT
$env: TECHDOCS_AZURE_BLOB_STORAGE_ACCOUNT
accountKey:
$env: TECHDOCS_AZURE_STORAGE_ACCOUNT_KEY
# Azure Storage Container Name
containerName: 'techdocs-storage'
$env: TECHDOCS_AZURE_BLOB_STORAGE_ACCOUNT_KEY
```
+21 -19
View File
@@ -196,20 +196,20 @@ the static generated documentation files. When you start the backend of the app,
you should be able to see
`techdocs info Successfully connected to the AWS S3 bucket` in the logs.
## Configuring Azure Storage Container with TechDocs
## Configuring Azure Blob Storage Container with TechDocs
Follow the
[official Azure Storage documentation](https://docs.microsoft.com/pt-br/javascript/api/@azure/storage-blob/?view=azure-node-latest)
for the latest instructions on the following steps involving Azure Storage.
[official Azure Blob Storage documentation](https://docs.microsoft.com/en-us/azure/storage/common/storage-auth?toc=/azure/storage/blobs/toc.json)
for the latest instructions on the following steps involving Azure Blob Storage.
**1. Set `techdocs.publisher.type` config in your `app-config.yaml`**
Set `techdocs.publisher.type` to `'azureStorage'`.
Set `techdocs.publisher.type` to `'azureBlobStorage'`.
```yaml
techdocs:
publisher:
type: 'azureStorage'
type: 'azureBlobStorage'
```
**2. Service account credentials**
@@ -220,14 +220,14 @@ and get your Storage account name and Primary Key.
```yaml
techdocs:
publisher:
type: 'azureStorage'
azureStorage:
type: 'azureBlobStorage'
azureBlobStorage:
credentials:
account: 'account'
accountKey: 'accountKey'
```
**3. Azure Storage Container**
**3. Azure Blob Storage Container**
Create a dedicated container for TechDocs sites. techdocs-backend will publish
documentation to this container. TechDocs will fetch files from here to serve
@@ -236,23 +236,25 @@ documentation in Backstage.
To create a new container, access "Blob Service > Containers > New Container".
Set the name of the container to
`techdocs.publisher.azureStorage.containerName`.
`techdocs.publisher.azureBlobStorage.containerName`.
```yaml
techdocs:
publisher:
type: 'azureStorage'
azureStorage:
credentials:
account: 'account'
accountKey: 'accountKey'
type: 'azureBlobStorage'
azureBlobStorage:
containerName: 'name-of-techdocs-storage-container'
credentials:
account:
$env: TECHDOCS_AZURE_BLOB_STORAGE_ACCOUNT
accountKey:
$env: TECHDOCS_AZURE_BLOB_STORAGE_ACCOUNT_KEY
```
**4. That's it!**
Your Backstage app is now ready to use Azure Storage for TechDocs, to store and
read the static generated documentation files. When you start the backend of the
app, you should be able to see
`techdocs info Successfully connected to the Azure Storage container` in the
logs.
Your Backstage app is now ready to use Azure Blob Storage for TechDocs, to store
and read the static generated documentation files. When you start the backend of
the app, you should be able to see
`techdocs info Successfully connected to the Azure Blob Storage container` in
the logs.