feat(techdocs-common): add Azure Storage
This commit is contained in:
committed by
Tiago A. Simões
parent
64e35f7d30
commit
c777df180a
@@ -108,12 +108,12 @@ providers are used.
|
||||
| GitLab | Yes ✅ |
|
||||
| GitLab Enterprise | Yes ✅ |
|
||||
|
||||
| File Storage Provider | Support Status |
|
||||
| --------------------------------- | ----------------------------------------------------------------- |
|
||||
| Local Filesystem of Backstage app | Yes ✅ |
|
||||
| Google Cloud Storage (GCS) | Yes ✅ |
|
||||
| Amazon Web Services (AWS) S3 | Yes ✅ |
|
||||
| Azure Storage | No ❌ [#3938](https://github.com/backstage/backstage/issues/3938) |
|
||||
| File Storage Provider | Support Status |
|
||||
| --------------------------------- | -------------- |
|
||||
| Local Filesystem of Backstage app | Yes ✅ |
|
||||
| Google Cloud Storage (GCS) | Yes ✅ |
|
||||
| Amazon Web Services (AWS) S3 | Yes ✅ |
|
||||
| Azure Storage | Yes ✅ |
|
||||
|
||||
[Reach out to us](#feedback) if you want to request more platforms.
|
||||
|
||||
|
||||
@@ -84,4 +84,17 @@ techdocs:
|
||||
# https://docs.aws.amazon.com/sdk-for-javascript/v3/developer-guide/setting-region.html
|
||||
region:
|
||||
$env: AWS_REGION
|
||||
|
||||
# Required when techdocs.publisher.type is set to 'azureStorage'. Skip otherwise.
|
||||
|
||||
azureStorage:
|
||||
# An API key is required to write to a storage container.
|
||||
credentials:
|
||||
account:
|
||||
$env: TECHDOCS_AZURE_STORAGE_ACCOUNT
|
||||
accountKey:
|
||||
$env: TECHDOCS_AZURE_STORAGE_ACCOUNT_KEY
|
||||
|
||||
# Azure Storage Container Name
|
||||
containerName: 'techdocs-storage'
|
||||
```
|
||||
|
||||
@@ -195,3 +195,64 @@ Your Backstage app is now ready to use AWS S3 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 AWS S3 bucket` in the logs.
|
||||
|
||||
## Configuring Azure 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.
|
||||
|
||||
**1. Set `techdocs.publisher.type` config in your `app-config.yaml`**
|
||||
|
||||
Set `techdocs.publisher.type` to `'azureStorage'`.
|
||||
|
||||
```yaml
|
||||
techdocs:
|
||||
publisher:
|
||||
type: 'azureStorage'
|
||||
```
|
||||
|
||||
**2. Service account credentials**
|
||||
|
||||
To get credentials, access the Azure Portal and go to "Settings > Access Keys",
|
||||
and get your Storage account name and Primary Key.
|
||||
|
||||
```yaml
|
||||
techdocs:
|
||||
publisher:
|
||||
type: 'azureStorage'
|
||||
azureStorage:
|
||||
credentials:
|
||||
account: 'account'
|
||||
accountKey: 'accountKey'
|
||||
```
|
||||
|
||||
**3. Azure 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
|
||||
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`.
|
||||
|
||||
```yaml
|
||||
techdocs:
|
||||
publisher:
|
||||
type: 'azureStorage'
|
||||
azureStorage:
|
||||
credentials:
|
||||
account: 'account'
|
||||
accountKey: 'accountKey'
|
||||
containerName: 'name-of-techdocs-storage-container'
|
||||
```
|
||||
|
||||
**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.
|
||||
|
||||
Reference in New Issue
Block a user