-
Notifications
You must be signed in to change notification settings - Fork 10
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
6168995
commit 7f27d93
Showing
18 changed files
with
257 additions
and
113 deletions.
There are no files selected for viewing
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
{ | ||
"recommendations": [ | ||
"ms-azuretools.vscode-azurefunctions", | ||
"ms-python.python" | ||
] | ||
} |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
{ | ||
"configurations": [ | ||
{ | ||
"connect": { | ||
"host": "localhost", | ||
"port": 9091 | ||
}, | ||
"name": "Attach to Python Functions", | ||
"preLaunchTask": "func: host start", | ||
"request": "attach", | ||
"type": "debugpy" | ||
} | ||
], | ||
"version": "0.2.0" | ||
} |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
{ | ||
"azureFunctions.projectLanguage": "Python", | ||
"azureFunctions.projectLanguageModel": 2, | ||
"azureFunctions.projectRuntime": "~4", | ||
"azureFunctions.scmDoBuildDuringDeployment": true, | ||
"debug.internalConsoleOptions": "neverOpen" | ||
} |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
{ | ||
"tasks": [ | ||
{ | ||
"command": "host start", | ||
"isBackground": true, | ||
"label": "func: host start", | ||
"options": { | ||
"cwd": "${workspaceFolder}/ai_search_with_adi/function_app" | ||
}, | ||
"problemMatcher": "$func-python-watch", | ||
"type": "func" | ||
} | ||
], | ||
"version": "2.0.0" | ||
} |
This file contains 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
This file contains 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
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
python-dotenv | ||
azure-search-documents==11.6.0b4 | ||
azure-storage-blob | ||
azure-identity | ||
azure-mgmt-web |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
AIService__Services__Endpoint=<AI Services (Cognitive) Endpoint> | ||
AIService__Services__Key=<AI Services (Cognitive) Key if using key based authentication> | ||
IdentityType=<identityType> # system_assigned or user_assigned or key | ||
StorageAccount__ConnectionString=<connectionString if using non managed identity or endpoint if using managed identity> | ||
OpenAI__ApiKey=<openAIKey if using non managed identity> | ||
OpenAI__Endpoint=<openAIEndpoint> | ||
OpenAI__MultiModalDeployment=<openAIEmbeddingDeploymentId> | ||
OpenAI__ApiVersion=<openAIApiVersion> | ||
FunctionApp__ClientId=<clientId if using user assigned identity> |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
.git* | ||
.vscode | ||
__azurite_db*__.json | ||
__blobstorage__ | ||
__queuestorage__ | ||
local.settings.json | ||
test | ||
.venv |
Empty file.
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
# Copyright (c) Microsoft Corporation. | ||
# Licensed under the MIT License. | ||
import os | ||
from enum import Enum | ||
|
||
|
||
class IdentityType(Enum): | ||
"""The type of the indexer""" | ||
|
||
USER_ASSIGNED = "user_assigned" | ||
SYSTEM_ASSIGNED = "system_assigned" | ||
KEY = "key" | ||
|
||
|
||
def get_identity_type() -> IdentityType: | ||
"""This function returns the identity type. | ||
Returns: | ||
IdentityType: The identity type | ||
""" | ||
identity = os.environ.get("IdentityType") | ||
|
||
if identity == "user_assigned": | ||
return IdentityType.USER_ASSIGNED | ||
elif identity == "system_assigned": | ||
return IdentityType.SYSTEM_ASSIGNED | ||
elif identity == "key": | ||
return IdentityType.KEY | ||
else: | ||
raise ValueError("Invalid identity type") |
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
{ | ||
"extensionBundle": { | ||
"id": "Microsoft.Azure.Functions.ExtensionBundle", | ||
"version": "[4.*, 5.0.0)" | ||
}, | ||
"functionTimeout": "00:05:00", | ||
"logging": { | ||
"applicationInsights": { | ||
"samplingSettings": { | ||
"excludedTypes": "Request", | ||
"isEnabled": true | ||
} | ||
} | ||
}, | ||
"version": "2.0" | ||
} |
Oops, something went wrong.