1

I am trying to create an Azure bot using Azure Rest API.

I am hitting this API (PUT Request) via the code by replacing the subscription id, resource group name

https://management.azure.com/subscriptions/{subscription id}/resourceGroups/{resourcegroupId}
/providers/Microsoft.BotService/botServices/{botName}?api-version=2018-07-12

Request body as follows

{"location":"global","properties":{"displayName":"{botName}","description":"{botName}","iconUrl":"https://docs.botframework.com/static/devportal/client/images/bot-framework-default.png","endpoint":"{endPoint}","msaAppId":"{app ID}"}}

However I am getting the error as

{
    "error": {
        "code": "InvalidBotData",
        "message": "Bot is not valid. Errors: RuntimeVersion is required.  See https://aka.ms/bot-requirements for detailed requirements."
    }
}

I tried using nodejs (arm-botservice SDK) to create the bot using the same parameters (of course changing the parameters according to our azure portal ids) but I am still getting the same error. I guess internally it will call the same API as above.

Any help would be appreciated to resolve this issue.

1

3 Answers 3

1

Finally, I was able to do it.

I added the kind parameter and then it worked.

Following is the request

{"location":"global",kind="registration","properties":{"displayName":"{botName}","description":"{botName}","iconUrl":"https://docs.botframework.com/static/devportal/client/images/bot-framework-default.png","endpoint":"{endPoint}","msaAppId":"{app ID}"}}
Sign up to request clarification or add additional context in comments.

Comments

0

Programmatic bot creation can not be done with REST at this time.

How to create Web App bot in azure using programmatically?

Use az cli as @joey-cai mentioned.

Comments

0

To create a Microsoft.BotService/botServices/channels resource, add the following JSON to the resources section of your template.

{
"name": "string",
"type": "Microsoft.BotService/botServices/channels",
"apiVersion": "2018-07-12",
"location": "string",
"tags": {},
"sku": {
"name": "string"
},
"kind": "string",
"properties": {
"channelName": "string"
 }
}

Source : https://learn.microsoft.com/en-us/azure/templates/microsoft.botservice/2018-07-12/botservices/channels

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.