Skip to content

Instantly share code, notes, and snippets.

View dgroh's full-sized avatar
🤓

Daniel Groh dgroh

🤓
  • Berlin
View GitHub Profile
function PublishTeamsApp($FilePath, $AuthorizationToken) {
$baseUrl = "https://graph.microsoft.com/v1.0/appCatalogs/teamsApps"
$headers = @{}
$headers.Add("Authorization", "Bearer $AuthorizationToken")
$headers.Add("Content-Type", "application/zip")
try {
Invoke-RestMethod -Uri $baseUrl -Method 'POST' -Headers $headers -InFile $FilePath
}
catch {
@dgroh
dgroh / NewAppRegistration.ps1
Created March 21, 2021 09:54
Create an app registration to publish Microsoft Teams App
function NewAppRegistration() {
$appRegistrationName = "PublishTeamsApp"
$appRegistration = az ad app create `
--display-name $appRegistrationName `
--reply-urls "http://localhost/auth" `
--oauth2-allow-implicit-flow true `
--available-to-other-tenants false `
--required-resource-accesses "$PSScriptRoot/required-resource-accesses.json" `
-o json |

Application Permissions

List of AAD available application permissions


Permission Id
AgreementAcceptance.Read.All d8e4ec18-f6c0-4620-8122-c8b1f2bf400e
Agreement.ReadWrite.All c9090d00-6101-42f0-a729-c41074260d47
@dgroh
dgroh / userRouterTest.js
Created July 19, 2020 07:13
Unit testing Express endpoints with Sinon
// eslint-disable-next-line
const should = require('should')
const sinon = require('sinon');
const proxyquire = require('proxyquire');
describe('userRouter', () => {
let expressStub;
let controllerStub;
let RouterStub;
let rootRouteStub;