MS Sql Server dacpac deploy - c#

var svc = new DacServices(connectionString);
using (var dacPak = DacPackage.Load(dacpacPath))
{
svc.Deploy(dacPak, databaseName);
}
Returns below error: using .net Framework 4.7.2
Microsoft.SqlServer.TransactSql.ScriptDom.SqlScriptGeneratorOptions.set_AllowExternalLibraryPaths(Boolean)
Stacktrace:
at Microsoft.Data.Tools.Schema.Sql.Deployment.SqlDeploymentPlanGenerator.ScriptGeneratorFacade..ctor(DeploymentContext context, Func1 getTargetDboUserSecurityId) at Microsoft.Data.Tools.Schema.Sql.Deployment.SqlDeploymentPlanGenerator.OnInitialize(SqlDeployment engine) at Microsoft.Data.Tools.Schema.Sql.Deployment.SqlDeployment.InitializePlanGeneratator() at Microsoft.Data.Tools.Schema.Sql.Deployment.SqlDeployment.CreateController(Action1 msgHandler)
at Microsoft.SqlServer.Dac.DacServices.CreateController(SqlDeployment deploymentEngine, ErrorManager errorManager)
at Microsoft.SqlServer.Dac.DeployOperation.<>c__DisplayClass3.<>c__DisplayClass5.b__1()
at Microsoft.Data.Tools.Schema.Sql.Dac.OperationLogger.Capture(Action action)
at Microsoft.SqlServer.Dac.DeployOperation.<>c__DisplayClass3.b__0(Object operation, CancellationToken token)
at Microsoft.SqlServer.Dac.Operation.Microsoft.SqlServer.Dac.IOperation.Run(OperationContext context)
at Microsoft.SqlServer.Dac.ReportMessageOperation.Microsoft.SqlServer.Dac.IOperation.Run(OperationContext context)
at Microsoft.SqlServer.Dac.OperationExtension.CompositeOperation.Microsoft.SqlServer.Dac.IOperation.Run(OperationContext context)
at Microsoft.SqlServer.Dac.OperationExtension.CompositeOperation.Microsoft.SqlServer.Dac.IOperation.Run(OperationContext context)
at Microsoft.SqlServer.Dac.DeployOperation.Microsoft.SqlServer.Dac.IOperation.Run(OperationContext context)
at Microsoft.SqlServer.Dac.OperationExtension.Execute(IOperation operation, DacLoggingContext loggingContext, CancellationToken cancellationToken)
at Microsoft.SqlServer.Dac.DacServices.InternalDeploy(IPackageSource packageSource, Boolean isDacpac, String targetDatabaseName, DacDeployOptions options, CancellationToken cancellationToken, DacLoggingContext loggingContext, Action3 reportPlanOperation, Boolean executePlan) at Microsoft.SqlServer.Dac.DacServices.Deploy(DacPackage package, String targetDatabaseName, Boolean upgradeExisting, DacDeployOptions options, Nullable1 cancellationToken)
at dacpac.Migrations.Program.CreateAndInitializeFromDacpac(String databaseName, String connectionString, String dacpacPath) in C:\Users\myself\source\repos\ConsoleApp3\Program.cs:line 63
at dacpac.Migrations.Program.Main(String[] args) in C:\Users\myaelf\source\repos\ConsoleApp3\Program.cs:line 25
references:

Related

Azure Blob Storage: 412 (The condition specified using HTTP conditional header(s) is not met.) BlobContainerClient

I am using BlobContainerClient to get files from AzureBlobStorage.
The process is to get the files in AzureBlobStorage then it will download it to a local file and delete it after.
But I am getting error when I deploy it, but locally works fine.
412 (The condition specified using HTTP conditional header(s) is not
met.)
Below is my sample code.
BlobContainerClient container = new BlobContainerClient(azureBlobSettings.Connectionstring, azureBlobSettings.Containername);
var blobList = container.GetBlobs();
foreach (var blobItem in blobList)
{
if (blobItem.Name.Contains(".csv"))
{
LogInfo($"Downloading file {blobItem.Name} ...");
var blob = container.GetBlobClient(blobItem.Name);
var blobSplit = blob.Name.Split("/");
var blobPath = blobSplit[0];
var blobName = blobSplit[1];
blob.DownloadTo($"{csvSettings.TargetPath}{blobName}");
blob.DeleteIfExists();
}
}
Below is the detailed error:
at Azure.Storage.Blobs.BlobRestClient.Download(String snapshot, String versionId, Nullable`1 timeout, String range, String leaseId, Nullable`1 rangeGetContentMD5, Nullable`1 rangeGetContentCRC64, String encryptionKey, String encryptionKeySha256, Nullable`1 encryptionAlgorithm, Nullable`1 ifModifiedSince, Nullable`1 ifUnmodifiedSince, String ifMatch, String ifNoneMatch, String ifTags,CancellationToken cancellationToken)
at Azure.Storage.Blobs.Specialized.BlobBaseClient.StartDownloadAsync(HttpRange range, BlobRequestConditions conditions, Boolean rangeGetContentHash, Int64 startOffset, Boolean async, CancellationToken cancellationToken)
at Azure.Storage.Blobs.Specialized.BlobBaseClient.DownloadStreamingInternal(HttpRange range, BlobRequestConditions conditions, Boolean rangeGetContentHash, IProgress`1 progressHandler, String operationName, Boolean async, CancellationToken cancellationToken)
at Azure.Storage.Blobs.Specialized.BlobBaseClient.DownloadStreaming(HttpRange range, BlobRequestConditions conditions, Boolean rangeGetContentHash, IProgress`1 progressHandler, CancellationToken cancellationToken)
at Azure.Storage.Blobs.PartitionedDownloader.DownloadTo(Stream destination, BlobRequestConditions conditions, CancellationToken cancellationToken)
at Azure.Storage.Blobs.Specialized.BlobBaseClient.StagedDownloadAsync(Stream destination, BlobRequestConditions conditions, IProgress`1 progressHandler, StorageTransferOptions transferOptions, Boolean async, CancellationToken cancellationToken)
at Azure.Core.Pipeline.TaskExtensions.EnsureCompleted[T](Task`1 task)
at Azure.Storage.Blobs.Specialized.BlobBaseClient.DownloadTo(String path, BlobRequestConditions conditions, StorageTransferOptions transferOptions, CancellationToken cancellationToken)
at Azure.Storage.Blobs.Specialized.BlobBaseClient.DownloadTo(String path, CancellationToken cancellationToken)
at Azure.Storage.Blobs.Specialized.BlobBaseClient.DownloadTo(String path)

How to fix RemoteJSDataStream NullReferenceException?

I get an error while uploading files as StreamContent in parallel from .NET 6 / Blazor Server-Side to API via HttpClient. Here is the stripped down code and the full text of the error:
P.S. The RemoteJSRuntime that is passed to Microsoft.AspNetCore.Components.Server.Circuits.RemoteJSDataStream.ReceiveData by the framework is NULL, so an error is thrown. However, I don't understand why NULL is passed. I cannot catch it, extinguish it, somehow influence it.
P.S.S. It is not related to ApiClient, it works fine. The error only occurs on startup after the first page load, oddly enough, after reloading the page and starting again, everything works.
Source code:
https://github.com/abberdeen/BlazorServer.ParallelFileUpload
Related issue:
https://github.com/dotnet/aspnetcore/issues/38854
public void AddFilesToUploadQueue(List<FileUploadDto> files)
{
foreach (var item in files)
{
fileUploadQueue.Enqueue(item);
}
for (int i = 0; i < files.Count; i++)
{
Task t = factory.StartNew(() => UploadOne());
tasks.Add(t);
}
}
private async Task UploadOne()
{
semaphore.WaitOne();
FileUploadDto item;
if (!fileUploadQueue.TryDequeue(out item))
{
return;
}
// Make HttpRequest
await UploadFileAsync(item);
semaphore.Release();
}
blazor.server.js:1 [2021-12-06T19:07:53.123Z] Error: System.NullReferenceException: Object reference not set to an instance of an object.
at Microsoft.AspNetCore.Components.Server.Circuits.RemoteJSDataStream.ReceiveData(RemoteJSRuntime runtime, Int64 streamId, Int64 chunkId, Byte[] chunk, String error)
at Microsoft.AspNetCore.Components.Rendering.RendererSynchronizationContext.<>c__11`1.<<InvokeAsync>b__11_0>d.MoveNext()
--- End of stack trace from previous location ---
at Microsoft.AspNetCore.Components.Server.Circuits.CircuitHost.ReceiveJSDataChunk(Int64 streamId, Int64 chunkId, Byte[] chunk, String error)
Errors in the output window:
System.TimeoutException: Did not receive any data in the allotted time.
at System.IO.Pipelines.Pipe.GetReadResult(ReadResult& result)
at System.IO.Pipelines.Pipe.GetReadAsyncResult()
at System.IO.Pipelines.PipeReaderStream.ReadAsyncInternal(Memory`1 buffer, CancellationToken cancellationToken)
at Microsoft.AspNetCore.Components.Server.Circuits.RemoteJSDataStream.ReadAsync(Memory`1 buffer, CancellationToken cancellationToken)
at Microsoft.AspNetCore.Components.Forms.BrowserFileStream.CopyFileDataIntoBuffer(Int64 sourceOffset, Memory`1 destination, CancellationToken cancellationToken)
at Microsoft.AspNetCore.Components.Forms.BrowserFileStream.ReadAsync(Memory`1 buffer, CancellationToken cancellationToken)
at System.IO.Stream.<CopyToAsync>g__Core|29_0(Stream source, Stream destination, Int32 bufferSize, CancellationToken cancellationToken)
at System.Net.Http.StreamToStreamCopy.<CopyAsync>g__DisposeSourceAsync|1_0(Task copyTask, Stream source)
at System.Net.Http.HttpContent.<CopyToAsync>g__WaitAsync|56_0(ValueTask copyTask)
at System.Net.Http.MultipartContent.SerializeToStreamAsyncCore(Stream stream, TransportContext context, CancellationToken cancellationToken)
at System.Net.Http.HttpContent.<CopyToAsync>g__WaitAsync|56_0(ValueTask copyTask)
at System.Net.Http.HttpContent.<CopyToAsync>g__WaitAsync|56_0(ValueTask copyTask)
at System.Net.Http.HttpConnection.SendRequestContentAsync(HttpRequestMessage request, HttpContentWriteStream stream, Boolean async, CancellationToken cancellationToken)
at System.Net.Http.HttpConnection.SendAsyncCore(HttpRequestMessage request, Boolean async, CancellationToken cancellationToken)
at System.Net.Http.HttpConnection.SendAsyncCore(HttpRequestMessage request, Boolean async, CancellationToken cancellationToken)
at System.Net.Http.HttpConnectionPool.SendWithVersionDetectionAndRetryAsync(HttpRequestMessage request, Boolean async, Boolean doRequestAuth, CancellationToken cancellationToken)
at System.Net.Http.DiagnosticsHandler.SendAsyncCore(HttpRequestMessage request, Boolean async, CancellationToken cancellationToken)
at System.Net.Http.RedirectHandler.SendAsync(HttpRequestMessage request, Boolean async, CancellationToken cancellationToken)
at ~~~~~BlazorApp.Services.AuthHttpClientHandler.SendAsync(HttpRequestMessage request, CancellationToken cancellationToken) in ~~~~~BlazorApp\Services\AuthHttpClientHandler.cs:line 27
at System.Net.Http.Handlers.ProgressMessageHandler.SendAsync(HttpRequestMessage request, CancellationToken cancellationToken)
at System.Net.Http.HttpClient.<SendAsync>g__Core|83_0(HttpRequestMessage request, HttpCompletionOption completionOption, CancellationTokenSource cts, Boolean disposeCts, CancellationTokenSource pendingRequestsCts, CancellationToken originalCancellationToken)
at ~~~~~BlazorApp.Services.FileUploadApiService.PostAndReportProgress(String url, MultipartFormDataContent formData, String guid, EventHandler`1 progressHandler, CancellationToken cancellationToken) in ~~~~~BlazorApp\Services\FileUploadApiService.cs:line 106
--- End of inner exception stack trace ---
at ~~~~~BlazorApp.Services.FileUploadApiService.PostAndReportProgress(String url, MultipartFormDataContent formData, String guid, EventHandler`1 progressHandler, CancellationToken cancellationToken) in ~~~~~BlazorApp\Services\FileUploadApiService.cs:line 122
at ~~~~~BlazorApp.Services.FileUploadApiService.ChatUploadFileAsync(StreamContent file, Int32 chatId, String guid, EventHandler`1 progressHandler, CancellationToken cancellationToken) in ~~~~~BlazorApp\Services\FileUploadApiService.cs:line 59
at ~~~~~BlazorApp.Services.FileUploadManager.UploadFileAsync(FileUploadDto item) in ~~~~~BlazorApp\Services\FileUploadManager.cs:line 171
at ~~~~~BlazorApp.Services.FileUploadManager.<StartUploadTask>b__18_0() in ~~~~~BlazorApp\Services\FileUploadManager.cs:line 108
Thanks for the sample. I was able to reproduce the System.TimeoutException.
I am unable to reproduce the error with this code (FileUploadManager changes only). Can you try this?
public async void AddFilesToUploadQueue(IReadOnlyList<IBrowserFile> files)
{
lock (fileUploadQueue)
{
foreach (var item in files)
{
fileUploadQueue.Enqueue(item);
}
}
for (int i = 0; i < files.Count; i++)
{
IBrowserFile? file = null;
lock(fileUploadQueue)
{
fileUploadQueue.TryDequeue(out file);
}
tasks.Add(UploadOneFile(file));
}
//await Task.WhenAll(tasks);
}
protected async Task UploadOneFile(IBrowserFile file)
{
await semaphoreSlim.WaitAsync();
try
{
using (var readStream = file.OpenReadStream(int.MaxValue))
{
var streamContent = fileUploadService.CreateStreamContent(readStream, file.Name, file.ContentType);
var result = await fileUploadService.UploadFileAsync(streamContent);
}
}
finally
{
semaphoreSlim.Release();
}
}

Microsoft.Data.SqlClient.SqlException (0x80131904): Incorrect syntax near ','

I believe this may be a syntax error, but I cannot find it.
This is the full error:
Microsoft.Data.SqlClient.SqlException (0x80131904): Incorrect syntax
near ','. at
Microsoft.Data.SqlClient.SqlCommand.<>c.b__164_0(Task1
result) at
System.Threading.Tasks.ContinuationResultTaskFromResultTask2.InnerInvoke()
at System.Threading.Tasks.Task.<>c.<.cctor>b__274_0(Object obj) at
System.Threading.ExecutionContext.RunInternal(ExecutionContext
executionContext, ContextCallback callback, Object state)
--- End of stack trace from previous location where exception was thrown --- at
System.Threading.Tasks.Task.ExecuteWithThreadLocal(Task&
currentTaskSlot, Thread threadPoolThread)
--- End of stack trace from previous location where exception was thrown --- at
Microsoft.EntityFrameworkCore.Storage.RelationalCommand.ExecuteReaderAsync(RelationalCommandParameterObject
parameterObject, CancellationToken cancellationToken) at
Microsoft.EntityFrameworkCore.Storage.RelationalCommand.ExecuteReaderAsync(RelationalCommandParameterObject
parameterObject, CancellationToken cancellationToken) at
Microsoft.EntityFrameworkCore.Storage.RelationalCommand.ExecuteReaderAsync(RelationalCommandParameterObject
parameterObject, CancellationToken cancellationToken) at
Microsoft.EntityFrameworkCore.Query.Internal.QueryingEnumerable1.AsyncEnumerator.InitializeReaderAsync(DbContext
_, Boolean result, CancellationToken cancellationToken) at Microsoft.EntityFrameworkCore.SqlServer.Storage.Internal.SqlServerExecutionStrategy.ExecuteAsync[TState,TResult](TState
state, Func4 operation, Func4 verifySucceeded, CancellationToken
cancellationToken) at
Microsoft.EntityFrameworkCore.Query.Internal.QueryingEnumerable1.AsyncEnumerator.MoveNextAsync()
at
Microsoft.EntityFrameworkCore.EntityFrameworkQueryableExtensions.ToListAsync[TSource](IQueryable1
source, CancellationToken cancellationToken) at
Microsoft.EntityFrameworkCore.EntityFrameworkQueryableExtensions.ToListAsync[TSource](IQueryable1
source, CancellationToken cancellationToken) at
FincredixAppBigBrotherWebApi.Application.Sucursales.Queries.GetAllSucursales.GetAllSucursalesHandler.Handle(GetAllSucursalesQuery
request, CancellationToken cancellationToken) in
C:\Users\alozano\source\repos\FincredixAppBigBrotherWebApi\FincredixAppBigBrotherWebApi.Application\Sucursales\Queries\GetAllSucursales\GetAllSucursalesHandler.cs:line
28 at
MediatR.Pipeline.RequestPreProcessorBehavior2.Handle(TRequest
request, CancellationToken cancellationToken, RequestHandlerDelegate1
next) at
MediatR.Pipeline.RequestPostProcessorBehavior2.Handle(TRequest
request, CancellationToken cancellationToken, RequestHandlerDelegate1
next) at
MediatR.Pipeline.RequestPreProcessorBehavior2.Handle(TRequest
request, CancellationToken cancellationToken, RequestHandlerDelegate1
next) at
MediatR.Pipeline.RequestPostProcessorBehavior2.Handle(TRequest
request, CancellationToken cancellationToken, RequestHandlerDelegate1
next) at
MediatR.Pipeline.RequestPreProcessorBehavior2.Handle(TRequest
request, CancellationToken cancellationToken, RequestHandlerDelegate1
next) at
MediatR.Pipeline.RequestPostProcessorBehavior2.Handle(TRequest
request, CancellationToken cancellationToken, RequestHandlerDelegate1
next) at
MediatR.Pipeline.RequestPreProcessorBehavior2.Handle(TRequest
request, CancellationToken cancellationToken, RequestHandlerDelegate1
next) at
FincredixAppBigBrotherWebApi.WebApi.Controllers.SucursalController.GetAll(Int32
claSucursal, Int32 claSucursalPadre, Int32 bajaLogica, String
descripcion) in
C:\Users\alozano\source\repos\FincredixAppBigBrotherWebApi\FincredixAppBigBrotherWebApi.WebApi\Controllers\SucursalController.cs:line
19 at lambda_method(Closure , Object ) at
Microsoft.Extensions.Internal.ObjectMethodExecutorAwaitable.Awaiter.GetResult()
at
Microsoft.AspNetCore.Mvc.Infrastructure.ActionMethodExecutor.AwaitableObjectResultExecutor.Execute(IActionResultTypeMapper
mapper, ObjectMethodExecutor executor, Object controller, Object[]
arguments) at
Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.g__Awaited|12_0(ControllerActionInvoker
invoker, ValueTask`1 actionResultValueTask) at
Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.g__Awaited|10_0(ControllerActionInvoker
invoker, Task lastTask, State next, Scope scope, Object state, Boolean
isCompleted) at
Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.Rethrow(ActionExecutedContextSealed
context) at
Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.Next(State&
next, Scope& scope, Object& state, Boolean& isCompleted) at
Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.g__Awaited|13_0(ControllerActionInvoker
invoker, Task lastTask, State next, Scope scope, Object state, Boolean
isCompleted) at
Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.g__Awaited|19_0(ResourceInvoker
invoker, Task lastTask, State next, Scope scope, Object state, Boolean
isCompleted) at
Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.g__Awaited|17_0(ResourceInvoker
invoker, Task task, IDisposable scope) at
Microsoft.AspNetCore.Routing.EndpointMiddleware.g__AwaitRequestTask|6_0(Endpoint
endpoint, Task requestTask, ILogger logger) at
Microsoft.AspNetCore.Authorization.AuthorizationMiddleware.Invoke(HttpContext
context) at
Microsoft.AspNetCore.Diagnostics.DeveloperExceptionPageMiddleware.Invoke(HttpContext
context) ClientConnectionId:25b62d0a-cacd-4e27-aa37-90c4cd002382 Error
Number:102,State:1,Class:15
HEADERS
======= Cache-Control: no-cache Connection: keep-alive Accept: / Accept-Encoding: gzip, deflate, br Host: localhost:5001 User-Agent:
PostmanRuntime/7.22.0 Postman-Token:
bdd4ae12-be9d-4d55-9753-36f00ca7029c
This is the line of code I suspect
at
FincredixAppBigBrotherWebApi.Application.Sucursales.Queries.GetAllSucursales.GetAllSucursalesHandler.Handle(GetAllSucursalesQuery
request, CancellationToken cancellationToken) in
C:\Users\alozano\source\repos\FincredixAppBigBrotherWebApi\FincredixAppBigBrotherWebApi.Application\Sucursales\Queries\GetAllSucursales\GetAllSucursalesHandler.cs:line
28
And this is the line 28:
public async Task<List<SucursalViewModel>> Handle(GetAllSucursalesQuery request, CancellationToken cancellationToken)
{
var response = this._mapper.Map<List<SucursalViewModel>>(await this._fincredixAppDbContext.SpAppFcxSucursalSel.FromSqlRaw(
$#"{SpConstants.SpAppFcxSucursalSel}
#pnClaSucursal = { request.ClaSucursal },
#psDescripcion = { request.Descripcion },
#pnClaSucursalPadre = { request.ClaSucursalPadre },
#pnIncBajaLogica = { request.BajaLogica }")
.AsNoTracking().ToListAsync(cancellationToken));
return response;
}
I have already seen many questions very similar to this one but the Incorrect syntaxes are '?' or ')' or 'from' or '/' etc. Mine is ','
Shouldn't it be:
$#"{SpConstants.SpAppFcxSucursalSel}
#pnClaSucursal = '{request.ClaSucursal}',
#psDescripcion = '{request.Descripcion}',
#pnClaSucursalPadre = '{request.ClaSucursalPadre}',
#pnIncBajaLogica = '{request.BajaLogica}'")

Bot Framework Skill - Invalid status code Unauthorized - reference to local path in stack trace

I've been struggling to deploy a virtual assistant template bot and calendar skill for a while now. My progress is stalled here. I'm running the emulator against the Virtual Assistant deployed to Azure. The skill is also in Azure. The error is as follows:
Calendar Skill Error: Operation returned an invalid status code 'Unauthorized' | at Microsoft.Azure.CognitiveServices.Language.LUIS.Runtime.Prediction.ResolveWithHttpMessagesAsync(String appId, String query, Nullable`1 timezoneOffset, Nullable`1 verbose, Nullable`1 staging, Nullable`1 spellCheck, String bingSpellCheckSubscriptionKey, Nullable`1 log, Dictionary`2 customHeaders, CancellationToken cancellationToken)
at Microsoft.Azure.CognitiveServices.Language.LUIS.Runtime.PredictionExtensions.ResolveAsync(IPrediction operations, String appId, String query, Nullable`1 timezoneOffset, Nullable`1 verbose, Nullable`1 staging, Nullable`1 spellCheck, String bingSpellCheckSubscriptionKey, Nullable`1 log, CancellationToken cancellationToken)
at Microsoft.Bot.Builder.AI.Luis.LuisRecognizer.RecognizeInternalAsync(ITurnContext turnContext, Dictionary`2 telemetryProperties, Dictionary`2 telemetryMetrics, CancellationToken cancellationToken)
at Microsoft.Bot.Builder.AI.Luis.LuisRecognizer.RecognizeAsync[T](ITurnContext turnContext, CancellationToken cancellationToken)
at CalendarSkill.Dialogs.MainDialog.OnInterruptDialogAsync(DialogContext dc, CancellationToken cancellationToken) in C:\Users\MyName\Desktop\GitHub\botframework-solutions\skills\src\csharp\calendarskill\calendarskill\Dialogs\MainDialog.cs:line 262
at Microsoft.Bot.Builder.Solutions.Dialogs.RouterDialog.OnContinueDialogAsync(DialogContext innerDc, CancellationToken cancellationToken)
at Microsoft.Bot.Builder.Dialogs.ComponentDialog.BeginDialogAsync(DialogContext outerDc, Object options, CancellationToken cancellationToken)
at Microsoft.Bot.Builder.Dialogs.DialogContext.BeginDialogAsync(String dialogId, Object options, CancellationToken cancellationToken)
at CalendarSkill.Bots.DialogBot`1.OnTurnAsync(ITurnContext turnContext, CancellationToken cancellationToken) in C:\Users\MyName\Desktop\GitHub\botframework-solutions\skills\src\csharp\calendarskill\calendarskill\Bots\DialogBot.cs:line 47
at Microsoft.Bot.Builder.Skills.SkillMiddleware.OnTurnAsync(ITurnContext turnContext, NextDelegate next, CancellationToken cancellationToken)
at Microsoft.Bot.Builder.AutoSaveStateMiddleware.OnTurnAsync(ITurnContext turnContext, NextDelegate next, CancellationToken cancellationToken)
at Microsoft.Bot.Builder.Solutions.Middleware.EventDebuggerMiddleware.OnTurnAsync(ITurnContext turnContext, NextDelegate next, CancellationToken cancellationToken)
at Microsoft.Bot.Builder.Solutions.Middleware.SetLocaleMiddleware.OnTurnAsync(ITurnContext context, NextDelegate next, CancellationToken cancellationToken)
at Microsoft.Bot.Builder.TelemetryLoggerMiddleware.OnTurnAsync(ITurnContext context, NextDelegate nextTurn, CancellationToken cancellationToken)
at Microsoft.Bot.Builder.TranscriptLoggerMiddleware.OnTurnAsync(ITurnContext turnContext, NextDelegate nextTurn, CancellationToken cancellationToken)
at Microsoft.Bot.Builder.MiddlewareSet.ReceiveActivityWithStatusAsync(ITurnContext turnContext, BotCallbackHandler callback, CancellationToken cancellationToken)
at Microsoft.Bot.Builder.BotAdapter.RunPipelineAsync(ITurnContext turnContext, BotCallbackHandler callback, CancellationToken cancellationToken)
Since I see references to the skill's location on my disk I assume I'm doing the using the botskill connect tool incorrectly. This is how I'm invoked it. botskills connect --botName SomeBotName --remoteManifest "http://MyCalendarSkill.azurewebsites.net/api/skill/manifest" --luisFolder "C:\Users\MyName\Desktop\GitHub\botframework-solutions\skills\src\csharp\calendarskill\calendarskill\Deployment\Resources\LU\en\" --cs
Should I point the luisFolder parameter at the same path in Azure? Am I doing something else wrong?

LUIS recognizer method stopped working (Code hasn't been changed)

I didn't change any of my code and the method throws an LUIS.Runtime.Models.APIErrorException
_services.LuisServices[LuisConfiguration].RecognizeAsync(turnContext, cancellationToken);
I tried to use a different LUIS model and an old version of my bot that definately worked. It seems like something was changed in the BotBuilder and I can't figure out what. This is the stacktrace:
Exception caught : Microsoft.Azure.CognitiveServices.Language.LUIS.Runtime.Models.APIErrorException: Operation returned an invalid status code 'Forbidden'
at Microsoft.Azure.CognitiveServices.Language.LUIS.Runtime.Prediction.ResolveWithHttpMessagesAsync(String appId, String query,
Nullable`1 timezoneOffset, Nullable`1 verbose,
Nullable`1 staging, Nullable`1 spellCheck, String bingSpellCheckSubscriptionKey,
Nullable`1 log, Dictionary`2 customHeaders, CancellationToken cancellationToken)
at Microsoft.Azure.CognitiveServices.Language.LUIS.Runtime.PredictionExtensions.ResolveAsync(IPrediction operations, String appId, String query,
Nullable`1 timezoneOffset, Nullable`1 verbose,
Nullable`1 staging,
Nullable`1 spellCheck,
String bingSpellCheckSubscriptionKey, Nullable`1 log, CancellationToken cancellationToken)
at Microsoft.Bot.Builder.AI.Luis.LuisRecognizer
.RecognizeInternalAsync(ITurnContext turnContext, CancellationToken cancellationToken) in D:\a\1\s\libraries\Microsoft.Bot.Builder.AI.LUIS
\LuisRecognizer.cs:line 421
at Microsoft.Bot.Builder.AI.Luis.LuisRecognizer
.RecognizeAsync(ITurnContext turnContext, CancellationToken cancellationToken) in D:\a\1\s\libraries\Microsoft.Bot.Builder.AI.LUIS
\LuisRecognizer.cs:line 112
at NLPMortBot.BasicBot.OnTurnAsync(ITurnContext turnContext, CancellationToken cancellationToken) in nlpmortbot\NLPMortBot\BasicBot.cs:line 121
at Microsoft.Bot.Builder.MiddlewareSet.ReceiveActivityWithStatusAsync(ITurnContext turnContext, BotCallbackHandler callback,
CancellationToken cancellationToken) in D:\a\1\s\libraries\Microsoft.Bot.Builder\MiddlewareSet.cs:line 55
at Microsoft.Bot.Builder.BotAdapter.RunPipelineAsync(ITurnContext turnContext, BotCallbackHandler callback,
CancellationToken cancellationToken) in D:\a\1\s\libraries\Microsoft.Bot.Builder\BotAdapter.cs:line 167
Thanks in advance guys !
This can happen if you are using the Starter Key instead of an actual Subscription Key from an 'endpoint runtime resource in Azure'. More information can be found here: https://learn.microsoft.com/en-us/azure/cognitive-services/luis/luis-how-to-azure-subscription
After creating the LUIS Azure Resource Key, it can be assigned within the LUIS Portal:
More information can be found here: https://learn.microsoft.com/en-us/azure/cognitive-services/luis/get-started-portal-deploy-app#assign-the-resource-key-to-the-luis-app-in-the-luis-portal

Categories

Resources