I'm trying to create a Microsoft Teams bot that can be called. Especially, we plan to use it as a destination for incoming calls on a Call Queue.
It seems that the call buttons
we usually get with contacts are nowhere to be seen on this bot:
So far, I have managed to create a bot according to the samples.
In https://dev.botframework.com/, the bot appears and I have the Enable Calling flag set (which - interestingly, seems to get disabled almost every time I run the project in Visual Studio).
My permissions.json looks like this:
[
{
"resource": "Microsoft Graph",
"delegated": [
"User.Read"
],
"application": [
"Calls.Initiate.All",
"Calls.InitiateGroupCall.All",
"Calls.JoinGroupCall.All",
"Calls.AccessMedia.All"
]
}
]
My manifest.template.json looks like this:
{
"$schema": "https://developer.microsoft.com/en-us/json-schemas/teams/v1.13/MicrosoftTeams.schema.json",
"manifestVersion": "1.13",
"version": "1.0.0",
"id": "{{state.fx-resource-appstudio.teamsAppId}}",
"packageName": "com.microsoft.teams.extension",
"developer": {
"name": "Teams App, Inc.",
"websiteUrl": "{{state.fx-resource-frontend-hosting.endpoint}}",
"privacyUrl": "{{state.fx-resource-frontend-hosting.endpoint}}{{state.fx-resource-frontend-hosting.indexPath}}/privacy",
"termsOfUseUrl": "{{state.fx-resource-frontend-hosting.endpoint}}{{state.fx-resource-frontend-hosting.indexPath}}/termsofuse"
},
"icons": {
"color": "resources/color.png",
"outline": "resources/outline.png"
},
"name": {
"short": "{{config.manifest.appName.short}}",
"full": "{{config.manifest.appName.full}}"
},
"description": {
"short": "Short description of {{config.manifest.appName.short}}",
"full": "Full description of {{config.manifest.appName.short}}"
},
"accentColor": "#FFFFFF",
"bots": [
{
"botId": "{{state.fx-resource-bot.botId}}",
"scopes": [
"personal",
"team",
"groupchat"
],
"supportsFiles": false,
"supportsCalling": true,
"supportsVideo": true,
"isNotificationOnly": false
}
],
"composeExtensions": [],
"configurableTabs": [],
"staticTabs": [],
"permissions": [
"identity",
"messageTeamMembers"
],
"validDomains": [],
"webApplicationInfo": {
"id": "{{state.fx-resource-aad-app-for-teams.clientId}}",
"resource": "{{state.fx-resource-aad-app-for-teams.applicationIdUris}}"
}
}
I also believe to have configured the correct permissions on the App Registration in Azure:
Any idea where to look next? What do I need to do to make the bot directly callable as I would be able to with any other user?
Related
I've been trying to create a template for a logger function app in Azure, the basic idea is that it'll forward all activity log category info along with all audit log info using event hubs as triggers, I've gotten down most of the template, but I keep hitting the following error when it comes to the diagnostic settings part:
The resource type '/' does not support diagnostic settings.
Is there something I'm doing wrong? I've only started working with azure for a short while, and am afraid I'm misunderstanding how diagnostic settings are created in an ARM template. I can't seem to find any template or documentation online about this, and am at a loss...
Here's an excerpt:
...
"variables": {
"eventHubNamespaceName": "azure-logger",
"auditEventHubName": "[concat(variables('eventHubNamespaceName'), '/', 'audit-logs')]",
"activityEventHubName": "[concat(variables('eventHubNamespaceName'), '/', 'activity-logs')]",
"authRuleResourceId": "[resourceId('Microsoft.Eventhub/namespaces/authorizationRules', variables('eventHubNamespaceName'), 'RootManageSharedAccessKey')]",
"auditAuthorizationRuleId": "[resourceId('Microsoft.EventHub/namespaces/eventhubs/authorizationRules', variables('eventHubNamespaceName') , 'audit-logs', 'default')]",
"activityAuthorizationRuleId": "[resourceId('Microsoft.EventHub/namespaces/eventhubs/authorizationRules', variables('eventHubNamespaceName') , 'activity-logs', 'default')]"
},
"resources": [
{
"name": "[variables('eventHubNamespaceName')]",
"type": "Microsoft.EventHub/namespaces",
"apiVersion": "2021-06-01-preview",
"location": "[parameters('location')]",
"sku": {
"name": "Standard"
},
"identity": {
"type": "SystemAssigned"
},
"properties": {
"status": "Active"
},
"resources": [
{
"type": "Microsoft.EventHub/namespaces/eventhubs",
"apiVersion": "2021-06-01-preview",
"name": "[concat(variables('eventHubNamespaceName'), '/', 'audit-logs')]",
"location": "[parameters('location')]",
"dependsOn": [
"[resourceId('Microsoft.EventHub/namespaces', variables('eventHubNamespaceName'))]"
],
"properties": {
"messageRetentionInDays": 1,
"partitionCount": 1
},
"resources": [
{
"type": "Microsoft.EventHub/namespaces/eventhubs/authorizationRules",
"apiVersion": "2021-06-01-preview",
"name": "[concat(variables('eventHubNamespaceName'), '/', 'audit-logs','/','default')]",
"properties": {
"rights": [ "Manage", "Listen", "Send" ]
},
"dependsOn": [
"[resourceId('Microsoft.EventHub/namespaces/eventhubs', variables('eventHubNamespaceName'), 'audit-logs')]"
]
}
]
},
{
"type": "Microsoft.EventHub/namespaces/eventhubs",
"apiVersion": "2021-06-01-preview",
"name": "[concat(variables('eventHubNamespaceName'), '/', 'activity-logs')]",
"location": "[parameters('location')]",
"dependsOn": [
"[resourceId('Microsoft.EventHub/namespaces', variables('eventHubNamespaceName'))]"
],
"properties": {
"messageRetentionInDays": 1,
"partitionCount": 1
},
"resources": [
{
"type": "Microsoft.EventHub/namespaces/eventhubs/authorizationRules",
"apiVersion": "2021-06-01-preview",
"name": "[concat(variables('eventHubNamespaceName'), '/', 'activity-logs','/','default')]",
"properties": {
"rights": [ "Manage", "Listen", "Send" ]
},
"dependsOn": [
"[resourceId('Microsoft.EventHub/namespaces/eventhubs', variables('eventHubNamespaceName'), 'activity-logs')]"
]
}
]
}
]
},
{
"type": "Microsoft.Insights/diagnosticSettings",
"apiVersion": "2017-05-01-preview",
"name": "[concat(variables('eventHubNamespaceName'),'activity-logs')]",
"properties": {
"eventHubName": "activity-logs",
"eventHubAuthorizationRuleId": "[variables('activityAuthorizationRuleId')]",
"logs": [
{
"category": "Administrative",
"enabled": true
},
{
"category": "Security",
"enabled": true
},
{
"category": "ServiceHealth",
"enabled": true
},
{
"category": "Alert",
"enabled": true
},
{
"category": "Recommendation",
"enabled": true
},
{
"category": "Policy",
"enabled": true
},
{
"category": "Autoscale",
"enabled": true
},
{
"category": "ResourceHealth",
"enabled": true
}
]
}
}
]
...```
Diagnostic settings for Activity logs are created for a subscription, not for a resource group like settings for Azure resources. Therefore, when you check the Diagnostic setting for Activity log in this document, you will find that you can deploy Azure Resource Manager templates using any valid method including PowerShell and CLI. Diagnostic settings for Activity log must deploy to a subscription using az deployment create for CLI or New-AzDeployment for PowerShell.
And the template should look like as following :
{
"$schema": "https://schema.management.azure.com/schemas/2018-05-01/subscriptionDeploymentTemplate.json#",
"contentVersion": "1.0.0.0",
"parameters": {
"settingName": {
"type": "String"
},
"workspaceId": {
"type": "String"
},
"storageAccountId": {
"type": "String"
},
"eventHubAuthorizationRuleId": {
"type": "String"
},
"eventHubName": {
"type": "String"
}
},
"resources": [
{
"type": "Microsoft.Insights/diagnosticSettings",
"apiVersion": "2017-05-01-preview",
"name": "[parameters('settingName')]",
"properties": {
"workspaceId": "[parameters('workspaceId')]",
"storageAccountId": "[parameters('storageAccountId')]",
"eventHubAuthorizationRuleId": "[parameters('eventHubAuthorizationRuleId')]",
"eventHubName": "[parameters('eventHubName')]",
"logs": [
{
"category": "Administrative",
"enabled": true
},
{
"category": "Security",
"enabled": true
},
{
"category": "ServiceHealth",
"enabled": true
},
{
"category": "Alert",
"enabled": true
},
{
"category": "Recommendation",
"enabled": true
},
{
"category": "Policy",
"enabled": true
},
{
"category": "Autoscale",
"enabled": true
},
{
"category": "ResourceHealth",
"enabled": true
}
]
}
}
]
}
You should have a Parameter file if you follow the above template.
Also note that when virtual networks are enabled Diagnostic Settings can't access Event Hubs resources. You have to enable the Allow trusted Microsoft services to bypass this firewall setting in Event Hub, so that Diagnostic Settings (Azure Monitor Services) is granted access to your Event Hubs resources.
as in title, I am trying to use Google API Explorer to run vm instance. I am using instances.insert for this, but I can't get it to work. After successfuly executing the call I can not see any newly creted vm instance in https://console.cloud.google.com/compute/instances
The request I am trying to execute is copied from Equivalent REST request in Google Cloud Console Create an instance web page :
{
"name": "some-name",
"machineType": "projects/my-project-id/zones/europe-west3-c/machineTypes/f1-micro",
"displayDevice": {
"enableDisplay": false
},
"metadata": {
"items": [
{
"key": "startup-script",
"value": "#! /bin/bash\necho hello\nEOF"
}
]
},
"tags": {
"items": []
},
"disks": [
{
"type": "PERSISTENT",
"boot": true,
"mode": "READ_WRITE",
"autoDelete": true,
"deviceName": "some-name",
"initializeParams": {
"sourceImage": "projects/debian-cloud/global/images/debian-10-buster-v20200910",
"diskType": "projects/my-project-id/zones/europe-west3-c/diskTypes/pd-standard",
"diskSizeGb": "10",
"labels": {}
},
"diskEncryptionKey": {}
}
],
"canIpForward": false,
"networkInterfaces": [
{
"subnetwork": "projects/my-project-id/regions/europe-west3/subnetworks/default",
"accessConfigs": [
{
"name": "External NAT",
"type": "ONE_TO_ONE_NAT",
"networkTier": "PREMIUM"
}
],
"aliasIpRanges": []
}
],
"description": "",
"labels": {},
"scheduling": {
"preemptible": false,
"onHostMaintenance": "MIGRATE",
"automaticRestart": true,
"nodeAffinities": []
},
"deletionProtection": false,
"reservationAffinity": {
"consumeReservationType": "ANY_RESERVATION"
},
"serviceAccounts": [
{
"email": "some-number-compute#developer.gserviceaccount.com",
"scopes": [
"https://www.googleapis.com/auth/cloud-platform"
]
}
],
"shieldedInstanceConfig": {
"enableSecureBoot": false,
"enableVtpm": true,
"enableIntegrityMonitoring": true
},
"confidentialInstanceConfig": {
"enableConfidentialCompute": false
}
}
Here is the response with status 200
{
"id": "2981010757915612255",
"name": "operation-1602235056020-5b1396b5c5cee-e0e30499-4d06ce75",
"zone": "https://www.googleapis.com/compute/v1/projects/my-project-id/zones/europe-west3-c",
"operationType": "insert",
"targetLink": "https://www.googleapis.com/compute/v1/projects/my-project-id/zones/europe-west3-c/instances/ams2-linux-race-1",
"targetId": "1541614827291382879",
"status": "RUNNING",
"user": "email#gmail.com",
"progress": 0,
"insertTime": "2020-10-09T02:17:36.818-07:00",
"startTime": "2020-10-09T02:17:36.821-07:00",
"selfLink": "https://www.googleapis.com/compute/v1/projects/my-project-id/zones/europe-west3-c/operations/operation-1602235056020-5b1396b5c5cee-e0e30499-4d06ce75",
"kind": "compute#operation"
}
I have the same issue with C# code example from https://cloud.google.com/compute/docs/reference/rest/v1/instances/insert#examples
I can execute the same request without errors and in response I am getting this
{
"clientOperationId":null,
"creationTimestamp":null,
"description":null,
"endTime":null,
"error":null,
"httpErrorMessage":null,
"httpErrorStatusCode":null,
"id":3283200477858999168,
"insertTime":"2020-10-09T00:46:55.187-07:00",
"kind":"compute#operation",
"name":"operation-1602229614262-5b1382701b989-381126a6-cc145485",
"operationType":"insert",
"progress":0,
"region":null,
"selfLink":"https://www.googleapis.com/compute/v1/projects/my-project-id/zones/europe-west3-c/operations/operation-1602229614262-5b1382701b989-381126a6-cc145485",
"startTime":"2020-10-09T00:46:55.189-07:00",
"status":"RUNNING",
"statusMessage":null,
"targetId":2365846324436118401,
"targetLink":"https://www.googleapis.com/compute/v1/projects/my-project-id/zones/europe-west3-c/instances/some-name",
"user":"email#gmail.com",
"warnings":null,
"zone":"https://www.googleapis.com/compute/v1/projects/my-project-id/zones/europe-west3-c",
"ETag":null
}
but I can't see any new instance beeing created...
Does any one know what is the issue here?
The Compute Engine API is enabled. Result of gcloud services list:
NAME TITLE
...
compute.googleapis.com Compute Engine API
...
Can you please double check if Compute Engine Api is enabled and post the result in your question.
gcloud services list
I believe your Compute Engine Api is not enabled.
I have a message card payload pushed from service now which is not rendering properly on MS Teams through bot framework. It only displays the content but not the button.Below is the payload, pls suggest what could be the issue.
BotFramework:V3
.Net SDK
Bot Builder package:3.12.2.4
Bot Connector:3.12.2.4
Bot.Connector.Teams:0.9.0
{
"contentType": "application/vnd.microsoft.teams.card.o365connector",
"content": {
"#type": "MessageCard",
"#context": "http://schema.org/extensions",
"title": "Incident Updated - INC0010010",
"summary": "Incident Updated - INC0010010",
"themeColor": "D1222B",
"sections": [
{
"title": "",
"text": "",
"activityTitle": "",
"activitySubtitle": "",
"activityText": "",
"facts": [
{
"name": "Category",
"value": "Software"
},
{
"name": "State",
"value": "New"
},
{
"name": "Priority",
"value": "5 - Planning"
},
{
"name": "Assignment group",
"value": "Software"
}
]
},
{
"text": "Please check the details"
}
],
"potentialAction": [
{
"#type": "OpenUri",
"name": "View Incident in ServiceNow",
"targets": [
{
"os": "default",
"uri": "https://dev62584.service-now.com/incident.do?sys_id=XXXXXXX&sysparm_stack=incident_list.do?sysparm_query=active=true"
},
{
"os": "iOS",
"uri": "https://dev62584.service-now.com/incident.do?sys_id=XXXXXXX&sysparm_stack=incident_list.do?sysparm_query=active=true"
},
{
"os": "android",
"uri": "https://dev62584.service-now.com/incident.do?sys_id=XXXXXXX&sysparm_stack=incident_list.do?sysparm_query=active=true"
},
{
"os": "windows",
"uri": "https://dev62584.service-now.com/incident.do?sys_id=7ec9865adb711010fcff8809489619b4&sysparm_stack=incident_list.do?sysparm_query=active=true"
}
]
}
]
}
}
Microsoft Troubleshooting and recommendation:
We were finally able to repro this issue. It is a bug in the team's scope and doesn't repro in the personal scope. An easy way to unblock you would be to add in the potentialAction section an #id field like so:
"potentialAction": [
{
"#id":"1",
"#type": "OpenUri",
Nothing stands out as a bug in your code or problem with your configuration. Linking to the GitHub issue where it is being investigated/troubleshot:
https://github.com/microsoft/BotBuilder-V3/issues/208
I have an ARM template for my resource group. In there I have set up a Function App which is correctly deployed with my ARM template using Octopus Deploy (OD).
Now I have with C# developed an Azure Function which I want to be deployed into my Function App.
This can be done with a separate step (using a template) in OD and all seemed well when deploying... Except that it does not show up in my Function App in Azure as I expect it to.
Is there any further configuration in my ARM template I need to do? I haven't found anything on the subject, when deploying a c# azure function.
For a csx azure function it can be configured/deployed in the ARM template but it is not recommended for a c# azure function, what I read.
EDIT:
This is a part of my ARM template. The FunctionApp is created with the following resource.
{
"type": "Microsoft.Web/sites",
"apiVersion": "2018-11-01",
"name": "[parameters('sites_..._name')]",
"location": "[parameters('location')]",
"kind": "functionapp",
"dependsOn": [
"[resourceId('Microsoft.Web/serverfarms', parameters('serverfarms_..._name'))]",
"[resourceId('Microsoft.Storage/storageAccounts', variables('storageAccountName'))]"
],
"identity": {
"type": "SystemAssigned"
},
"properties": {
"enabled": true,
"siteConfig": {
"appSettings": [
{
"name": "FUNCTIONS_WORKER_RUNTIME",
"value": "[parameters('runtimeStack')]"
},
{
"name": "AzureWebJobsStorage",
"value": "[concat('DefaultEndpointsProtocol=https;AccountName=',variables('storageAccountName'),';AccountKey=',listKeys(resourceId('Microsoft.Storage/storageAccounts', variables('storageAccountName')), '2017-06-01').keys[0].value)]"
},
{
"name": "FUNCTIONS_EXTENSION_VERSION",
"value": "~2"
},
//...
{
"name": "WEBSITE_CONTENTAZUREFILECONNECTIONSTRING",
"value": "[concat('DefaultEndpointsProtocol=https;AccountName=', variables('storageAccountName'), ';AccountKey=', listKeys(resourceId('Microsoft.Storage/storageAccounts', variables('storageAccountName')),'2017-06-01').keys[0].value)]"
},
{
"name": "WEBSITE_CONTENTSHARE",
"value": "[parameters('sites_..._name')]"
}
]
},
"hostNameSslStates": [
{
"name": "[concat(parameters('sites_..._name'), '.azurewebsites.net')]",
"sslState": "Disabled",
"hostType": "Standard"
},
{
"name": "[concat(parameters('sites_..._name'), '.scm.azurewebsites.net')]",
"sslState": "Disabled",
"hostType": "Repository"
}
],
"serverFarmId": "[resourceId('Microsoft.Web/serverfarms', parameters('serverfarms_..._name'))]",
"reserved": false,
"isXenon": false,
"hyperV": false,
"scmSiteAlsoStopped": false,
"clientAffinityEnabled": false,
"clientCertEnabled": false,
"hostNamesDisabled": false,
"containerSize": 1536,
"dailyMemoryTimeQuota": 0,
"httpsOnly": true,
"redundancyMode": "None"
}
}
As you can see I am registering my FunctionApp which after deployment of the ARM template AND separate deploy of my azure function TO that FunctionApp should include the azure function.
Though, the azure function do not show up under my FunctionApp.
I'm trying to create a water fall model with the help of Adaptive cards in C# version 4.0.
My scenario is like following:
On loading bot following cards will be shown:
1. SharePoint
2. Azure
3. O365
Once I click on any of them then new set of cards will be shown like:
On selecting "SharePoint" following cards will be shown:
1. Create a Site
2. Create a sub site.
and on selecting any of the above choices a form is called with set of questions like:
1. what is site title
2. site owner
and so on..
UI as shown below:
I tried creating the structure on https://adaptivecards.io/, but couldnt find any relevant code related to this type of scenario.
If any one has done it before please share the documentation or code snippet.
Thanks
Here's a basic card with Input.ChoiceSet:
{
"type": "AdaptiveCard",
"body": [
{
"type": "Container",
"items": [
{
"type": "Input.ChoiceSet",
"id": "first",
"placeholder": "Placeholder text",
"choices": [
{
"title": "SharePoint",
"value": "SharePoint"
},
{
"title": "Azure",
"value": "Azure"
},
{
"title": "O365",
"value": "O365"
}
],
"style": "expanded"
}
]
}
],
"actions": [
{
"type": "Action.Submit",
"title": "Submit"
}
],
"$schema": "http://adaptivecards.io/schemas/adaptive-card.json",
"version": "1.0"
}
Then, in your bot, follow these answers for dealing with User Input:
Using Adaptive Cards in Waterfall Dialogs
(optional) Dynamically Changing The Card Before Sending
Basically, you'll want to:
Send the card
Capture the card's input by sending a blank text prompt right after sending the card (as explained in the first link)
Use if or switch statements in the next step to determine which card to display next based off of the user's input. You could optionally create the card more dynamically using the second link
The AdaptiveCards Designer is pretty good, but it lacks the ability to set the actions property. You can do so manually, by adding (like I did above):
"actions": [
{
"type": "Action.Submit",
"title": "Submit"
}
],
Using Images
If you'd like to use images instead of a ChoiceSet, you can do something like this:
{
"type": "AdaptiveCard",
"body": [
{
"type": "Container",
"items": [
{
"type": "Image",
"id": "choice1",
"selectAction": {
"type": "Action.Submit",
"title": "choice1",
"data": {
"choice": 1
}
},
"url": "https://acuvate.com/wp-content/uploads/2017/02/Microsoft-Botframework.fw_-thegem-person.png",
"altText": ""
},
{
"type": "Image",
"id": "choice2",
"selectAction": {
"type": "Action.Submit",
"title": "choice2",
"data": {
"choice": 2
}
},
"url": "https://acuvate.com/wp-content/uploads/2017/02/Microsoft-Botframework.fw_-thegem-person.png",
"altText": ""
},
{
"type": "Image",
"id": "choice3",
"selectAction": {
"type": "Action.Submit",
"title": "choice3",
"data": {
"choice": 3
}
},
"url": "https://acuvate.com/wp-content/uploads/2017/02/Microsoft-Botframework.fw_-thegem-person.png",
"altText": ""
}
]
}
],
"$schema": "http://adaptivecards.io/schemas/adaptive-card.json",
"version": "1.0"
}
The important part is making sure that the Action.Submit:
Is on the image
Has data that you would use to capture which choice the user selected