-
Notifications
You must be signed in to change notification settings - Fork 3.3k
[Cognitive Services] az cognitiveservices account [project|connection]: Add support for AI Foundry project and connection management
#32336
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
13 commits
Select commit
Hold shift + click to select a range
5a1c2d5
Bump azure-mgmt-cognitiveservices to 14.0.0
CarlOchs 20305b7
Add support for Cog Svc/AI projects and connections
CarlOchs f493401
Fix linter errors. Add correct project update command
CarlOchs 1e1b8ea
Fix linter errors; add local linter exclusions
CarlOchs 7a25448
Fix whitespace issues.
CarlOchs d101fc1
[azdev style] Remove azure.ai module dependency
CarlOchs 3054d12
Update help messages.
CarlOchs b8e84ce
Fix whitespace issue
CarlOchs 6fafe0a
Rerun all cognitiveservices test live to update recordings
CarlOchs 0d25186
Mask secrets
CarlOchs c2c6e42
Add license headers
CarlOchs 5a854bc
Merge branch 'Azure:dev' into cogsvc_integrate_ml_commands
CarlOchs 79b141c
Merge branch 'Azure:dev' into cogsvc_integrate_ml_commands
CarlOchs File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
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
134 changes: 134 additions & 0 deletions
134
src/azure-cli/azure/cli/command_modules/cognitiveservices/_ml_utils.py
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,134 @@ | ||
| # -------------------------------------------------------------------------------------------- | ||
| # Copyright (c) Microsoft Corporation. All rights reserved. | ||
| # Licensed under the MIT License. See License.txt in the project root for license information. | ||
| # -------------------------------------------------------------------------------------------- | ||
|
|
||
| from azure.mgmt.cognitiveservices.models import ConnectionCategory | ||
|
|
||
| _ML_CONNECTION_TYPE_TO_COGNITIVE_SERVICES_CONNECTION_TYPE = { | ||
| "PythonFeed": ConnectionCategory.PYTHON_FEED, | ||
| "ContainerRegistry": ConnectionCategory.CONTAINER_REGISTRY, | ||
| "Git": ConnectionCategory.GIT, | ||
| "S3": ConnectionCategory.S3, | ||
| "Snowflake": ConnectionCategory.SNOWFLAKE, | ||
| "AzureSqlDb": ConnectionCategory.AZURE_SQL_DB, | ||
| "AzureSynapseAnalytics": ConnectionCategory.AZURE_SYNAPSE_ANALYTICS, | ||
| "AzureMySqlDb": ConnectionCategory.AZURE_MY_SQL_DB, | ||
| "AzurePostgresDb": ConnectionCategory.AZURE_POSTGRES_DB, | ||
| "ADLSGen2": ConnectionCategory.ADLS_GEN2, | ||
| "Redis": ConnectionCategory.REDIS, | ||
| "ApiKey": ConnectionCategory.API_KEY, | ||
| "AzureOpenAI": ConnectionCategory.AZURE_OPEN_AI, | ||
| "AzureOpenAi": ConnectionCategory.AZURE_OPEN_AI, | ||
| "AIServices": ConnectionCategory.AI_SERVICES, | ||
| "AiServices": ConnectionCategory.AI_SERVICES, | ||
| "CognitiveSearch": ConnectionCategory.COGNITIVE_SEARCH, | ||
| "CognitiveService": ConnectionCategory.COGNITIVE_SERVICE, | ||
| "CustomKeys": ConnectionCategory.CUSTOM_KEYS, | ||
| "AzureBlob": ConnectionCategory.AZURE_BLOB, | ||
| "AzureOneLake": ConnectionCategory.AZURE_ONE_LAKE, | ||
| "CosmosDb": ConnectionCategory.COSMOS_DB, | ||
| "CosmosDbMongoDbApi": ConnectionCategory.COSMOS_DB_MONGO_DB_API, | ||
| "AzureDataExplorer": ConnectionCategory.AZURE_DATA_EXPLORER, | ||
| "AzureMariaDb": ConnectionCategory.AZURE_MARIA_DB, | ||
| "AzureDatabricksDeltaLake": ConnectionCategory.AZURE_DATABRICKS_DELTA_LAKE, | ||
| "AzureSqlMi": ConnectionCategory.AZURE_SQL_MI, | ||
| "AzureTableStorage": ConnectionCategory.AZURE_TABLE_STORAGE, | ||
| "AmazonRdsForOracle": ConnectionCategory.AMAZON_RDS_FOR_ORACLE, | ||
| "AmazonRdsForSqlServer": ConnectionCategory.AMAZON_RDS_FOR_SQL_SERVER, | ||
| "AmazonRedshift": ConnectionCategory.AMAZON_REDSHIFT, | ||
| "Db2": ConnectionCategory.DB2, | ||
| "Drill": ConnectionCategory.DRILL, | ||
| "GoogleBigQuery": ConnectionCategory.GOOGLE_BIG_QUERY, | ||
| "Greenplum": ConnectionCategory.GREENPLUM, | ||
| "Hbase": ConnectionCategory.HBASE, | ||
| "Hive": ConnectionCategory.HIVE, | ||
| "Impala": ConnectionCategory.IMPALA, | ||
| "Informix": ConnectionCategory.INFORMIX, | ||
| "MariaDb": ConnectionCategory.MARIA_DB, | ||
| "MicrosoftAccess": ConnectionCategory.MICROSOFT_ACCESS, | ||
| "MySql": ConnectionCategory.MY_SQL, | ||
| "Netezza": ConnectionCategory.NETEZZA, | ||
| "Oracle": ConnectionCategory.ORACLE, | ||
| "Phoenix": ConnectionCategory.PHOENIX, | ||
| "PostgreSql": ConnectionCategory.POSTGRE_SQL, | ||
| "Presto": ConnectionCategory.PRESTO, | ||
| "SapOpenHub": ConnectionCategory.SAP_OPEN_HUB, | ||
| "SapBw": ConnectionCategory.SAP_BW, | ||
| "SapHana": ConnectionCategory.SAP_HANA, | ||
| "SapTable": ConnectionCategory.SAP_TABLE, | ||
| "Spark": ConnectionCategory.SPARK, | ||
| "SqlServer": ConnectionCategory.SQL_SERVER, | ||
| "Sybase": ConnectionCategory.SYBASE, | ||
| "Teradata": ConnectionCategory.TERADATA, | ||
| "Vertica": ConnectionCategory.VERTICA, | ||
| "Pinecone": ConnectionCategory.PINECONE, | ||
| "Cassandra": ConnectionCategory.CASSANDRA, | ||
| "Couchbase": ConnectionCategory.COUCHBASE, | ||
| "MongoDbV2": ConnectionCategory.MONGO_DB_V2, | ||
| "MongoDbAtlas": ConnectionCategory.MONGO_DB_ATLAS, | ||
| "AmazonS3Compatible": ConnectionCategory.AMAZON_S3_COMPATIBLE, | ||
| "FileServer": ConnectionCategory.FILE_SERVER, | ||
| "FtpServer": ConnectionCategory.FTP_SERVER, | ||
| "GoogleCloudStorage": ConnectionCategory.GOOGLE_CLOUD_STORAGE, | ||
| "Hdfs": ConnectionCategory.HDFS, | ||
| "OracleCloudStorage": ConnectionCategory.ORACLE_CLOUD_STORAGE, | ||
| "Sftp": ConnectionCategory.SFTP, | ||
| "GenericHttp": ConnectionCategory.GENERIC_HTTP, | ||
| "ODataRest": ConnectionCategory.O_DATA_REST, | ||
| "Odbc": ConnectionCategory.ODBC, | ||
| "GenericRest": ConnectionCategory.GENERIC_REST, | ||
| "AmazonMws": ConnectionCategory.AMAZON_MWS, | ||
| "Concur": ConnectionCategory.CONCUR, | ||
| "Dynamics": ConnectionCategory.DYNAMICS, | ||
| "DynamicsAx": ConnectionCategory.DYNAMICS_AX, | ||
| "DynamicsCrm": ConnectionCategory.DYNAMICS_CRM, | ||
| "GoogleAdWords": ConnectionCategory.GOOGLE_AD_WORDS, | ||
| "Hubspot": ConnectionCategory.HUBSPOT, | ||
| "Jira": ConnectionCategory.JIRA, | ||
| "Magento": ConnectionCategory.MAGENTO, | ||
| "Marketo": ConnectionCategory.MARKETO, | ||
| "Office365": ConnectionCategory.OFFICE365, | ||
| "Eloqua": ConnectionCategory.ELOQUA, | ||
| "Responsys": ConnectionCategory.RESPONSYS, | ||
| "OracleServiceCloud": ConnectionCategory.ORACLE_SERVICE_CLOUD, | ||
| "PayPal": ConnectionCategory.PAY_PAL, | ||
| "QuickBooks": ConnectionCategory.QUICK_BOOKS, | ||
| "Salesforce": ConnectionCategory.SALESFORCE, | ||
| "SalesforceServiceCloud": ConnectionCategory.SALESFORCE_SERVICE_CLOUD, | ||
| "SalesforceMarketingCloud": ConnectionCategory.SALESFORCE_MARKETING_CLOUD, | ||
| "SapCloudForCustomer": ConnectionCategory.SAP_CLOUD_FOR_CUSTOMER, | ||
| "SapEcc": ConnectionCategory.SAP_ECC, | ||
| "ServiceNow": ConnectionCategory.SERVICE_NOW, | ||
| "SharePointOnlineList": ConnectionCategory.SHARE_POINT_ONLINE_LIST, | ||
| "Shopify": ConnectionCategory.SHOPIFY, | ||
| "Square": ConnectionCategory.SQUARE, | ||
| "WebTable": ConnectionCategory.WEB_TABLE, | ||
| "Xero": ConnectionCategory.XERO, | ||
| "Zoho": ConnectionCategory.ZOHO, | ||
| "GenericContainerRegistry": ConnectionCategory.GENERIC_CONTAINER_REGISTRY, | ||
| "Elasticsearch": ConnectionCategory.ELASTICSEARCH, | ||
| "OpenAI": ConnectionCategory.OPEN_AI, | ||
| "OpenAi": ConnectionCategory.OPEN_AI, | ||
| "Serp": ConnectionCategory.SERP, | ||
| "BingLLMSearch": ConnectionCategory.BING_LLM_SEARCH, | ||
| "Serverless": ConnectionCategory.SERVERLESS, | ||
| "ManagedOnlineEndpoint": ConnectionCategory.MANAGED_ONLINE_ENDPOINT, | ||
| # The following are from azure.ai.ml.constants._common.ConnectionTypes | ||
| "Custom": ConnectionCategory.CUSTOM_KEYS, | ||
| "AzureDataLakeGen2": ConnectionCategory.ADLS_GEN2, | ||
| "AzureContentSafety": ConnectionCategory.COGNITIVE_SERVICE, | ||
| "AzureSpeechServices": ConnectionCategory.COGNITIVE_SERVICE, | ||
| "AzureAiSearch": ConnectionCategory.COGNITIVE_SEARCH, | ||
| "AzureAiServices": ConnectionCategory.AI_SERVICES, | ||
| } | ||
|
|
||
|
|
||
| def get_valid_mlconn_types(): | ||
| return list(_ML_CONNECTION_TYPE_TO_COGNITIVE_SERVICES_CONNECTION_TYPE.keys()) | ||
|
|
||
|
|
||
| def get_mapped_mlconn_type(ml_connection_type: str): | ||
| from . _utils import snake_to_camel | ||
| normalized_name = snake_to_camel(ml_connection_type) | ||
| return _ML_CONNECTION_TYPE_TO_COGNITIVE_SERVICES_CONNECTION_TYPE.get(normalized_name) |
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
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The help text starts with 'Use' which is not in the active voice first person. Consider rephrasing to start with an active first-person verb like 'Generate' or 'Assign'.