Hello World sample: "Something went wrong" when installing/testing - json

I tried to get the example from https://learn.microsoft.com/en-us/microsoftteams/platform/get-started/get-started-dotnet to run.
I successfully built and published (on Azure) the webapp.
Then I tried
- manually editing the json file in the visual studio solution similarly to what the docs said, and then import the resulting zip in App Studio
- adding the App directly in App Studio through the manifest editor (this works, but it fails when installing/testing it)
Both give me an error without any more info "something went wrong".
Any way to actually figure out what I did wrong (if anything)?
Either way, maybe you guys can figure it out from the json file's contents:
{
"$schema": "https://statics.teams.microsoft.com/sdk/v1.0/manifest/MicrosoftTeams.schema.json",
"manifestVersion": "1.0",
"version": "1.0.0",
"id": " 1CC58D17-1E95-443C-958F-E1F14D4CA3B4",
"packageName": "com.contoso.helloworld",
"developer": {
"name": "Contoso",
"websiteUrl": "https://www.microsoft.com",
"privacyUrl": "https://www.microsoft.com/privacy",
"termsOfUseUrl": "https://www.microsoft.com/termsofuse"
},
"name": {
"short": "Hello World",
"full": "Hello World App for Microsoft Teams"
},
"description": {
"short": "Hello World App for Microsoft Teams",
"full": "This sample app provides a very simple app for Microsoft Teams. You can extend this to add more content and capabilities."
},
"icons": {
"outline": "contoso20x20.png",
"color": "contoso96x96.png"
},
"accentColor": "#60A18E",
"staticTabs": [
{
"entityId": "com.contoso.helloworld.hellotab",
"name": "Hello Tab",
"contentUrl": "https://microsoftteamssampleshelloworldweb20181022032046.azurewebsites.net/hello",
"scopes": [
"personal"
]
}
],
"configurableTabs": [
{
"configurationUrl": "https://microsoftteamssampleshelloworldweb20181022032046.azurewebsites.net/configure",
"canUpdateConfiguration": true,
"scopes": [
"team"
]
}
],
"bots": [
{
"botId": "00000000-0000-0000-0000-000000000000",
"needsChannelSelector": false,
"isNotificationOnly": false,
"scopes": [
"team",
"personal"
]
}
],
"composeExtensions": [
{
"botId": "00000000-0000-0000-0000-000000000000",
"scopes": [
"personal",
"team"
],
"commands": [
{
"id": "getRandomText",
"description": "Gets some random text and images that you can insert in messages for fun.",
"title": "Get some random text for fun",
"initialRun": true,
"parameters": [
{
"name": "cardTitle",
"description": "Card title to use",
"title": "Card title"
}
]
}
]
}
],
"permissions": [],
"validDomains": []
}
Any suggestions?

There is a whitespace in your app Id in shared manifes:
"id": " 1CC58D17-1E95-443C-958F-E1F14D4CA3B4"
Could you please remove it and try and let us know if it works? Also you can remove bots and composeExtensions section if you want.

I can't comment yet (not enough reputation points) but could you go through the instructions again?
I believe something went wrong with either the GUID, or one of the URL's. The instructions also advise to use ngrok, which is usefull for debugging.
If you can't find a clear error message, i advise you follow those instructions.

Related

Require Input.Toggle's to be Checked True Before Submitting?

I have the following adaptive card JSON code that has three Input.Toggle's. Is there a way to throw an error when the user clicks "Submit" and all three Input.Toggle's are not set to true? I saw in the Schema Explorer (Schema Explorer Input.Toggle) that they have Inherited properties called "fallback" and "requires", is that what I need? If so, how do I implement "fallback" and "requires" into this JSON code?
{
"$schema": "http://adaptivecards.io/schemas/adaptive-card.json",
"type": "AdaptiveCard",
"version": "1.2",
"body": [
{
"placeholder": "1.1 Business Office Coordinator - RFQ Receipt",
"type": "Input.Text",
"id": "Title"
},
{
"text": "Quote ##{body('Get_response_details')?['b194cde8837234ccc80fu5017c1b0f869']} ",
"type": "TextBlock",
"id": "textBlock1"
},
{
"type": "Input.Toggle",
"title": "Customer Acknowledgement",
"valueOn": "custYes",
"valueOff": "custNo",
"id": "Customer"
},
{
"type": "Input.Toggle",
"title": "Create RFQ Log Number and Enter Information into RFQ Log",
"valueOn": "RFQYes",
"valueOff": "RFQNo",
"id": "RFQ"
},
{
"type": "Input.Toggle",
"title": "Populate Quote Folder with Customer Data",
"valueOn": "PopulateYes",
"valueOff": "PopulateNo",
"id": "Populate"
}
],
"actions": [
{
"type": "Action.Submit",
"title": "Submit",
"data": {
"id": "9876543210"
}
}
]
}
this is part of input validation which as of today is not available yet.
I'm afraid what you're asking for is not possible right now but will hopefully be soon.
You can follow the feature request here: https://portal.productboard.com/adaptivecards/1-adaptive-cards-features/c/21-input-validation-and-evolution , add your own vote to it aswell if you want to.
Depending on where you use the card however, you can get this working. In MS Teams you could verify the card submission in your own code and return an error. Its not client side but that way you can still do the check.

Microsoft Teams: "Something went wrong" while installing my custom app into my organization's team

I have created an app for Microsoft Teams that one can add to a team. The app is a chatbot created with the Microsoft Bot framework. I have already made two other apps with similar functionality that can be installed fine.
When I create my app using the App Studio (and link to an existing bot), everything is fine but when I try to add that to a team I get the "something went wrong" message and no request is sent to my bot either...
Has anyone faced a similar issue or does someone know how to debug this? My manifest is below.
The manifest is below (with ids replaced).
{
"$schema": "https://developer.microsoft.com/en-us/json-schemas/teams/v1.5/MicrosoftTeams.schema.json",
"manifestVersion": "1.5",
"version": "0.0.2",
"id": "my-id-is-here",
"packageName": "nl.getsofia.teams.acceptance",
"developer": {
"name": "Sofia Melius B.V.",
"websiteUrl": "https://www.getsofia.nl",
"privacyUrl": "https://www.getsofia.nl/",
"termsOfUseUrl": "https://www.getsofia.nl/"
},
"icons": {
"color": "color.png",
"outline": "outline.png"
},
"name": {
"short": "Sofia Acceptance 2",
"full": "Sofia Acceptance Nice"
},
"description": {
"short": "ACCEPTANCE bot",
"full": "ACCEPTANCE bot long description"
},
"accentColor": "#FFFFFF",
"bots": [
{
"botId": "my-bot-id-is-here",
"scopes": [
"personal",
"team"
],
"commandLists": [
{
"scopes": [
"personal"
],
"commands": [
{
"title": "Add user",
"description": "A manager can add a user"
},
{
"title": "Get overview",
"description": "Get an overview of registered hours"
},
{
"title": "Projects",
"description": "Manage all projects"
},
{
"title": "Register hours",
"description": "Register your hours"
},
{
"title": "Settings",
"description": "Set hour registration reminder times"
}
]
}
],
"supportsFiles": false,
"isNotificationOnly": false
}
],
"permissions": [
"identity",
"messageTeamMembers"
],
"validDomains": [
"*.sofiamelius.nl",
"*.getsofia.nl"
]
}
If this is occurring when you are attempting to deploy the bot to Teams (as opposed to trying to talk to it in Teams), the "Sorry, something went wrong" message is usually caused by the Teams channel in the Bot Service not being set up. You must both set up the manifest and turn on the channel.
To turn on the channel, just navigate to your Bot Service in the Azure Portal, select the Channels blade, and then click on Teams to save and activate the channel (I can't remember but I don't think you have to configure any settings here).
After that is complete, you should be able to publish your bot to Teams using any available method.
I had the same problem trying to test with "Test team" team, which is apparently a special undeletable team that somehow exists in our teams.
Solution: Create a new Team and use your bot there.

How to create new alerts in azure for all webapps at same time

I want to create new alerts(High CPU,RAM) for all AppServicePlans in a given subscription. I could not find Powershell commands to create new alerts. Is there a way we can create these alerts for all appserviceplans with a single script? May be using ARM template?
Sorry for pasting a direct answer, but I cannot yet comment. You get the error because in the documentation for Add-AzMetricAlertruleV2 it states: "$act is the output of New-AzActionGroup cmdlet". Meaning you need to use for example:
$act = New-AzActionGroup -ActionGroupId "testActionGroup"
After that you need to add it in the parameter -ActionGroup $act for it to work.
If you look at Resource Explorer and navigate to a manually created (near-realtime) alert, you should see the "critera" object defined like below. Here is a full example of a resource that seems to be working. Create some variables for each of your values:
{
"type": "Microsoft.Insights/metricAlerts",
"apiVersion": "2018-03-01",
"name": "[variables('alertName')]",
"location": "global",
"dependsOn": [],
"tags": {
"[concat('hidden-link:', variables('applicationInsightsResourceId'))]": "Resource",
"[concat('hidden-link:', variables('webtestResourceId'))]": "Resource"
},
"properties": {
"description": "[concat('Alert for ', parameters('availibilityTestName'))]",
"severity": 4,
"enabled": true,
"scopes": [
"[variables('webtestResourceId')]",
"[variables('applicationInsightsResourceId')]"
],
"evaluationFrequency": "PT5M",
"windowSize": "PT15M",
"criteria": {
"odata.type": "Microsoft.Azure.Monitor.WebtestLocationAvailabilityCriteria",
"webTestId": "[variables('webtestResourceId')]",
"componentId": "[variables('applicationInsightsResourceId')]",
"failedLocationCount": 3
},
"actions": [
{
"actionGroupId": "[resourceId('microsoft.insights/actiongroups', 'webhook')]",
"webHookProperties": {
// Some properties to send to webhook
}
}
]
}
}

Visual Studio Code: Comments not being detected while trying to add support for a new language/filetype

So I am working on a research project that involves using a very specific piece of software that uses its own filetype; XPPAUT using .ode files. To prevent me and my team of not-neuroscientists from ripping our hair out trying to work with this, I decided to write a syntax highlighter for these .ode files.
To start I just wanted to be able to recognize and color linecomments, which are delineated with a #, similar to Python, however when I run the development environment, the comments are not highlighted with the color I set my dev workspace to use, or highlighted at all. I'm very new to this, so any help would be appreciated.
Here is my package.json file
{
"name": "ode",
"displayName": "XPP ODE",
"description": "ODE files to be used with XPP/XPPAUT",
"version": "0.0.1",
"publisher": "wjmccann",
"engines": {
"vscode": "^1.22.0"
},
"categories": [
"Languages"
],
"contributes": {
"languages": [{
"id": "xpp",
"aliases": ["XPP ODE", "XPP", "XPPAUT"],
"extensions": [".ode"],
"configuration": "./language-configuration.json"
}],
"grammars": [{
"language": "xpp",
"scopeName": "source.xpp",
"path": "./syntaxes/xpp.tmLanguage.json"
}]
}
}
and the corresponding language-configuration.json
{
"comments": {
// symbol used for single line comment. Remove this entry if your language does not support line comments
"lineComment": "#",
},
// symbols used as brackets
"brackets": [
["{", "}"],
["[", "]"],
["(", ")"]
],
// symbols that are auto closed when typing
"autoClosingPairs": [
["{", "}"],
["[", "]"],
["(", ")"],
["\"", "\""],
["'", "'"]
],
// symbols that that can be used to surround a selection
"surroundingPairs": [
["{", "}"],
["[", "]"],
["(", ")"],
["\"", "\""],
["'", "'"]
]
}
The language-configuration.json file defines text patterns used in a variety of standard features of VS Code such as comment toggling as described here.
Syntax highlighting/colouring is via the grammars contribution point in package.json as described here.
Based on your package.jsonyou will need to create a new file at ./syntaxes/xpp.tmLanguage.json with the following content for your comments to be coloured appropriately. The actual colour used will depend on your current theme.
{
"$schema": "https://raw.githubusercontent.com/martinring/tmlanguage/master/tmlanguage.json",
"name": "xpp",
"scopeName": "source.xpp",
"patterns": [
{
"include": "#comments"
}
],
"repository": {
"comments": {
"patterns": [{
"name": "comment.line.number-sign.xpp",
"match": "#.*"
}]
}
}
}

How to check if name already exists? Azure Ressource Manager Template

is it possible to check, in an ARM Template, if the name for my Virtual Machine already exists?
I am developing a Solution Template for the Azure Marketplace. Maybe it is possible to set a paramter in the UiDefinition uniqe?
The goal is to reproduce this green Hook
A couple notes...
VM Names only need to be unique within a resourceGroup, not within the subscription
Solution Templates must be deployed to empty resourceGroups, so collisions with existing resources aren't possible
For solution templates the preference is that you simply name the VMs for the user, rather than asking - use something that is appropriate for the workload (e.g. jumpbox) - not all solutions do this but we're trying to improve that experience
Given that it's not likely we'll ever build a control that checks for naming collisions on resources without globally unique constraints.
That help?
This looks impossible, according to the documentation.
There are no validation scenarious.
I assume that you should be using the Microsoft.Common.TextBox UI element in your createUiDefinition.json.
I have tried to reproduce a green check by creating a simple createUiDefinition.json as below with a Microsoft.Common.TextBox UI element as shown below.
{
"$schema": "https://schema.management.azure.com/schemas/0.1.2-preview/CreateUIDefinition.MultiVm.json",
"handler": "Microsoft.Compute.MultiVm",
"version": "0.1.2-preview",
"parameters": {
"basics": [
{
"name": "textBoxA",
"type": "Microsoft.Common.TextBox",
"label": "VM Name",
"defaultValue": "",
"toolTip": "Please enter a VM name",
"constraints": {
"required": true
},
"visible": true
}
],
"steps": [],
"outputs": {}
}
}
I am able to reproduce the green check beside the VM Name textbox as shown below:
However, this green check DOES NOT imply the VM Name is Available.
This is because based on my testing, even if I use an existing VM Name in the same subscription, it is still showing the green check.
Based on the official documented constraints that are supported by the Microsoft.Common.TextBox UI element, it DOES NOT VALIDATE Name Availability.
Hope this helps!
While bmoore's point is correct that it's unlikely you would ever need this for a VM (nor is there an API for it), there are other compute resources that do have global naming requirements.
As of 2022 this concept is possible now with the use of the ArmApiControl UI element. It allows you to call ARM apis as part of validation in the createUiDefinition.json. Here is an example using the check name API for an Azure App service.
{
"$schema": "https://schema.management.azure.com/schemas/0.1.2-preview/CreateUIDefinition.MultiVm.json#",
"handler": "Microsoft.Azure.CreateUIDef",
"version": "0.1.2-preview",
"parameters": {
"basics": [
{}
],
"steps": [
{
"name": "domain",
"label": "Domain Names",
"elements": [
{
"name": "domainInfo",
"type": "Microsoft.Common.InfoBox",
"visible": true,
"options": {
"icon": "Info",
"text": "Pick the domain name that you want to use for your app."
}
},
{
"name": "appServiceAvailabilityApi",
"type": "Microsoft.Solutions.ArmApiControl",
"request": {
"method": "POST",
"path": "[concat(subscription().id, '/providers/Microsoft.Web/checknameavailability?api-version=2021-02-01')]",
"body": "[parse(concat('{\"name\":\"', concat('', steps('domain').domainName), '\", \"type\": \"Microsoft.Web/sites\"}'))]"
}
},
{
"name": "domainName",
"type": "Microsoft.Common.TextBox",
"label": "Domain Name Word",
"toolTip": "The name of your app service",
"placeholder": "yourcompanyname",
"constraints": {
"validations": [
{
"regex": "^[a-zA-Z0-9]{4,30}$",
"message": "Alphanumeric, between 4 and 30 characters."
},
{
"isValid": "[not(equals(steps('domain').appServiceAvailabilityApi.nameAvailable, false))]",
"message": "[concat('Error with the url: ', steps('domain').domainName, '. Reason: ', steps('domain').appServiceAvailabilityApi.reason)]"
},
{
"isValid": "[greater(length(steps('domain').domainName), 4)]",
"message": "The unique domain suffix should be longer than 4 characters."
},
{
"isValid": "[less(length(steps('domain').domainName), 30)]",
"message": "The unique domain suffix should be shorter than 30 characters."
}
]
}
},
{
"name": "section1",
"type": "Microsoft.Common.Section",
"label": "URLs to be created:",
"elements": [
{
"name": "domainExamplePortal",
"type": "Microsoft.Common.TextBlock",
"visible": true,
"options": {
"text": "[concat('https://', steps('domain').domainName, '.azurewebsites.net - The main app service URL')]"
}
}
],
"visible": true
}
]
}
],
"outputs": {
"desiredDomainName": "[steps('domain').domainName]"
}
}
}
You can copy the above code and test it in the createUiDefinition.json sandbox azure provides.