LSRServiceException – Could not find Linked Service, the linked service does not exist or is not published

I only had 1 SparkPool which was provisioned using Apache Spark version 3.1.  So when I created my Regression Azure Machine Learning model it defaulted to that Spark Pool.  When I clicked on the Create run button, after some moments, I received the following error…

image

Figure 1, Could not find Linked Service, the linked service does not exist or is not published

I did not find any information or documentation about this, so I decided to take another approach.  Instead of pressing the Create run button I click the Open in notebook button.

image

Figure 2, Could not find Linked Service, the linked service does not exist or is not published

When I ran the first cell I received this error and thought I had found the problem, I was so happy.  So I created a second Spark pool that targeted version 2.4 as instructed.

****** AutoML Prerequisites ******
AutoML requires an Apache Spark pool (version 2.4) in your Azure Synapse Analytics workspace.
You are using a Spark 3.x pool, please use Spark 2.x pool.

image

Figure 3, Could not find Linked Service, the linked service does not exist or is not published

Then, this second error went away…I walked through the remaining cells, one by one, the next one failed.  It failed at this line of code with the same error as before. (Access token couldn’t be obtained,LSRServiceException, Could not find Linked Service, the linked service does not exist or is not published)

ws = mssparkutils.azureML.getWorkspace(linkedService_name)

Solution

It turns out that you need to Publish your Linked service.  There may be more required steps, but the solution is to push the Publish button.

image

Figure 4, Could not find Linked Service, the linked service does not exist or is not published

AutoML run submission failed
An error occurred while submitting an AutoML run. Error: Py4JJavaError : An error occurred while calling z:mssparkutils.azureML.getPropertiesAsJMap. : java.lang.Exception: Access token couldn’t be obtained {“result”:”DependencyError”,”errorId”:”BadRequest”,”errorMessage”:”LSRServiceException is [{\”StatusCode\”:400,\”ErrorResponse\”:{\”code\”:\”LSRLinkedServiceFailure\”,\”message\”:\”Could not find Linked Service ; the linked service does not exist or is not published.\”,\”target\”:\”BrainjammerAML\”},\”StackTrace\”:\” at Microsoft.Marlin.Common.ADF.Impl.LSRClient.CheckForFailures(HttpResponseMessage response, String responseContent) in C:\\\\source\\\\Common\\\\Microsoft.Marlin.Common.ADF\\\\Impl\\\\LSRClient.cs:line 348\\r\\n at Microsoft.Marlin.Common.ADF.Impl.LSRClient.SendAsync(HttpRequestMessage request, CancellationToken cancellationToken, String traceId) in C:\\\\source\\\\Common\\\\Microsoft.Marlin.Common.ADF\\\\Impl\\\\LSRClient.cs:line 365\\r\\n at Microsoft.Marlin.Common.ADF.Impl.LSRClient.ResolveLinkedServiceAsync(String linkedServiceName, ResolveAudienceRequest request, String traceId, CancellationToken cancellationToken) in C:\\\\source\\\\Common\\\\Microsoft.Marlin.Common.ADF\\\\Impl\\\\LSRClient.cs:line 202\\r\\n at Microsoft.Marlin.TokenService.Token.LSRAudienceTokenProvider.GetToken(Boolean isLinkedService, String audience, String sessionToken, CancellationToken cancellationToken) in C:\\\\source\\\\TokenService\\\\Microsoft.Marlin.TokenService\\\\Token\\\\LSRAudienceTokenProvider.cs:line 153\\r\\n at Microsoft.Marlin.TokenService.Token.LSRAudienceTokenProvider.GetTokenForAudienceAsync(Boolean isLinkedService, String audience, String account, String sessionToken, SignaturePayload signaturePayload, CancellationToken cancellationToken) in