Skip to content

Commit

Permalink
Merge pull request #104 from Azure-Samples/azd-update
Browse files Browse the repository at this point in the history
Azd update - add ai studio to replace oai endpoint
  • Loading branch information
marlenezw authored Aug 7, 2024
2 parents 93ac7ff + 23bd71b commit 7f34621
Show file tree
Hide file tree
Showing 26 changed files with 1,031 additions and 198 deletions.
1 change: 1 addition & 0 deletions .github/workflows/azure-dev.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ jobs:
AZURE_OPENAI_4_EVAL_DEPLOYMENT_NAME: ${{ vars.AZURE_OPENAI_4_EVAL_DEPLOYMENT_NAME }}
AZURE_OPENAI_DEPLOYMENT_NAME: ${{ vars.AZURE_OPENAI_DEPLOYMENT_NAME }}
AZURE_OPENAI_35_TURBO_DEPLOYMENT_NAME: ${{ vars.AZURE_OPENAI_35_TURBO_DEPLOYMENT_NAME }}
AZURE_OPENAI_NAME: ${{ vars.AZURE_OPENAI_NAME }}
AZURE_SEARCH_ENDPOINT: ${{ vars.AZURE_SEARCH_ENDPOINT }}
BING_SEARCH_ENDPOINT: ${{ vars.BING_SEARCH_ENDPOINT }}
BING_SEARCH_KEY: ${{ secrets.BING_SEARCH_KEY }}
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/evaluate.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ jobs:
AZURE_OPENAI_35_TURBO_DEPLOYMENT_NAME: ${{ vars.AZURE_OPENAI_35_TURBO_DEPLOYMENT_NAME }}
AZURE_RESOURCE_GROUP: ${{ vars.AZURE_RESOURCE_GROUP }}
AZURE_SEARCH_ENDPOINT: ${{ vars.AZURE_SEARCH_ENDPOINT }}
AZURE_OPENAI_NAME: ${{ vars.AZURE_OPENAI_NAME }}
BING_SEARCH_ENDPOINT: ${{ vars.BING_SEARCH_ENDPOINT }}
BING_SEARCH_KEY: ${{ secrets.BING_SEARCH_KEY }}

Expand Down
1 change: 1 addition & 0 deletions azure.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -33,5 +33,6 @@ pipeline:
- AZURE_OPENAI_35_TURBO_DEPLOYMENT_NAME
- AZURE_SEARCH_ENDPOINT
- BING_SEARCH_ENDPOINT
- AZURE_OPENAI_NAME
secrets:
- BING_SEARCH_KEY
136 changes: 136 additions & 0 deletions infra/abbreviations.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,136 @@
{
"analysisServicesServers": "as",
"apiManagementService": "apim-",
"appConfigurationStores": "appcs-",
"appManagedEnvironments": "cae-",
"appContainerApps": "ca-",
"authorizationPolicyDefinitions": "policy-",
"automationAutomationAccounts": "aa-",
"blueprintBlueprints": "bp-",
"blueprintBlueprintsArtifacts": "bpa-",
"cacheRedis": "redis-",
"cdnProfiles": "cdnp-",
"cdnProfilesEndpoints": "cdne-",
"cognitiveServicesAccounts": "cog-",
"cognitiveServicesFormRecognizer": "cog-fr-",
"cognitiveServicesTextAnalytics": "cog-ta-",
"computeAvailabilitySets": "avail-",
"computeCloudServices": "cld-",
"computeDiskEncryptionSets": "des",
"computeDisks": "disk",
"computeDisksOs": "osdisk",
"computeGalleries": "gal",
"computeSnapshots": "snap-",
"computeVirtualMachines": "vm",
"computeVirtualMachineScaleSets": "vmss-",
"containerInstanceContainerGroups": "ci",
"containerRegistryRegistries": "cr",
"containerServiceManagedClusters": "aks-",
"databricksWorkspaces": "dbw-",
"dataFactoryFactories": "adf-",
"dataLakeAnalyticsAccounts": "dla",
"dataLakeStoreAccounts": "dls",
"dataMigrationServices": "dms-",
"dBforMySQLServers": "mysql-",
"dBforPostgreSQLServers": "psql-",
"devicesIotHubs": "iot-",
"devicesProvisioningServices": "provs-",
"devicesProvisioningServicesCertificates": "pcert-",
"documentDBDatabaseAccounts": "cosmos-",
"eventGridDomains": "evgd-",
"eventGridDomainsTopics": "evgt-",
"eventGridEventSubscriptions": "evgs-",
"eventHubNamespaces": "evhns-",
"eventHubNamespacesEventHubs": "evh-",
"hdInsightClustersHadoop": "hadoop-",
"hdInsightClustersHbase": "hbase-",
"hdInsightClustersKafka": "kafka-",
"hdInsightClustersMl": "mls-",
"hdInsightClustersSpark": "spark-",
"hdInsightClustersStorm": "storm-",
"hybridComputeMachines": "arcs-",
"insightsActionGroups": "ag-",
"insightsComponents": "appi-",
"keyVaultVaults": "kv-",
"kubernetesConnectedClusters": "arck",
"kustoClusters": "dec",
"kustoClustersDatabases": "dedb",
"loadTesting": "lt-",
"logicIntegrationAccounts": "ia-",
"logicWorkflows": "logic-",
"machineLearningServicesWorkspaces": "mlw-",
"managedIdentityUserAssignedIdentities": "id-",
"managementManagementGroups": "mg-",
"migrateAssessmentProjects": "migr-",
"networkApplicationGateways": "agw-",
"networkApplicationSecurityGroups": "asg-",
"networkAzureFirewalls": "afw-",
"networkBastionHosts": "bas-",
"networkConnections": "con-",
"networkDnsZones": "dnsz-",
"networkExpressRouteCircuits": "erc-",
"networkFirewallPolicies": "afwp-",
"networkFirewallPoliciesWebApplication": "waf",
"networkFirewallPoliciesRuleGroups": "wafrg",
"networkFrontDoors": "fd-",
"networkFrontdoorWebApplicationFirewallPolicies": "fdfp-",
"networkLoadBalancersExternal": "lbe-",
"networkLoadBalancersInternal": "lbi-",
"networkLoadBalancersInboundNatRules": "rule-",
"networkLocalNetworkGateways": "lgw-",
"networkNatGateways": "ng-",
"networkNetworkInterfaces": "nic-",
"networkNetworkSecurityGroups": "nsg-",
"networkNetworkSecurityGroupsSecurityRules": "nsgsr-",
"networkNetworkWatchers": "nw-",
"networkPrivateDnsZones": "pdnsz-",
"networkPrivateLinkServices": "pl-",
"networkPublicIPAddresses": "pip-",
"networkPublicIPPrefixes": "ippre-",
"networkRouteFilters": "rf-",
"networkRouteTables": "rt-",
"networkRouteTablesRoutes": "udr-",
"networkTrafficManagerProfiles": "traf-",
"networkVirtualNetworkGateways": "vgw-",
"networkVirtualNetworks": "vnet-",
"networkVirtualNetworksSubnets": "snet-",
"networkVirtualNetworksVirtualNetworkPeerings": "peer-",
"networkVirtualWans": "vwan-",
"networkVpnGateways": "vpng-",
"networkVpnGatewaysVpnConnections": "vcn-",
"networkVpnGatewaysVpnSites": "vst-",
"notificationHubsNamespaces": "ntfns-",
"notificationHubsNamespacesNotificationHubs": "ntf-",
"operationalInsightsWorkspaces": "log-",
"portalDashboards": "dash-",
"powerBIDedicatedCapacities": "pbi-",
"purviewAccounts": "pview-",
"recoveryServicesVaults": "rsv-",
"resourcesResourceGroups": "rg-",
"searchSearchServices": "srch-",
"serviceBusNamespaces": "sb-",
"serviceBusNamespacesQueues": "sbq-",
"serviceBusNamespacesTopics": "sbt-",
"serviceEndPointPolicies": "se-",
"serviceFabricClusters": "sf-",
"signalRServiceSignalR": "sigr",
"sqlManagedInstances": "sqlmi-",
"sqlServers": "sql-",
"sqlServersDataWarehouse": "sqldw-",
"sqlServersDatabases": "sqldb-",
"sqlServersDatabasesStretch": "sqlstrdb-",
"storageStorageAccounts": "st",
"storageStorageAccountsVm": "stvm",
"storSimpleManagers": "ssimp",
"streamAnalyticsCluster": "asa-",
"synapseWorkspaces": "syn",
"synapseWorkspacesAnalyticsWorkspaces": "synw",
"synapseWorkspacesSqlPoolsDedicated": "syndp",
"synapseWorkspacesSqlPoolsSpark": "synsp",
"timeSeriesInsightsEnvironments": "tsi-",
"webServerFarms": "plan-",
"webSitesAppService": "app-",
"webSitesAppServiceEnvironment": "ase-",
"webSitesFunctions": "func-",
"webStaticSites": "stapp-"
}
28 changes: 28 additions & 0 deletions infra/ai.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
# yaml-language-server: $schema=ai.yaml.json

deployments:
- name: gpt-35-turbo
model:
format: OpenAI
name: gpt-35-turbo
version: "0613"
sku:
name: Standard
capacity: 20
- name: text-embedding-ada-002
model:
format: OpenAI
name: text-embedding-ada-002
version: "2"
sku:
name: "Standard"
capacity: 20
- name: gpt-4
model:
format: OpenAI
name: gpt-4o
version: "2024-05-13"
sku:
name: "Standard"
capacity: 20

70 changes: 70 additions & 0 deletions infra/ai.yaml.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,70 @@
{
"$schema": "http://json-schema.org/draft-07/schema#",
"type": "object",
"properties": {
"deployments": {
"type": "array",
"title": "The Azure Open AI model deployments",
"description": "Deploys the listed Azure Open AI models to an Azure Open AI service",
"items": {
"type": "object",
"properties": {
"name": {
"type": "string",
"title": "The model deployment name"
},
"model": {
"type": "object",
"title": "The Azure Open AI model to deploy",
"description": "Full list of supported models and versions are available at https://learn.microsoft.com/azure/ai-services/openai/concepts/models",
"properties": {
"format": {
"type": "string",
"default": "OpenAI",
"title": "The format of the model"
},
"name": {
"type": "string",
"title": "The well known name of the model."
},
"version": {
"type": "string",
"title": "The well known version of the model."
}
},
"required": [
"format",
"name",
"version"
]
},
"sku": {
"type": "object",
"title": "The SKU to use for deployment. Defaults to Standard with 20 capacity if not specified",
"properties": {
"name": {
"type": "string",
"title": "The SKU name of the deployment. Defaults to Standard if not specified"
},
"capacity": {
"type": "integer",
"title": "The capacity of the deployment. Defaults to 20 if not specified"
}
},
"required": [
"name",
"capacity"
]
}
},
"required": [
"name",
"model"
]
}
}
},
"required": [
"deployments"
]
}
12 changes: 9 additions & 3 deletions infra/app/aca.bicep
Original file line number Diff line number Diff line change
Expand Up @@ -8,20 +8,22 @@ param containerAppsEnvironmentName string
param containerRegistryName string
param serviceName string = 'aca'

@secure()
param bingApiKey string
param bingApiEndpoint string
param openAi_35_turbo_DeploymentName string
param openAi_4_DeploymentName string
param openAi_4_eval_DeploymentName string
param openAiEndpoint string
param openAiName string
param openAiApiVersion string
param openAiEmbeddingDeploymentName string
param openAiType string
param aiSearchEndpoint string
param aiSearchIndexName string
param appinsights_Connectionstring string

@secure()
param bingApiKey string
param bingApiEndpoint string


module app '../core/host/container-app-upsert.bicep' = {
name: '${serviceName}-container-app-module'
Expand Down Expand Up @@ -61,6 +63,10 @@ module app '../core/host/container-app-upsert.bicep' = {
name: 'AZURE_OPENAI_ENDPOINT'
value: openAiEndpoint
}
{
name: 'AZURE_OPENAI_NAME'
value: openAiName
}
{
name: 'AZURE_OPENAI_35_TURBO_DEPLOYMENT_NAME'
value: openAi_35_turbo_DeploymentName
Expand Down
1 change: 1 addition & 0 deletions infra/core/ai/cognitiveservices.bicep
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@ resource deployment 'Microsoft.CognitiveServices/accounts/deployments@2023-05-01
}]

output endpoint string = account.properties.endpoint
output endpoints object = account.properties.endpoints
output id string = account.id
output name string = account.name
output skuName string = account.sku.name
Loading

0 comments on commit 7f34621

Please sign in to comment.