Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions scripts.v2/utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -153,6 +153,11 @@ async function downloadBlobs(blobStorageUrl, snapshotMediaFolder) {
}

async function uploadBlobs(blobStorageUrl, localMediaFolder) {
if (!fs.existsSync(localMediaFolder)) {
console.info("No media files found in the snapshot folder. Skipping media upload...");
return;
}

try {
const blobServiceClient = new BlobServiceClient(blobStorageUrl.replace(`/${blobStorageContainer}`, ""));
const containerClient = blobServiceClient.getContainerClient(blobStorageContainer);
Expand Down
8 changes: 7 additions & 1 deletion scripts.v3/utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -259,8 +259,14 @@ class ImporterExporter {
* Uploads media files to storage of specified API Management service.
*/
async uploadBlobs() {
const snapshotMediaFolder = `${this.snapshotFolder}/media`;

if (!fs.existsSync(snapshotMediaFolder)) {
console.info("No media files found in the snapshot folder. Skipping media upload...");
return;
}

try {
const snapshotMediaFolder = `${this.snapshotFolder}/media`;
const blobStorageUrl = await this.getStorageSasUrl();
const blobServiceClient = new BlobServiceClient(blobStorageUrl.replace(`/${blobStorageContainer}`, ""));
const containerClient = blobServiceClient.getContainerClient(blobStorageContainer);
Expand Down
2 changes: 1 addition & 1 deletion templates/default.json

Large diffs are not rendered by default.