Ejemplo n.º 1
0
        public static async Task DeleteDeploymentBlob(string deploymentId)
        {
            var deploymentBlob = await BlobProvider
                                 .GetDeploymentBlob(deploymentId : deploymentId)
                                 .ConfigureAwait(continueOnCapturedContext: false);

            await deploymentBlob
            .DeleteIfExistsAsync()
            .ConfigureAwait(continueOnCapturedContext: false);
        }
Ejemplo n.º 2
0
        public static async Task <string> CreateDeploymentBlob(string deploymentId, string zipFile)
        {
            var deploymentBlob = await BlobProvider
                                 .GetDeploymentBlob(deploymentId : deploymentId)
                                 .ConfigureAwait(continueOnCapturedContext: false);

            var buffer = Convert.FromBase64String(zipFile);

            await deploymentBlob
            .UploadFromByteArrayAsync(
                buffer : buffer,
                index : 0,
                count : buffer.Length)
            .ConfigureAwait(continueOnCapturedContext: false);

            var sasToken = deploymentBlob.GetSharedAccessSignature(policy: new SharedAccessBlobPolicy
            {
                Permissions            = SharedAccessBlobPermissions.Read,
                SharedAccessStartTime  = DateTimeOffset.MinValue,
                SharedAccessExpiryTime = DateTimeOffset.MaxValue
            });

            return(deploymentBlob.Uri + sasToken);
        }