simeoncloud / IntuneAppBuilder

A cross platform, Intune application packaging and deployment console tool and SDK :zap:
https://simeoncloud.com
Apache License 2.0
60 stars 3 forks source link

After running the publish command for a while, I keep getting 403 errors. #18

Closed micachi closed 3 years ago

micachi commented 3 years ago

After running the publish command for a while, I keep getting 403 errors.

image

Is there a solution?

jeff-simeon commented 3 years ago

Does this happen every time?

This error does occur for me as well, transiently, during the course of Intune operations. Usually deleting the app and republishing will fix it.

micachi commented 3 years ago

Yes, I always get this error. It takes time to upload a large Intunewin file that is close to 8GB, but it happens about 10 to 15 minutes after the upload starts.

jeff-simeon commented 3 years ago

This may be a limitation on the Microsoft side if the authorization for the upload link expires.... Out of curiosity - are you able to upload it successfully through the Endpoint Manager portal?

micachi commented 3 years ago

You can do that, but due to an error in the official MSI analysis, you run into the problem of not being able to choose a system installation. I was thinking of using it to avoid this official problem.

jeff-simeon commented 3 years ago

So the timeout does not occur when doing this through the Endpoint Portal, even with an 8GB package file?

micachi commented 3 years ago

No, the portal took some time, but never timed out.

jeff-simeon commented 3 years ago

The portal should be making the exact same api calls as the IntuneAppBuilder tool. I’ll have to profile the portal and see if it’s doing something special with the upload.

micachi commented 3 years ago

The IntuneAppBuilder tool seems to reacquire SAS every few minutes.

jeff-simeon commented 3 years ago

That's interesting - what makes you say that? I ask because (at a glance) I don't see any situation in the code where it would be trying to re-acquire a blob storage URI during the upload process.

Unless I'm misreading something, we add the content file, wait until a storage URI becomes available, then upload all the block blobs to that URI.

micachi commented 3 years ago

Sorry... It was the IntuneWin32App module. https://github.com/MSEndpointMgr/IntuneWin32App

jeff-simeon commented 3 years ago

So you're saying that module DOES refresh the storage URI and doing so makes it work?

micachi commented 3 years ago

Below is the applicable script. The "Invoke-AzureStorageBlobUploadRenew" command used in this seems to be a storage SAS update. https://github.com/MSEndpointMgr/IntuneWin32App/blob/master/Private/Invoke-AzureStorageBlobUpload.ps1

The contents of the "Invoke-AzureStorageBlobUploadRenew" command can be found at the link below. https://github.com/MSEndpointMgr/IntuneWin32App/blob/master/Private/Invoke-AzureStorageBlobUploadRenew.ps1

jeff-simeon commented 3 years ago

This is helpful - thank you. We will implement this.

micachi commented 3 years ago

I'm glad it was useful. Thank you for your quick response.

jeff-simeon commented 3 years ago

Please give this release a try https://www.nuget.org/packages/IntuneAppBuilder.Console/1.5.1-renew-sas0013

micachi commented 3 years ago

Thank you for your support. Currently, I'm actually uploading and checking the operation, so please wait for a while.

micachi commented 3 years ago

The huge Intunewin file was successfully uploaded, but the commit operation failed. Perhaps the devicecode authentication has expired.

jeff-simeon commented 3 years ago

@micachi - can you please send a copy of the error you received on commit? alternatively, do you have a URL we can download your package source from to test it?

micachi commented 3 years ago

image Here it is.

jeff-simeon commented 3 years ago

It seems possible that extremely large files like this take longer to have a commit succeeded status than smaller files and the wait is timing out.

I’ve published an update package with an extended timeout of 10 minutes to the same prerelease version prefix. Please give that a try.

micachi commented 3 years ago

The same phenomenon happened ...

image

jeff-simeon commented 3 years ago

Would it be possible to share the file you are trying to package?

micachi commented 3 years ago

Due to software conventions, it is difficult to share.

jeff-simeon commented 3 years ago

Understood. I’ve tried successfully to test with an 8GB file. How large exactly is yours?

micachi commented 3 years ago

The package is about 7GB, but the upload speed is about 1MB / s.

jeff-simeon commented 3 years ago

Hi @micachi - we added a test with an 7GB file https://github.com/simeoncloud/IntuneAppBuilder/blob/b75a20a06e1831d71ec9a048fd3e537d2395bcfe/Tests/IntegrationTests/ProgramTests.cs#L37

and it's passing. It could have to do with your upload speed, but not sure.

Are you definitely using the newest prerelease version of the package? This is the latest that includes the 7GB file test: https://www.nuget.org/packages/IntuneAppBuilder/1.5.1-renew-sas0026

micachi commented 3 years ago

I'm sorry. Maybe I was trying with the sas0013 version. I updated to sas0031 and tried again and the problem went away. This issue has been resolved and will be closed with this comment. Thank you for your cooperation.

jeff-simeon commented 3 years ago

no problem…this has been deployed to master so you no longer need the prerelease version