Skip to content
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
90 changes: 86 additions & 4 deletions specification/ai/Azure.AI.Projects/connections/models.tsp
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,16 @@ using TypeSpec.Versioning;

namespace Azure.AI.Projects;

@doc("Response from the listSecrets operation")
@doc("Response from the list and get connections operations")
@resource("connections")
@discriminator("authType")
@added(Versions.v2025_05_01)
model Connection {

@doc("The authentication type used by the connection")
@visibility(Lifecycle.Read)
authType: AuthenticationType;

@doc("The name of the resource")
@visibility(Lifecycle.Read)
@key("name")
Expand All @@ -27,15 +33,85 @@ model Connection {
@visibility(Lifecycle.Read)
target: string;

@doc("The authentication type used by the connection")
@doc("Whether the connection is tagged as the default connection of its type")
@visibility(Lifecycle.Read)
authType: AuthenticationType;
isDefault: boolean;

@doc("Metadata of the connection")
@visibility(Lifecycle.Read)
metadata: Record<string>;
}

@doc("A connection with API key authentication")
model ConnectionWithApiKeyAuth extends Connection {

@doc("The authentication type used by the connection")
@visibility(Lifecycle.Read)
authType: AuthenticationType.apiKey;

@doc("The credentials for API-key authentication")
@visibility(Lifecycle.Read)
credentials?: CredentialsApiKeyAuth;
}

#suppress "@azure-tools/typespec-azure-core/casing-style"
@doc("A connection with EntraID authentication (aka `Entra ID passthrough`)")
model ConnectionWithEntraIDAuth extends Connection {

@doc("The authentication type used by the connection")
@visibility(Lifecycle.Read)
authType: AuthenticationType.entraId;
}

#suppress "@azure-tools/typespec-azure-core/casing-style"
@doc("A connection with custom authentication")
model ConnectionWithCustomAuth extends Connection {

@doc("The authentication type used by the connection")
@visibility(Lifecycle.Read)
authType: AuthenticationType.custom;
}

#suppress "@azure-tools/typespec-azure-core/casing-style"
@doc("A connection with Shared Access Signature (SAS) authentication")
model ConnectionWithSASAuth extends Connection {

@doc("The authentication type used by the connection")
@visibility(Lifecycle.Read)
authType: AuthenticationType.SAS;

@doc("The credentials for SAS authentication")
@visibility(Lifecycle.Read)
credentials?: CredentialsSASAuth;
}

#suppress "@azure-tools/typespec-azure-core/casing-style"
@doc("A connection with no authentication")
model ConnectionWithNoAuth extends Connection {

@doc("The authentication type used by the connection")
@visibility(Lifecycle.Read)
authType: AuthenticationType.None;
}

@doc("The credentials needed for API key authentication")
model CredentialsApiKeyAuth {

@doc("The API key")
@visibility(Lifecycle.Read)
key: string;
}

#suppress "@azure-tools/typespec-azure-core/casing-style"
@doc("The credentials needed for Shared Access Signatures (SAS) authentication")
model CredentialsSASAuth {

@doc("The Shared Access Signatures (SAS) token")
@visibility(Lifecycle.Read)
SAS: string;
}


// https://learn.microsoft.com/rest/api/azureml/workspace-connections/list-secrets?view=rest-azureml-2024-04-01&tabs=HTTP#ConnectionType
@doc("The Type (or category) of the connection")
union ConnectionType {
Expand All @@ -44,9 +120,12 @@ union ConnectionType {
@doc("Azure OpenAI Service")
AzureOpenAI: "AzureOpenAI", //TODO: In Python this results in .AZURE_OPEN_AI. How do I make it .AZURE_OPENAI?

@doc("Azure Blob Storage")
@doc("Azure Blob Storage, with specified container")
AzureBlobStorage: "AzureBlob",

@doc("Azure Blob Storage, with container not specified (used by Assistants)")
AzureStorageAccount: "AzureStorageAccount",

@doc("Azure AI Search")
AzureAISearch: "CognitiveSearch",

Expand All @@ -56,6 +135,9 @@ union ConnectionType {
@doc("Generic connection that uses API Key authentication")
APIKey: "ApiKey",

@doc("Application Configuration")
ApplicationConfiguration: "AppConfig",

@doc("Application Insights")
ApplicationInsights: "AppInsights",

Expand Down
14 changes: 11 additions & 3 deletions specification/ai/Azure.AI.Projects/connections/routes.tsp
Original file line number Diff line number Diff line change
Expand Up @@ -19,17 +19,25 @@ alias ConnectionOperations = Azure.Core.ResourceOperations<ConnectionServiceTrai

@added(Versions.v2025_05_01)
interface Connections {
@doc("Get a connection by name.")
@doc("Get a connection by name, without populating connection credentials")
get is ConnectionOperations.ResourceRead<Connection>;

@doc("List all connections in the project")
@doc("Get a connection by name, with its connection credentials")
@Rest.actionSeparator("/")
@Rest.action("withCredentials")
getWithCredentials is ConnectionOperations.ResourceRead<Connection>;
@doc("List all connections in the project, without populating connection credentials")
list is ConnectionOperations.ResourceList<
Connection,
ListQueryParametersTrait<{
@doc("Specific type of connection to return in list")
@doc("List connections of this specific type")
@query("connectionType")
connectionType?: ConnectionType;

@doc("List connections that are default connections")
@query("defaultConnection")
defaultConnection?: boolean;

...StandardListQueryParameters;
}>
>;
Expand Down
2 changes: 2 additions & 0 deletions specification/ai/Azure.AI.Projects/datasets/routes.tsp
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@ interface Datasets
PendingUploadResponse
>;

/* Reenable this once the service supports "unversioned" dataset operations
@doc("Start a new pending upload for a dataset. The version id will be generated by the service.")
@Rest.actionSeparator("/")
@Rest.action("startPendingUpload")
Expand All @@ -55,4 +56,5 @@ interface Datasets
PendingUploadRequest,
PendingUploadResponse
>;
*/
}
4 changes: 4 additions & 0 deletions specification/ai/Azure.AI.Projects/servicepatterns.tsp
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@ namespace Azure.AI.Projects.ServicePatterns {
Http.NoContentResponse
>;

/* Reenable this once the service supports "unversioned" operations
@doc(
"Create a new {name}. The version id will be generated by the service.",
TEntityType
Expand All @@ -69,6 +70,7 @@ namespace Azure.AI.Projects.ServicePatterns {
},
TEntityType
>;
*/

@doc(
"Create a new or replace an existing {name} with the given version id",
Expand Down Expand Up @@ -114,6 +116,7 @@ namespace Azure.AI.Projects.ServicePatterns {
TResponse
>;

/* Reenable this once the service supports "unversioned" operations
@Rest.action
op UnversionedResourceAction<
TEntityType extends Reflection.Model,
Expand All @@ -128,6 +131,7 @@ namespace Azure.AI.Projects.ServicePatterns {
},
TResponse
>;
*/

namespace BuildingBlocks {
alias CoreOps = Azure.Core.StandardResourceOperations;
Expand Down
Loading
Loading