gulp-deploy-azure-cdn
gulp-deploy-azure-cdn copied to clipboard
The specified container does not exist.
Hi,
I'm testing this module. I've created a new Azure Storage account and I copied the name and the key and I have this configuration:
`var deployCdn = require('gulp-deploy-azure-cdn'); var gulp = require('gulp'); var gutil = require('gulp-util');
gulp.task('upload-app-to-azure', function () { return gulp.src(['.js', '.json'], { base: 'node_modules/deploy-azure-cdn' // optional, the base directory in which the file is located. The relative path of file to this directory is used as the destination path }).pipe(deployCdn({ containerName: 'cdngis', // container name in blob serviceOptions: ['MY_ACCOUNT_NAME', 'MY_ACCOUNT_KEY'], // custom arguments to azure.createBlobService folder: '', // path within container zip: true, // gzip files if they become smaller after zipping, content-encoding header will change if file is zipped deleteExistingBlobs: false, // true means recursively deleting anything under folder concurrentUploadThreads: 10, // number of concurrent uploads, choose best for your network condition metadata: { cacheControl: 'public, max-age=31530000', // cache in browser cacheControlHeader: 'public, max-age=31530000' // cache in azure CDN. As this data does not change, we set it to 1 year }, testRun: false // test run - means no blobs will be actually deleted or uploaded, see log messages for details })).on('error', gutil.log); });`
When I try to upload my files I get the error: "The specified container does not exist." but It seems the code creates it for me, but still doesn't work.
C:\Users\gisela\source\repos\WebApplicationGulp\WebApplicationGulp> cmd.exe /c gulp -b "C:\Users\gisela\source\repos\WebApplicationGulp\WebApplicationGulp" --color --gulpfile "C:\Users\gisela\source\repos\WebApplicationGulp\WebApplicationGulp\Gulpfile.js" upload-app-to-azure
[21:14:02] Using gulpfile ~\source\repos\WebApplicationGulp\WebApplicationGulp\Gulpfile.js
[21:14:02] Starting 'upload-app-to-azure'...
[21:14:02] Uploading ....\bundleconfig.json encoding gzip
[21:14:02] Uploading ....\appsettings.Development.json encoding gzip
[21:14:02] Uploading ....\appsettings.json encoding gzip
[21:14:02] Uploading ....\gulpfile.js encoding gzip
[21:14:02] Uploading ....\bower.json encoding gzip
[21:14:02] Uploading ....\package.json encoding gzip
[21:14:02] { [Error: The specified container does not exist.
RequestId:379347d8-001e-007e-0b60-5a821d000000
Time:2017-11-10T20:14:02.6969054Z]
code: 'ContainerNotFound',
statusCode: 404,
requestId: '379347d8-001e-007e-0b60-5a821d000000',
name: 'Error',
message: 'The specified container does not exist.\nRequestId:379347d8-001e-007e-0b60-5a821d000000\nTime:2017-11-10T20:14:02.6969054Z',
stack: 'Error: The specified container does not exist.\nRequestId:379347d8-001e-007e-0b60-5a821d000000\nTime:2017-11-10T20:14:02.6969054Z\n at Function.StorageServiceClient._normalizeError (C:\Users\gisela\source\repos\WebApplicationGulp\WebApplicationGulp\node_modules\azure-storage\lib\common\services\storageserviceclient.js:868:23)\n at BlobService.StorageServiceClient._processResponse (C:\Users\gisela\source\repos\WebApplicationGulp\WebApplicationGulp\node_modules\azure-storage\lib\common\services\storageserviceclient.js:570:50)\n at Request.processResponseCallback [as _callback] (C:\Users\gisela\source\repos\WebApplicationGulp\WebApplicationGulp\node_modules\azure-storage\lib\common\services\storageserviceclient.js:274:37)\n at Request.self.callback (C:\Users\gisela\source\repos\WebApplicationGulp\WebApplicationGulp\node_modules\request\request.js:129:22)\n at emitTwo (events.js:87:13)\n at Request.emit (events.js:172:7)\n at Request.
I tried to create the container manually but I get the same error.
Any ideas? thanks!
I don't have the same error when I use deploy-azure-cdn directly. It works fine. It is just with the gulp plugin.
thanks!
I suppose something does not get passed from the gulp plugin into deploy-azure-cdn. I would recommend adding console.log statements and checking if this is true. This project is just a thin wrapper of deploy-azure-cdn.
Sorry, can't help you more, I haven't been using Azure for a while