This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"type": "object", | |
"properties": { | |
"RowID": { | |
"type": "string" | |
}, | |
"Hours": { | |
"type": "string" | |
} | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#Authentication | |
$consumerToken = "xxxxxx" | |
$employeeToken = "xxxxxx" | |
#Add your HTTP Trigger URIs from the cloud flows here: | |
$AddURI = "xxxxx" | |
$ReadURI = "xxxxx" | |
$UpdateURI = "xxxxxx" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"displayName": "AlexHolmeset.blog", | |
"squareLogoWebUrlForDarkTheme": "https://s.w.org/style/images/about/WordPress-logotype-wmark.png", | |
"longLogoWebUrlForDarkTheme": "https://s.w.org/style/images/about/WordPress-logotype-wmark.png", | |
"squareLogoWebUrlForLightTheme": "https://s.w.org/style/images/about/WordPress-logotype-wmark.png", | |
"longLogoWebUrlForLightTheme": "https://s.w.org/style/images/about/WordPress-logotype-wmark.png", | |
"isEnabled": true, | |
"loginWebUrl": "" | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"additionalTags": [ | |
"Teams Meetings" | |
], | |
"contentWebUrl": "https://alexholmeset.blog/2023/01/25/asdfasdf/", | |
"contributor": "Alexander Holmeset", | |
"description": "Put a description here if you have.", | |
"duration": "PT20M", | |
"format": "Blog", | |
"isActive": true, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$graphScope = "LearningContent.ReadWrite.All" | |
$servicePrincipalObjectId = "Enter object ID of Logic App here" | |
$TenantID = "contoso.onmicrosoft.com" | |
Install-Module Microsoft.Graph | |
Connect-MgGraph -Scope “AppRoleAssignment.ReadWrite.All”,”Application.Read.All” -tenantId $TenantID | |
$graph = Get-MgServicePrincipal -Filter "AppId eq '00000003-0000-0000-c000-000000000000'" | |
$graphAppRole = $graph.AppRoles | ? Value -eq $graphScope | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
https://graph.microsoft.com/beta/employeeExperience/learningProviders/c18f52f8-0cfd-45b2-8f86-3956bc895f66/learningContents(externalId='ENTER TITLE') |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function Get-AzureOpenAIToken{ | |
<# .SYNOPSIS | |
Get an azure token for user or managed identity thats required to authenticate to Azure OpenAI with Rest API. | |
Also construct the header if you are using an Azure OpenAI API key instead of Azure AD authentication. | |
.PARAMETER ManagedIdentity | |
Use this parameter if you want to use a managed identity to authenticate to Azure OpenAI. | |
.PARAMETER User | |
Use this parameter if you want to use a user to authenticate to Azure OpenAI. | |
.PARAMETER APIKey | |
Use this parameter if you want to use an API key to authenticate to Azure OpenAI. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function Get-Completion { | |
<# .SYNOPSIS | |
Get a text completion from Azure OpenAI Completion endpoint. | |
.PARAMETER DeploymentName | |
A deployment name should be provided. | |
.PARAMETER ResourceName | |
A Resource name should be provided. | |
.PARAMETER Prompt | |
A prompt name should be provided. | |
.PARAMETER Token |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Get-AzureOpenAIToken -ManagedIdentity $true | |
$DeploymentName = "TextModel" | |
$ResourceName = "AzureOpenAIAlex" | |
$Prompt = "What is microsoft teams?" | |
$Request = Get-Completion -DeploymentName $DeploymentName -ResourceName $ResourceName -Maxtokens 100 -Prompt $Prompt | |
"Genetrated text:" | |
$Request.choices.text |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Get-AzureOpenAIToken -User $true | |
$DeploymentName = "TextModel" | |
$ResourceName = "AzureOpenAIAlex" | |
$Prompt = "What is microsoft teams?" | |
$Request = Get-Completion -DeploymentName $DeploymentName -ResourceName $ResourceName -Maxtokens 100 -Prompt $Prompt | |
"Genetrated text:" | |
$Request.choices.text |