Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
838 views
in Technique[技术] by (71.8m points)

botframework - Can't deploy Asp.Net Core SDK 4 BOT using CLI instructions

The BOT works, but I can't deploy it to Azure using the CLI instructions here.

https://docs.microsoft.com/en-us/azure/bot-service/bot-builder-deploy-az-cli?view=azure-bot-service-4.0&tabs=csharp#option-1-existing-app-service-plan

Here are my relevant CLI commands.

az bot prepare-deploy --lang Csharp --code-dir "./Source/Repos/MyBot.Bot/MyBot.Bot" --proj-file-path "C:Users<username>SourceReposMyBot.BotMyBot.BotMyBot.Bot.csproj"

az webapp deployment source config-zip --resource-group "BOTQnARG" --name "MYBOTAPP" --src "C:Users<username>SourceReposMyBot.BotMyBot.BotData.zip" --timeout 3600

When I include a .deployment file in the Bots root directory zip file, I get this error message in Deployment Center (Preview) for the App Service. I also get a Zip Deployment Failed message in the Command Prompt window.

Using the following command to generate deployment script: 'azure site deploymentscript -y --no-dot-deployment -r "D:localTempzipdeployextracted" -o "D:homesitedeploymentsools" --aspNetCore "C:Users<username>SourceReposMyBotMyBotMyBot.csproj"'. D:Program Files (x86)SiteExtensionsKudu91.21119.4922in ode_moduleskuduscriptlibgenerator.js:90 throw new Error("The project file path should be a sub-directory of the repository root"); } ; ^

Error: The project file path should be a sub-directory of the repository root

Here is a sample of what my root directory for the BOT looks like.

enter image description here

BEG UPDATE 1

I removed the . in the Project name and folders, but it still didn't work.

Here is my .deployment file.

[config]
SCM_SCRIPT_GENERATOR_ARGS=--aspNetCore "C:Users<username>SourceReposMyBotMyBotMyBot.csproj"

END UPDATE 1

Any idea what's happening and how to work around this?

question from:https://stackoverflow.com/questions/65889979/cant-deploy-asp-net-core-sdk-4-bot-using-cli-instructions

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)

I finally got it to work. The .deployment file should look like this. I used Notepad++ to edit it.

[config]
SCM_SCRIPT_GENERATOR_ARGS=--aspNetCore "MyBot.csproj"

When you run the following command, it adds unnecessary information to the file.

az bot prepare-deploy --lang Csharp --code-dir "./Source/Repos/MyBot/MyBot" --proj-file-path "C:Users<username>SourceReposMyBotMyBotMyBot.csproj"

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...