Skip to content

Instantly share code, notes, and snippets.

{
"properties": {
"@@odata.context": {
"type": [
"string",
"null"
]
},
"@@odata.count": {
"type": "integer"
{
"properties": {
"@@odata.type": {
"type": "string"
},
"displayName": {
"type": "string"
},
"id": {
"type": "string"
{
"properties": {
"@@odata.context": {
"type": [
"string",
"null"
]
},
"attachments": {
"type": "array"
$Question = "How many sick days do i have?"
$AzureOpenAIEndpointURL = "https://sharepointdocumentschat.openai.azure.com/"
$AzureOpenAIEndpointKey = "7256974864a9499499ca4d3e70fa0c7b"
$AzureOpenAIModelDelpoymentName = "ChatGPT4"
$AzureCognitiveSearchURL = "https://sharepointsearchinstance.search.windows.net"
$AzureCognitiveSearchAdminKey = "Wt1mZ0sjkKoXW913d2eJ8xXYJk4JHThk1UK8H0wZoIAzSeDjYTmC"
$Header = @{"api-key" = "$AzureOpenAIEndpointKey"
"ChatGpt_Key" = "$AzureOpenAIEndpointKey "
$AzureCognitiveSearchURL = "https://sharepointsearchinstance.search.windows.net"
$AzureCognitiveSearchAdminKey = "Wt1mZ0sjkKoXW913d2eJ8xXYJk4JHThk1UK8H0wZoIAzSeDjYTmC"
$Header = @{"api-key" = "$AzureCognitiveSearchAdminKey"
"content-type" = "application/json"
}
$AzureCognitiveSearchURL = "https://sharepointsearchinstance.search.windows.net"
$AzureCognitiveSearchAdminKey = "Wt1mZ0sjkKoXW913d2eJ8xXYJk4JHThk1UK8H0wZoIAzSeDjYTmC"
$Header = @{"api-key" = "$AzureCognitiveSearchAdminKey"
"content-type" = "application/json"
}
$Body = @"
$AzureCognitiveSearchURL = "https://sharepointsearchinstance.search.windows.net"
$AzureCognitiveSearchAdminKey = "Wt1mZ0sjkKoXW913d2eJ8xXYJk4JHThk1UK8H0wZoIAzSeDjYTmC"
$SharePointSiteURL = "https://alexholmeset.sharepoint.com/sites/TestDemoTeam/"
$AzureAppregistrationID = "861eade5-bb96-41cc-af4b-55dce97b020e"
$AzureAppregistrationSecret = "8re8Q~pR6icm6oT5Fx8UwiDO~xgoeYp~8KGiXaF3"
$TenantID = "29594fb0-53f2-490c-a1be-8b2cca824805"
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.
{
"type": "object",
"properties": {
"myString": {
"type": "string"
}
}
}
{
"properties": {
"MeetingID": {
"type": "string"
},
"MeetingRoomUPN": {
"type": "string"
}
},
"type": "object"