Patch-AmlWebServiceEndpoint Failing RRS feed

  • Question

  • Hi,

    when using Patch-AmlWebServiceEndpoint I'm getting the following error telling me that the URL for the retraining model is invalid:

    This is somewhat intermittent as I have got it to work previously (Usually just after I've created the retraining experiment and service) but the functionality seems to start to fail at some point after being invoked against the same retraining model a number of times (As per this article).

    Can anyone shed any light on this as I need to invoke this cmdlet 196 times and intend to automate the whole process so ideally need to be able to rely on this function to work consistently.



    • Edited by hemil1 Monday, August 12, 2019 2:30 PM
    Monday, August 12, 2019 2:19 PM

All replies

  • Just for reference, here is the trained model in Studio. I am referencing the same name in my PS script but the error says the URL for this endpoint is invalid:

    Monday, August 12, 2019 2:25 PM
  • Hello hemil1,

    Could you please check if the relative location and base location i.e the storage account URI is set correctly for the trained model to be used for patching as mentioned in the sample of the documentation?

    # Patch the 10 endpoints with respective .ilearner models
    $baseLoc = 'http://bostonmtc.blob.core.windows.net/'
    $sasToken = '<my_blob_sas_token>'
    For ($i = 1; $i -le 10; $i++){
        $seq = $i.ToString().PadLeft(3, '0');
        $endpointName = 'rentalloc' + $seq;
        $relativeLoc = 'hai/retrain/bike_rental/model' + $seq + '.ilearner';
        Write-Host ('Patching endpoint ' + $endpointName + '...');
        Patch-AmlWebServiceEndpoint -WebServiceId $scoringSvc.Id -EndpointName $endpointName -ResourceName 'Bike Rental [trained model]' -BaseLocation $baseLoc -RelativeLocation $relativeLoc -SasBlobToken $sasToken

    Could you also check if the ilearner files are available on the relative path on the blob storage as mentioned in your command?


    Tuesday, August 13, 2019 6:25 AM
  • Hi Rohit,

    Thanks for the response. Yes, I've checked the base and relative locations and these are both correct. the ilearner file is available at the relative location in blob storage and the trained model exists in Studio as per my screenshot above. I've also tried making the same request using the sample python this morning and getting the same 400 Bad request error.



    Tuesday, August 13, 2019 10:41 AM
  • Hi Rohit,

    Looks like the issue is with the SAS token. It appears to have changed since I first wrote the PS script. Just testing now but the new one seems to work. Is there any reason why the SAS token would change like this without being updated by myself?



    Tuesday, August 13, 2019 12:06 PM
  • Hi hemil1,

    I would guess the previous token would have expired but there could be a different reason based on how it was first created. Please take a look at the best practices of using a SAS token so you could avoid such issues in the future.


    Friday, August 16, 2019 12:35 PM