microsoft / testbase

Samples and Tools for Test Base for M365.
MIT License
40 stars 16 forks source link

I'm trying to upload package to azure test base using Rest API and package get's successfully uploaded but every time package gets fail in verification due some blob path related issue anyone help me to to find exact blob path. #28

Closed swahelamulla closed 2 years ago

swahelamulla commented 2 years ago

I'm trying to upload my package to azure test base using azure rest API, Every time package get's uploaded successfully to test base service but package get failed (every time verification status is verification failed ) showing some blob related error message.("The specified blob does not exist.") I have taken blob path from file upload URL of a Test Base Account.(I have stored my package inside storage account with a container have public access)

When I run rest API the Response Code: 201

Error in JSON File after failure in verification.

"packageStatus": "Error", "validationResults": [ { "validationName": "Sanity Checks Validator", "isValid": false, "errors": [ "The specified blob does not exist." ] } ], "validationRunStatus": "Failed"

yazeng commented 2 years ago

Hi Swahela, Thank you for reporting the first issue of Test Base!

We currently only allow the package to be uploaded to Test Base specified blob path. You can retrieve it by calling this API: https://learn.microsoft.com/en-us/rest/api/testbase/test-base-accounts/get-file-upload-url?tabs=HTTP So the steps should be:

  1. Create a test base account.
  2. Get the upload URL.
  3. Upload your package to the URL of step 2.
  4. Create the package.

You can refer to this example for reference: https://github.com/microsoft/testbase/blob/6191b1237576238db1e1adff18fa205c3ac5f381/Utilities/CICD/Azure-DevOps/CreateOrUpdatePackage.ps1#L118

We will update our documentation to make this clear.

Thanks, Yan

swahelamulla commented 2 years ago

Thank you soo much yazeng.

In API doc the blob path is [storageAccountPath/package.zip] so, it is confusing.

Also I want to ask you one more question . If we use Test Base Create Package API then we can upload only pre-built package right? Is there any option to proceed with application files only(.msi/.exe) as we have option in azure portal build package from scratch like that, because I have tested with msi&exe files it is not working showing error message .zip is necessary.

yazeng commented 2 years ago

I'm glad that helped. This is a good question. We do not have such rest API for now. But I'm curious what your user scenario is, why do you want to upload (msi/exe) only? If you build the package on Azure Portal, you still need to update the script files (install/launch/close/uninstall) manually.

swahelamulla commented 2 years ago

Hi Yan,

I'm excited to learn Azure Test Base service, I have more no of applications so I had to test them with test base . Rest API is good option than azure portal but we need to build package(It will be very difficult to build package every time for so many apps) and this is main problem. is there any option to test applications in bulk using any work flow. It would be better for me if you give any advice.

Thanks!

yazeng commented 2 years ago

Hi Swahela,

Thanks for sharing! We have an example workflow, which includes: build the app, compress the package and upload to Test Base. I hope it will give you some help. I'm waiting for you feedback.

Thanks, Yan

swahelamulla commented 2 years ago

Okay, I will try with this solution. Thank you very much @yazeng

swahelamulla commented 2 years ago

Hi @yazeng what exact changes we have to make with editor in that 4 scripts (Install, Launch, Close and Uninstall). I know we have to change msi name, Process name but other than this we have make any other change?

yazeng commented 2 years ago

Hi Swahela, Sorry I reply to you late, because we are taking national holidays this week. Quick answer to your question is yes, only msi and process name need to be modified. But if you have your own functional test cases, it will be another story.

swahelamulla commented 2 years ago

No problem @yazeng and Thanks For your Support

Change the $exePath to your execution path, add -ArgumentList if need.

$exePath = "C:\Program Files\Test Base M365\DigitalClock\DigitalClock.exe"

What about this path if we have to change then can i change only this much of part(DigitalClock\DigitalClock.exe) and make (C:\Program Files\Test Base M365) remaining part is comman for everytime is it right?

I want to ask you 1 more question what is exactly process name. Suppose if i have Outlook.msi/exe then we have to take only Outlook as process name correct? or any other possibilities we have in process name.

yazeng commented 2 years ago
  1. No, you should modify the full path, not only DigitalClock\DigitalClock.exe. Check this example. It is launching the new sample app Calculator. You should be able to find the full path of the exe after you install your app. Or you can ask the app owner for the installation path.
  2. From this example, you can also find that this script is using Get-Process to verify the status of the app. So just make sure your process name can be found by "Get-Process". And yes, Outlook is the process name of Outlook.exe.
swahelamulla commented 2 years ago

Thank you for the clarification.

swahelamulla commented 2 years ago

Hi @yazeng I'm lil bit confuse in Feature Update and I want some clarification. I have selected Insider Channel values but the values are not present inside JSON file.

Screenshot (498)

Screenshot (527)

yazeng commented 2 years ago

Hi Swahela, Try this:

{
  "osUpdateType": "Feature updates",
  "targetOSs": null,
  "baselineOSs": [
    "Windows 10 21H2"
  ],
  "insiderChannelIds": [
    "1772747126",
    "2120650206"
  ]
}
swahelamulla commented 2 years ago

@yazeng I want that third insiderChannelId also for Windows 11 22H2 (Insider Beta Channel, RTM) and targetOS's value is always null in feature update case?

yazeng commented 2 years ago
  1. Yes, it is always null. It's represented by the insiderChannelIds field for Feature Update

swahelamulla commented 2 years ago

Thank you !

yazeng commented 2 years ago

@swahelamulla I'll close this issue. You can create a new one if you have any other questions regarding Test Base.

swahelamulla commented 2 years ago

Okay

yazeng commented 2 years ago

@swahelamulla Check this PR, let me know if it is helpful for you to build multiple packages.