Giter Club home page Giter Club logo

azure-storage-plugin's Introduction

Azure Storage Plugin

Important: This plug-in is maintained by the Jenkins community and won’t be supported by Microsoft as of February 29, 2024.

A plugin for uploading build artifacts to, or downloading build dependencies from, Microsoft Azure Blob storage or Azure Files. (For a more detailed tutorial see http://go.microsoft.com/fwlink/?LinkId=280058)

Installing

This plugin is available in the Jenkins plugin manager. To install in Jenkins, go to Manage Jenkins | Manage Plugins | Available | Windows Azure Storage Plugin | Install. Then restart Jenkins to complete the installation.

Configuration

At least one Azure storage account must be configured in the global configuration before the plugin can be used in build steps. To add a storage account, go to Manage Jenkins | Configure System | Microsoft Azure Storage Account Configuration and fill out the needed information.

Post-build actions

Upload artifacts to Azure

For a more detailed tutorial see: http://go.microsoft.com/fwlink/?LinkId=280058.

The Upload artifacts to Azure post-build step uploads a build artifact generated by your build to Azure Blobs or Azure Files.

  1. Select the storage account name to use from the dropdown control
  2. Enter a name for the container or the file share. A new container or file share will be created if it does not exist. Environment variables can also be referenced. For example: ${JOB_NAME}
  3. Enter the list of artifacts to upload, following the Ant glob syntax. You may create mappings between groups of artifacts and the virtual directory structure for them to be put under in the blob storage using the "::" notation.
  4. Optionally, specify the common virtual path under the container or file share that the artifacts will be placed under. This string (followed by a slash '/' character) will follow the container name or the file share name (after a slash) in the URL for each artifact. Any combination of characters can be used, but reserved URL characters must be properly escaped. Environment variables can also be referenced. For example: "${BUILD_ID}/${BUILD_NUMBER}/"

Build actions

Download from Azure Blob storage

The Download from Azure blob storage build step downloads blob contents from Azure blob or Azure Files.

  1. Select the storage account name to use from the dropdown control
  2. Select 'Download From Container', 'Download From Azure Files' or 'Download artifact from build'.
  • 'Download From Container' >> Enter the name of the container to download from. Environment variables can also be referenced. For example: ${JOB_NAME}
  • 'Download From Files' >> Enter the name of the file share to download from. Environment variables can also be referenced. For example: ${JOB_NAME}
  • 'Download artifact from build' >> Enter Project Name and select the build from the drop-down for 'Build to download' . For example: 'Latest successful build'.
  1. Enter the name of the blob or file to download. You may also use the wild card "" at the end to select multiple blob or file downloads sharing the same prefix, for example: project
  2. Optionally, enter the target download path. If not specified, the files will be downloaded into the job's workspace. Environment variables can also be referenced, for example: ${JOB_NAME}

For a tutorial, see https://go.microsoft.com/fwlink/?LinkId=280058.

azure-storage-plugin's People

Contributors

allxiao avatar anderssonjohan avatar archangelsdy avatar arroyc avatar basil avatar chenkennt avatar clguiman avatar dependabot[bot] avatar directhex avatar etherealiska avatar gavinfish avatar jetersen avatar johann01 avatar juniwang avatar lgdoor avatar lucajung avatar markewaite avatar minreaux avatar mmitche avatar notmyfault avatar rahulsom avatar renovate[bot] avatar roguishmountain avatar sivapalan avatar snallami avatar timja avatar tyuanhang avatar vadakr avatar vincentliu028 avatar xuzhang3 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

azure-storage-plugin's Issues

blob endpoint url is changed after build

i am using a special windows azure storage endpoint. i set the configuration like below:

  • storage account name: portalvhdsxtpyty6dr213q
  • storage account key: XXXXX
  • blob service endpoint url: blob.core.chinacloudapi.cn
    then i click "validate storage credentials", it returns "Validation successful".

And then i add this plugin into post build action, the first build works very well. However the second build starts fail and reports: Blob end point url --->http://portalvhdsxtpyty6dr213q.portalvhdsxtpyty6dr213q.blob.core.chinacloudapi.cn/<----
you can see something wrong to add multiple "account name" to the final blob url. It seems this plugin generating a full blob url and saving it in every build without checking if the url was a full path.

Not able to upload to $root container

Hi,

In your code you run validation that container name contain only letters, numbers, and the dash character.
https://github.com/jenkinsci/windows-azure-storage-plugin/blob/4c218bcce47a3cc3b547bb099707e8312d9b56b7/src/main/java/com/microsoftopentechnologies/windowsazurestorage/helper/Utils.java

This validation prevents from working with $root container
https://docs.microsoft.com/en-us/rest/api/storageservices/working-with-the-root-container

Can you create a fix that will allow using $root for container name?

Thanks.

Blob Metadata

Is it possible to implement blob metadata to the uploaded file?
I saw that option in azure cross-platform command line client, but it will be great if such option is available in this Jenkins plugin:

azure storage blob upload <arguments ... > -m "key1=value1;key2=value2; ..."

Unable to hide/ clear logs when uploading and downloading artifacts to and from Azure

I think it should be great if we have an option to hide the logs when downloading and uploading from and to Azure, as it will keep the build console clean and easy to see what happen during the build rather than being annoyed by heaps of Azure logs if there are a lot of artifacts required for the build which makes it really difficult to diagnose the issue at first.

Plugin fails with null reference exception if filestorage is not defined

After upgrading to 3.6, we've been seeing the following null reference exception. It looks like the code is trying to always tokenize the fileShareName even if it is not set which results in a null reference exception.

We've downgraded to 3.5 to avoid the issue

Archiving artifacts
ERROR: Build step failed with exception
java.lang.NullPointerException
	at com.microsoftopentechnologies.windowsazurestorage.WAStoragePublisher.replaceMacro(WAStoragePublisher.java:373)
	at com.microsoftopentechnologies.windowsazurestorage.WAStoragePublisher.perform(WAStoragePublisher.java:395)
	at hudson.tasks.BuildStepCompatibilityLayer.perform(BuildStepCompatibilityLayer.java:81)
	at hudson.tasks.BuildStepMonitor$2.perform(BuildStepMonitor.java:32)
	at hudson.model.AbstractBuild$AbstractBuildExecution.perform(AbstractBuild.java:735)
	at hudson.model.AbstractBuild$AbstractBuildExecution.performAllBuildSteps(AbstractBuild.java:676)
	at hudson.model.Build$BuildExecution.post2(Build.java:186)
	at hudson.model.AbstractBuild$AbstractBuildExecution.post(AbstractBuild.java:621)
	at hudson.model.Run.execute(Run.java:1760)
	at hudson.model.FreeStyleBuild.run(FreeStyleBuild.java:43)
	at hudson.model.ResourceController.execute(ResourceController.java:97)
	at hudson.model.Executor.run(Executor.java:405)
Build step 'Upload artifacts to Microsoft Azure Storage' marked build as failure

Download from azure archive missing

The download from azure archive build step option is not available with the most recent version. I believe it has something to do with this error that appears in the jenkins log.

Failed to instantiate Key[type=com.microsoftopentechnologies.windowsazurestorage.AzureStorageBuilder$AzureStorageBuilderDesc, annotation=[none]]; skipping this component
com.google.inject.ProvisionException: Unable to provision, see the following errors:

1) Error injecting constructor, java.lang.NoClassDefFoundError: hudson/plugins/copyartifact/BuildSelector
at com.microsoftopentechnologies.windowsazurestorage.AzureStorageBuilder$AzureStorageBuilderDesc.<init>(AzureStorageBuilder.java:295)
1 error
    at com.google.inject.internal.ProviderToInternalFactoryAdapter.get(ProviderToInternalFactoryAdapter.java:52)
    at com.google.inject.internal.SingletonScope$1.get(SingletonScope.java:145)
    at hudson.ExtensionFinder$GuiceFinder$FaultTolerantScope$1.get(ExtensionFinder.java:424)
    at com.google.inject.internal.InternalFactoryToProviderAdapter.get(InternalFactoryToProviderAdapter.java:41)
    at com.google.inject.internal.InjectorImpl$2$1.call(InjectorImpl.java:1016)
    at com.google.inject.internal.InjectorImpl.callInContext(InjectorImpl.java:1092)
    at com.google.inject.internal.InjectorImpl$2.get(InjectorImpl.java:1012)
    at hudson.ExtensionFinder$GuiceFinder._find(ExtensionFinder.java:386)
    at hudson.ExtensionFinder$GuiceFinder.find(ExtensionFinder.java:377)
    at hudson.ClassicPluginStrategy.findComponents(ClassicPluginStrategy.java:472)
    at hudson.ExtensionList.load(ExtensionList.java:365)
    at hudson.ExtensionList.ensureLoaded(ExtensionList.java:303)
    at hudson.ExtensionList.getComponents(ExtensionList.java:168)
    at hudson.DescriptorExtensionList.load(DescriptorExtensionList.java:191)
    at hudson.ExtensionList.ensureLoaded(ExtensionList.java:303)
    at hudson.ExtensionList.iterator(ExtensionList.java:157)
    at org.jenkinsci.plugins.xunit.AliasInitializer.addAliases(AliasInitializer.java:47)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
    at java.lang.reflect.Method.invoke(Unknown Source)
    at hudson.init.TaskMethodFinder.invoke(TaskMethodFinder.java:104)
    at hudson.init.TaskMethodFinder$TaskImpl.run(TaskMethodFinder.java:175)
    at org.jvnet.hudson.reactor.Reactor.runTask(Reactor.java:282)
    at jenkins.model.Jenkins$7.runTask(Jenkins.java:1066)
    at org.jvnet.hudson.reactor.Reactor$2.run(Reactor.java:210)
    at org.jvnet.hudson.reactor.Reactor$Node.run(Reactor.java:117)
    at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
    at java.lang.Thread.run(Unknown Source)
Caused by: java.lang.NoClassDefFoundError: hudson/plugins/copyartifact/BuildSelector
    at java.lang.Class.getDeclaredMethods0(Native Method)
    at java.lang.Class.privateGetDeclaredMethods(Unknown Source)
    at java.lang.Class.privateGetMethodRecursive(Unknown Source)
    at java.lang.Class.getMethod0(Unknown Source)
    at java.lang.Class.getMethod(Unknown Source)
    at hudson.model.Descriptor.<init>(Descriptor.java:288)
    at hudson.tasks.BuildStepDescriptor.<init>(BuildStepDescriptor.java:56)
    at com.microsoftopentechnologies.windowsazurestorage.AzureStorageBuilder$AzureStorageBuilderDesc.<init>(AzureStorageBuilder.java:295)
    at com.microsoftopentechnologies.windowsazurestorage.AzureStorageBuilder$AzureStorageBuilderDesc$$FastClassByGuice$$54a06dd3.newInstance(<generated>)
    at com.google.inject.internal.cglib.reflect.$FastConstructor.newInstance(FastConstructor.java:40)
    at com.google.inject.internal.DefaultConstructionProxyFactory$1.newInstance(DefaultConstructionProxyFactory.java:61)
    at com.google.inject.internal.ConstructorInjector.provision(ConstructorInjector.java:105)
    at com.google.inject.internal.ConstructorInjector.construct(ConstructorInjector.java:85)
    at com.google.inject.internal.ConstructorBindingImpl$Factory.get(ConstructorBindingImpl.java:267)
    at com.google.inject.internal.ProviderToInternalFactoryAdapter$1.call(ProviderToInternalFactoryAdapter.java:46)
    at com.google.inject.internal.InjectorImpl.callInContext(InjectorImpl.java:1103)
    at com.google.inject.internal.ProviderToInternalFactoryAdapter.get(ProviderToInternalFactoryAdapter.java:40)
    ... 29 more
Caused by: java.lang.ClassNotFoundException: hudson.plugins.copyartifact.BuildSelector
    at jenkins.util.AntClassLoader.findClassInComponents(AntClassLoader.java:1373)
    at jenkins.util.AntClassLoader.findClass(AntClassLoader.java:1326)
    at jenkins.util.AntClassLoader.loadClass(AntClassLoader.java:1079)
    at java.lang.ClassLoader.loadClass(Unknown Source)

Cannot connect to Azure Storage

I'm trying this plugin for the first time but I'm having some difficulties getting it to connect to Azure Storage. Ultimately I want to upload artifacts to Azure File Storage. I have created a temporary storage resource for testing. I can connect to it using the Azure Storage Explorer and CloudBerry Explorer however no matter what settings I use, I cannot get the plugin to connect. I've tried different blob endpoints but without luck. From what I've gathered it should be left as default or blank for my purposes. Please see the attached screenshot. Can someone spot anything wrong or is there a way for me to debug the connection issue?

image

Content type detection with js files sometimes uses "text/html"

There is a known bug in Tika regarding some js files content type detection:

The Mimetypes detector will return text/html as the mimetype for any javascript file that contains the string "<html" in it. I believe this is due to the rule in the tika-mimetypes.xml file.

This was not fixed in Tika for a few years now and is causing some of our JS files to upload with HTML content type (for example jQuery).

When I upload the same file directly to the blob storage in the Azure portal, I don't need to select a content type and it get's a correct content type (text/javascript).
We tried removing the checkbox for "Auto detect content type" and that made all file upload with "application/octet-stream" and not have their content type set by Azure.
We can't set a static content type as we upload many files of many types in a single build.

We have 4 optional solutions:

  1. Replace Tika with a different library that can identify JS files correctly.
  2. Add a workaround like here and make sure that js file, in particular, get the correct content type.
  3. Allow Azure to select the correct content type when no content type was set.
  4. Allow us to provide a "Content-type override dictionary" that will resolve an extension to a content type without using Tika for those types. we will send something like:
    { "js":"application/javascript" }

"Download from Microsoft Azure Blob Storage" function not available

Hi There,
I installed jenkin 2.32.2 with azure-storage-plugin 0.3.2.
There is no option "Download from Microsoft Azure Blob Storage" in build step, can you please help to take a look?

Here is the error in Jenkins:
Feb 09, 2017 7:48:48 PM WARNING hudson.ExtensionFinder$GuiceFinder$FaultTolerantScope$1 error

Failed to instantiate Key[type=com.microsoftopentechnologies.windowsazurestorage.AzureStorageBuilder$AzureStorageBuilderDesc, annotation=[none]]; skipping this component
com.google.inject.ProvisionException: Unable to provision, see the following errors:

  1. Error injecting constructor, java.lang.NoClassDefFoundError: hudson/plugins/copyartifact/BuildSelector
    at com.microsoftopentechnologies.windowsazurestorage.AzureStorageBuilder$AzureStorageBuilderDesc.(AzureStorageBuilder.java:295)

1 error
at com.google.inject.internal.ProviderToInternalFactoryAdapter.get(ProviderToInternalFactoryAdapter.java:52)
at com.google.inject.internal.SingletonScope$1.get(SingletonScope.java:145)
at hudson.ExtensionFinder$GuiceFinder$FaultTolerantScope$1.get(ExtensionFinder.java:424)
at com.google.inject.internal.InternalFactoryToProviderAdapter.get(InternalFactoryToProviderAdapter.java:41)
at com.google.inject.internal.InjectorImpl$2$1.call(InjectorImpl.java:1016)
at com.google.inject.internal.InjectorImpl.callInContext(InjectorImpl.java:1092)
at com.google.inject.internal.InjectorImpl$2.get(InjectorImpl.java:1012)
at hudson.ExtensionFinder$GuiceFinder._find(ExtensionFinder.java:386)
at hudson.ExtensionFinder$GuiceFinder.find(ExtensionFinder.java:377)
at hudson.ClassicPluginStrategy.findComponents(ClassicPluginStrategy.java:472)
at hudson.ExtensionList.load(ExtensionList.java:365)
at hudson.ExtensionList.ensureLoaded(ExtensionList.java:303)
at hudson.ExtensionList.getComponents(ExtensionList.java:168)
at hudson.DescriptorExtensionList.load(DescriptorExtensionList.java:191)
at hudson.ExtensionList.ensureLoaded(ExtensionList.java:303)
at hudson.ExtensionList.iterator(ExtensionList.java:157)
at jenkins.branch.CustomOrganizationFolderDescriptor.doAddSpecificDescriptors(CustomOrganizationFolderDescriptor.java:166)
at jenkins.branch.CustomOrganizationFolderDescriptor.addSpecificDescriptors(CustomOrganizationFolderDescriptor.java:145)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at hudson.init.TaskMethodFinder.invoke(TaskMethodFinder.java:104)
at hudson.init.TaskMethodFinder$TaskImpl.run(TaskMethodFinder.java:175)
at org.jvnet.hudson.reactor.Reactor.runTask(Reactor.java:282)
at jenkins.model.Jenkins$7.runTask(Jenkins.java:1085)
at org.jvnet.hudson.reactor.Reactor$2.run(Reactor.java:210)
at org.jvnet.hudson.reactor.Reactor$Node.run(Reactor.java:117)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
at java.lang.Thread.run(Thread.java:745)
Caused by: java.lang.NoClassDefFoundError: hudson/plugins/copyartifact/BuildSelector
at java.lang.Class.getDeclaredMethods0(Native Method)
at java.lang.Class.privateGetDeclaredMethods(Class.java:2701)
at java.lang.Class.privateGetMethodRecursive(Class.java:3048)
at java.lang.Class.getMethod0(Class.java:3018)
at java.lang.Class.getMethod(Class.java:1784)
at hudson.model.Descriptor.(Descriptor.java:288)
at hudson.tasks.BuildStepDescriptor.(BuildStepDescriptor.java:56)
at com.microsoftopentechnologies.windowsazurestorage.AzureStorageBuilder$AzureStorageBuilderDesc.(AzureStorageBuilder.java:295)
at com.microsoftopentechnologies.windowsazurestorage.AzureStorageBuilder$AzureStorageBuilderDesc$$FastClassByGuice$$54a06dd3.newInstance()
at com.google.inject.internal.cglib.reflect.$FastConstructor.newInstance(FastConstructor.java:40)
at com.google.inject.internal.DefaultConstructionProxyFactory$1.newInstance(DefaultConstructionProxyFactory.java:61)
at com.google.inject.internal.ConstructorInjector.provision(ConstructorInjector.java:105)
at com.google.inject.internal.ConstructorInjector.construct(ConstructorInjector.java:85)
at com.google.inject.internal.ConstructorBindingImpl$Factory.get(ConstructorBindingImpl.java:267)
at com.google.inject.internal.ProviderToInternalFactoryAdapter$1.call(ProviderToInternalFactoryAdapter.java:46)
at com.google.inject.internal.InjectorImpl.callInContext(InjectorImpl.java:1103)
at com.google.inject.internal.ProviderToInternalFactoryAdapter.get(ProviderToInternalFactoryAdapter.java:40)
... 30 more
Caused by: java.lang.ClassNotFoundException: hudson.plugins.copyartifact.BuildSelector
at jenkins.util.AntClassLoader.findClassInComponents(AntClassLoader.java:1373)
at jenkins.util.AntClassLoader.findClass(AntClassLoader.java:1326)
at jenkins.util.AntClassLoader.loadClass(AntClassLoader.java:1079)
at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
... 47 more

Feb 09, 2017 7:48:49 PM INFO jenkins.InitReactorRunner$1 onAttained

I also found a similar case reported on Jenkins Jira:
https://issues.jenkins-ci.org/browse/JENKINS-41713?jql=project%20%3D%20JENKINS%20AND%20status%20in%20(Open%2C%20%22In%20Progress%22%2C%20Reopened)%20AND%20component%20%3D%20%27windows-azure-storage-plugin%27

[Request] Option to delete blob files after download

I am using blob storage as an intermediate drop location but I do not need files long term stored there. It would be great if the plugin had an option to download files and then delete them from blob storage.

Support cleaning virtual path instead of whole container

Right now it looks like I have to clean the whole container if I want to wipe out the virtual path before uploading.

It would be nice if an option was added to allow for the removal of just everything within the path. That way, if my build removes files, it won't orphan them.

Download From Azure

Hello,

This is more of a feature request than an issue - sorry if this is the wrong place for such a request!

I'm trying to use Jenkins to manage deployments to various environments as well as the building of artefacts. It'd be great to have an additional plugin which would download an artefact from Azure, too!

Thanks,

  • Chris

Jenkins unable to validate storage credentials

Hi, I am unable to get the plugin to validate storage credentials. I think it is because Jenkins is behind the firewall. I have already add in the firewall settings on the jenkins plugin page. How do I get it to work?

Error : Failed to validate storage account details. Please verify storage account name and key. If you are using a private or other Windows Azure cloud service, make sure that the blob endpoint url is correct.

Tabs to spaces

Do you have any objection with me changing tabs to spaces in this project? AFAIK, the general guidance is spaces over tabs.

Add an option to not replicate full container path

When I copy files from their full container path is preserved in my workspace. This means that I have to nest downwards into directories I may not always know the name of in my dependent tasks.

It would be nice if the contents of the targeted directory could just be dumped to the root of the workspace instead of the full path to the directory itself.

Authenticate failure over HTTPS

When the 'secure transfer required' option is set on a storage account, the plugin will not succesfully authenticate. Obviously this forces storage accounts using this plugin to be 'opt-in' for HTTPS. This is an unfortunate limitation and should be rectified ASAP to support security best practices. Also, this condition should be added to the documentation as a 'known issue'.

Plugin version: 0.3.6
Jenkins version: 2.8.5

Upload step errors trying to delete tmp file

The upload task seems to have an issue where it can't delete the tmp archive.zip that is created. It appears to be coming from tempPath.deleteRecursive(); method call at the very end of the upload method in WAStorageClient.java. In my setup, it is not important to cleanup the workspace after the build as the workspace is recreated with every build. Could you provide an optional boolean attribute to the upload task to skip the delete of temp files or alternatively figure out why the file is locked still.

Thanks for the help on the previous issue btw.

		upload(listener, blob, zipPath);
		// Make sure to note the new blob as an archive blob,
		// so that it can be specially marked on the azure storage page.
		archiveBlobs.add(new AzureBlob(blob.getName(), blob.getUri().toString().replace("http://", "https://"), md5hex, sizeInBytes));

		tempPath.deleteRecursive();
	    }

	} catch (Exception e) {
	    throw new WAStorageException(e.getMessage(), e.getCause());
	}
	return filesUploaded;
Uploaded blob with uri https://....blob.core.windows.net/.../archive.zip in 00:00:01.585 (HH:mm:ss.S)
ERROR: MicrosoftAzureStorage - Error occurred while uploading to Azure - ...
com.microsoftopentechnologies.windowsazurestorage.exceptions.WAStorageException: Unable to delete 'C:\...\artifactsArchive1192707576229944372.tmp\archive.zip'. Tried 3 times (of a maximum of 3) waiting 0.1 sec between attempts.
	at com.microsoftopentechnologies.windowsazurestorage.WAStorageClient.upload(WAStorageClient.java:363)
	at com.microsoftopentechnologies.windowsazurestorage.WAStoragePublisher.perform(WAStoragePublisher.java:289)
	at org.jenkinsci.plugins.workflow.steps.CoreStep$Execution.run(CoreStep.java:69)
	at org.jenkinsci.plugins.workflow.steps.CoreStep$Execution.run(CoreStep.java:59)
	at org.jenkinsci.plugins.workflow.steps.AbstractSynchronousNonBlockingStepExecution$1$1.call(AbstractSynchronousNonBlockingStepExecution.java:47)
	at hudson.security.ACL.impersonate(ACL.java:260)
	at org.jenkinsci.plugins.workflow.steps.AbstractSynchronousNonBlockingStepExecution$1.run(AbstractSynchronousNonBlockingStepExecution.java:44)
	at java.util.concurrent.Executors$RunnableAdapter.call(Unknown Source)
	at java.util.concurrent.FutureTask.run(Unknown Source)
	at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
	at java.lang.Thread.run(Unknown Source)
Caused by: java.nio.file.FileSystemException: C:\...\artifactsArchive1192707576229944372.tmp\archive.zip: The process cannot access the file because it is being used by another process.
	at sun.nio.fs.WindowsException.translateToIOException(Unknown Source)
	at sun.nio.fs.WindowsException.rethrowAsIOException(Unknown Source)
	at sun.nio.fs.WindowsException.rethrowAsIOException(Unknown Source)
	at sun.nio.fs.WindowsFileSystemProvider.implDelete(Unknown Source)
	at sun.nio.fs.AbstractFileSystemProvider.deleteIfExists(Unknown Source)
	at java.nio.file.Files.deleteIfExists(Unknown Source)
	at hudson.Util.tryOnceDeleteFile(Util.java:287)
	at hudson.Util.deleteFile(Util.java:243)
	at hudson.FilePath.deleteRecursive(FilePath.java:1209)
	at hudson.FilePath.deleteContentsRecursive(FilePath.java:1218)
	at hudson.FilePath.deleteRecursive(FilePath.java:1200)
	at hudson.FilePath.access$1000(FilePath.java:195)
	at hudson.FilePath$14.invoke(FilePath.java:1179)
	at hudson.FilePath$14.invoke(FilePath.java:1176)
	at hudson.FilePath.act(FilePath.java:996)
	at hudson.FilePath.act(FilePath.java:974)
	at hudson.FilePath.deleteRecursive(FilePath.java:1176)
	at com.microsoftopentechnologies.windowsazurestorage.WAStorageClient.upload(WAStorageClient.java:359)

MicrosoftAzureStorage - Container name is missing or not valid

I'm using this plugin in Jenkins, when i'n passig any environment variable (E.G ${JOB_NAME}) to the :"Container name" box and trying to upload, i'm getting an error: "MicrosoftAzureStorage - Container name is missing or not valid", i'm using the post build step "Upload artifacts to Microsoft Azure Blob storage".
If i'm providind a name to the "Container name" (E.G blob_test) and not an environment variable, it's working fine for me.

windows-azure-storage-plugin is keeping my files locked.

Hi,

first of all thanks for this amazing plugin. It's a core component of our deployment pipeline.
Lately I am having some issues after uploading my artifacts.

I upload my deliverable (zip file +/- 140MB) via the windows-azure-storage-plugin.
After the upload succeeds the file stays locked and I am unable to clean up the workspace.
Waiting for 30 minutes does not help.
Environment:
OS:Windows 2012R2
Jenkins: 2.5.2
windows-azure-storage-plugin 0.3.2 (same issue with 0.3.4)
Process Explorer (SysInternals) is showing the java.exe is keeping the file locked.

When I remove the windows-azure-storage-plugin from my build, the workspace gets cleaned up.
Any tips, hints how I could resolve this?

Log file:
C:\Program Files (x86)\Jenkins\Build Test42Server - Package Artifacts>exit 0
MicrosoftAzureStorage - Uploading files to Microsoft Azure
Uploaded blob with uri http://XXXXXX.blob.core.windows.net/jenkins/test-42server/797.zip in 00:00:07.808 (HH:mm:ss.S)
MicrosoftAzureStorage - Uploaded/archived file count = 1
[WS-CLEANUP] Deleting project workspace...Cannot delete workspace :Unable to delete 'C:\Program Files (x86)\Jenkins\Build Test42Server - Package Artifacts'. Tried 3 times (of a maximum of 3) waiting 0.1 sec between attempts.
ERROR: Step ‘Delete workspace when build is done’ failed: Cannot delete workspace: Unable to delete 'C:\Program Files (x86)\Jenkins\Build Test42Server - Package Artifacts'. Tried 3 times (of a maximum of 3) waiting 0.1 sec between attempts.

Failing with Azure Stack

Hi I am trying to use this with Azure Stack. It is failing with:

Failed to validate storage account details. Please verify storage account name and key. If you are using a private or other Windows Azure cloud service, make sure that the blob endpoint url is correct.
Storage Account name --->jenkinsupload<----
Blob end point url --->https://jenkinsupload.blob.local.azurestack.external/<----
ERROR: Step ‘Upload artifacts to Microsoft Azure Storage’ aborted due to exception: 
java.io.IOException: Plugin can not continue, until previous errors are addressed
	at com.microsoftopentechnologies.windowsazurestorage.WAStoragePublisher.perform(WAStoragePublisher.java:403)
	at hudson.tasks.BuildStepCompatibilityLayer.perform(BuildStepCompatibilityLayer.java:78)
	at hudson.tasks.BuildStepMonitor$2.perform(BuildStepMonitor.java:32)
	at hudson.model.AbstractBuild$AbstractBuildExecution.perform(AbstractBuild.java:779)
	at hudson.model.AbstractBuild$AbstractBuildExecution.performAllBuildSteps(AbstractBuild.java:720)
	at hudson.model.Build$BuildExecution.post2(Build.java:186)
	at hudson.model.AbstractBuild$AbstractBuildExecution.post(AbstractBuild.java:665)
	at hudson.model.Run.execute(Run.java:1753)
	at hudson.model.FreeStyleBuild.run(FreeStyleBuild.java:43)
	at hudson.model.ResourceController.execute(ResourceController.java:98)
	at hudson.model.Executor.run(Executor.java:405)

This could be for many reasons, SSL verification (although I have added the root cert to the java keystore), incorrect API versions, or incorrect resource provided in the token request.

How can I enable debug logging and where should I look to troubleshoot this please.

v0.3.3 : Global credentials are lost

Since version 0.3.3, it is impossible to save the credentials for Microsoft Azure Storage.

Everytime we click on save and come back to the editing screen, the credentials are reset as follows :

Better support for downloading artefacts from other jobs

It is a pain in the ass right now to just download "the latest version of file foo, from a successful build of job bar" - the S3 plugin makes it easy, but the Azure plugin is much harder to achieve this. We know in the Jenkins metadata what the path is to the last uploaded Azure artefacts, so it's no big deal to expose that downstream in other jobs

Failed to download the artifacts from "Azure Artifacts" link in Jenkins

In the build job, there is a link "Azure Artifacts" on the left side of the job page which points to a broken link. Instead of pointing to the azure URL and download the artifacts from Jenkins, it tries to look for server's local path and throws the HTTP ERROR 500. The Azure artifacts should be able to be downloaded from that link in Jenkins instead of only be downloaded from the Azure Storage Account (Azure portal) since some people do not have access to Azure.

`HTTP ERROR 500

Problem accessing /job/builds/view/dev/job/--/--/Azure/processDownloadRequest/--/--/packages.7z. Reason:

Error occurred while downloading artifact The server encountered an unknown failure: `

[Request] Copy full folders

Is it possible to copy full folders rather than each file?

In my artifacts I have a lot of small files, plugin copy one by one and it's take 'forever'. I want to copy all stuff from azure container, atm with AzCopy it's take ~2 min, with plugin almost 30 min

[Request] Support of Content type when upload

In current plugin, every file uploaded to Blob is stored as application/octet-stream MIME type.
Do your plugin support different type of this. And if not, please help me where can I start from your project to support file types?
Thanks

Why does the publish step require build serialization

Why does the publish step of the build require serialization with the previous build (at least if the container is not to be cleaned before uploading)?

From WAStoragePublisher.java

public BuildStepMonitor getRequiredMonitorService() {
    return BuildStepMonitor.STEP;
}

Uploading large files fails

When I try to upload large files (I'm trying to upload a 20 GB .vhd file), the Jenkins plugin can't handle it.

WindowsAzureStorage - Uploading files to Windows Azure

ERROR: WindowsAzureStorage - Error occured while uploading to Windows Azure - repo01
com.microsoftopentechnologies.windowsazurestorage.exceptions.WAStorageException
at com.microsoftopentechnologies.windowsazurestorage.WAStorageClient.upload(WAStorageClient.java:173)
at com.microsoftopentechnologies.windowsazurestorage.WAStoragePublisher.perform(WAStoragePublisher.java:159)
at hudson.tasks.BuildStepMonitor$2.perform(BuildStepMonitor.java:27)
at hudson.model.AbstractBuild$AbstractBuildExecution.perform(AbstractBuild.java:804)
at hudson.model.AbstractBuild$AbstractBuildExecution.performAllBuildSteps(AbstractBuild.java:776)
at hudson.model.Build$BuildExecution.post2(Build.java:183)
at hudson.model.AbstractBuild$AbstractBuildExecution.post(AbstractBuild.java:726)
at hudson.model.Run.execute(Run.java:1618)
at hudson.model.FreeStyleBuild.run(FreeStyleBuild.java:46)
at hudson.model.ResourceController.execute(ResourceController.java:88)
at hudson.model.Executor.run(Executor.java:247)
Caused by: java.util.concurrent.ExecutionException: java.lang.IllegalArgumentException: Null InputStream is not a valid argument
at java.util.concurrent.FutureTask$Sync.innerGet(Unknown Source)
at java.util.concurrent.FutureTask.get(Unknown Source)
at com.microsoft.windowsazure.services.blob.client.BlobOutputStream.waitForTaskToComplete(BlobOutputStream.java:497)
at com.microsoft.windowsazure.services.blob.client.BlobOutputStream.dispatchWrite(BlobOutputStream.java:351)
at com.microsoft.windowsazure.services.blob.client.BlobOutputStream.writeInternal(BlobOutputStream.java:624)
at com.microsoft.windowsazure.services.blob.client.BlobOutputStream.write(BlobOutputStream.java:545)
at com.microsoft.windowsazure.services.core.storage.utils.Utility.writeToOutputStream(Utility.java:1018)
at com.microsoft.windowsazure.services.blob.client.BlobOutputStream.write(BlobOutputStream.java:560)
at com.microsoft.windowsazure.services.blob.client.CloudBlockBlob.upload(CloudBlockBlob.java:463)
at com.microsoft.windowsazure.services.blob.client.CloudBlockBlob.upload(CloudBlockBlob.java:380)
at com.microsoftopentechnologies.windowsazurestorage.WAStorageClient.upload(WAStorageClient.java:166)
... 10 more
Caused by: java.lang.IllegalArgumentException: Null InputStream is not a valid argument
at com.ctc.wstx.stax.WstxInputFactory.createSR(WstxInputFactory.java:614)
at com.ctc.wstx.stax.WstxInputFactory.createXMLStreamReader(WstxInputFactory.java:317)
at com.microsoft.windowsazure.services.core.storage.utils.Utility.createXMLStreamReaderFromStream(Utility.java:327)
at com.microsoft.windowsazure.services.core.storage.utils.implementation.StorageErrorResponse.(StorageErrorResponse.java:59)
at com.microsoft.windowsazure.services.core.storage.StorageException.getErrorDetailsFromRequest(StorageException.java:54)
at com.microsoft.windowsazure.services.core.storage.StorageException.translateException(StorageException.java:85)
at com.microsoft.windowsazure.services.core.storage.utils.implementation.ExecutionEngine.executeWithRetry(ExecutionEngine.java:147)
at com.microsoft.windowsazure.services.blob.client.CloudBlockBlob.uploadBlockInternal(CloudBlockBlob.java:639)
at com.microsoft.windowsazure.services.blob.client.CloudBlockBlob.uploadBlock(CloudBlockBlob.java:578)
at com.microsoft.windowsazure.services.blob.client.BlobOutputStream$1.call(BlobOutputStream.java:365)
at com.microsoft.windowsazure.services.blob.client.BlobOutputStream$1.call(BlobOutputStream.java:361)
at java.util.concurrent.FutureTask$Sync.innerRun(Unknown Source)
at java.util.concurrent.FutureTask.run(Unknown Source)
at java.util.concurrent.Executors$RunnableAdapter.call(Unknown Source)
at java.util.concurrent.FutureTask$Sync.innerRun(Unknown Source)
at java.util.concurrent.FutureTask.run(Unknown Source)
at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
at java.lang.Thread.run(Unknown Source)
Build step 'Upload artifacts to Windows Azure Blob storage' changed build result to UNSTABLE

Finished: UNSTABLE

Support secure (https) upload and download

When a storage account is configure with the Secure transfer required option enabled, the plugin fails to upload files, since it only uploads over http.
Furthermore, even if the endpoint url is configured with https, it is ignored: the actual upload is performed over http.
This is a security concern, primarily because it also brings into question the matter of credentials passing over an insecure connection.

azureUpload doesn't provide usefull debug information

I tried to use the azureUpload command for our CI, but I couldn't figure out what I set wrong. There's no usefull debug information.
Here's the groovy script: azure-devops/ci@90d0987
And here's the error:
http://devops-ci.westcentralus.cloudapp.azure.com/job/azure-credentials/job/jenkinsci/job/master/44/console

MicrosoftAzureStorage - Uploading files to Microsoft Azure
MicrosoftAzureStorage - Failed to upload any build artifacts to Azure Storage
Verify the list of files to upload and that the Ant glob syntax is correct
ERROR: MicrosoftAzureStorage - Error occurred while uploading to Azure - devopspublicstorage
java.io.IOException: MicrosoftAzureStorage - Failed to upload any build artifacts to Azure Storage
Verify the list of files to upload and that the Ant glob syntax is correct
at com.microsoftopentechnologies.windowsazurestorage.WAStoragePublisher.perform(WAStoragePublisher.java:420)
at org.jenkinsci.plugins.workflow.steps.CoreStep$Execution.run(CoreStep.java:78)
at org.jenkinsci.plugins.workflow.steps.CoreStep$Execution.run(CoreStep.java:65)
at org.jenkinsci.plugins.workflow.steps.SynchronousNonBlockingStepExecution$1$1.call(SynchronousNonBlockingStepExecution.java:49)
at hudson.security.ACL.impersonate(ACL.java:260)
at org.jenkinsci.plugins.workflow.steps.SynchronousNonBlockingStepExecution$1.run(SynchronousNonBlockingStepExecution.java:46)
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:473)
at java.util.concurrent.FutureTask.run(FutureTask.java:262)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
at java.lang.Thread.run(Thread.java:745)

The plugin should provide better logs.

Cannot upload files to $root

When you enter '$root' as your container name you will get an error 'MicrosoftAzureStorage - Container name is missing or not valid'.

Support uploading artifacts newer than a build.

Files match 'list of artifacts to upload' should be checked whether has an update time newer than current build.

This is like what 'Publish Junit test result report' does, which checks only result xml file newer than current build.

Also can provider an option for 'do not fail on empty match', for cases where files exist but older than current build.

Fail to clear workspace if artifact has been pushed to Azure

After a build succeeds and an artifact has been published to Azure Storage, a subsequent build will fail to clear the workspace because some process still has a handle to the file that was uploaded.

Building on master in workspace C:\Users\auxweb-admin.jenkins\workspace\auxweb_n_f1

Deleting project workspace... Cannot delete workspace: null
ERROR: Cannot delete workspace: null
WindowsAzureStorage - Build failed, hence cancelling the upload of the artifacts to Windows Azure storage
Finished: FAILURE

After a while, the files are released and the build starts to work again.

excludeFilesPath should support multiple glob patterns

It would be incredibly useful if we could exclude a list of glob patterns when uploading files to Azure storage. For example, if I have files such as:

secrets.txt
forMyEyesOnly.json
...

I would like to exclude those 2 from the upload, but it's not intuitive to create a glob expression that would exclude them. Can this support multiple patterns?

Blank window when trying to configure

Hello,

I am trying to configure my storage account in Jenkins, but when I try to add storage account under "Configure System", I only get a blank window and am not able to configure the service.

I updated all my plugins before doing this, so I am using version 0.3.7 of the plugin.

jenkins-bug

Blob service endpoint URL

Using version 0.3.0, and promotion plugin, upload artefact to Azure causes that endpoint URL is prefixed by Storage account name. F.e.:

after second build service URL will be: https://[accountName].[accountName].blob.core.windows.net/

unable to connect from behind HTTP_PROXY

I'm having issues where I cannot configure this plugin to any Azure Storage. I think its because i'm behind a HTTP_PROXY but i'm not sure how to confirm this or configure it (my apologies if this is not the correct place for this request). Given that there are only a few entries to put in the global configuration (Storage Account Name, Storage Account Key, BLOB Endpoint URL, ID) i'm not sure how i can mess this part up. Key1 vs Key2 seems to be the "trickest" part to make sure that the blob is looking at the right key, but to be safe i've tried both to no amend. Which is why I think its the plugin/jenkins not authenticating to the HTTP_PROXY correctly. The error message on the Jenkins credential screen (no matter what I put in for values) is: "Failed to validate storage account details. Please verify storage account name and key. If you are using a private or other Windows Azure cloud service, make sure that the blob endpoint url is correct."

Screen shots:
azure
jenkins

Add a list operation to list content of storage

Having a list operation would enable us to use this plugin in a flow similar to this:

  • Upload artifacts
  • List artifacts and demand and store it in a file
  • Use file as list of available artifacts for entry parameters for download /deploy of artifacts

Upload to the correct azure folder path, not follow jenkins workspace path

I have a jenkins android build, which after building the app the apk file is placed at app/build/outputs/apk/SP*.apk. That file path is placed on the List of artifacts to upload field.

But when uploading it to azure storage, it create the same app/build/outputs/apk/SP*.apk path in the container. I just want the apk to store on the root level in the container itself. Is that possible?

'fileShareName' required when uploading to blob storage

When using 'azureUpload' in declarative pipeline, it requires 'fileShareName' even when uploading to a blob storage.

Missing required parameter: "fileShareName" @ line 47, column 17.
                   azureUpload storageCredentialId: 'a', storageType: 'blobstorage', containerName: 'aaaa', filesPath: "*"

Setting an empty value will do the trick, but seems that parameter should be optional.

Content Type auto detecting should be disabled by default

The content type auto detection is enabled by default, that means old jobs will change behavior all of a sudden. That shouldn't happen, users should opt in for new features.
I noticed this problem when the job that was uploading hpi files started uploading them with the zip content type.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.