diff --git a/cli/azd/internal/scaffold/testdata/TestExecInfra-API_only/abbreviations.json b/cli/azd/internal/scaffold/testdata/TestExecInfra-API_only/abbreviations.json deleted file mode 100644 index dc62141f9da..00000000000 --- a/cli/azd/internal/scaffold/testdata/TestExecInfra-API_only/abbreviations.json +++ /dev/null @@ -1,135 +0,0 @@ -{ - "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", - "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-" -} diff --git a/cli/azd/internal/scaffold/testdata/TestExecInfra-API_only/main.bicep b/cli/azd/internal/scaffold/testdata/TestExecInfra-API_only/main.bicep deleted file mode 100644 index 52fee11a6e6..00000000000 --- a/cli/azd/internal/scaffold/testdata/TestExecInfra-API_only/main.bicep +++ /dev/null @@ -1,48 +0,0 @@ -targetScope = 'subscription' - -@minLength(1) -@maxLength(64) -@description('Name of the environment that can be used as part of naming resource convention') -param environmentName string - -@minLength(1) -@description('Primary location for all resources') -param location string - -param apiExists bool -@secure() -param apiDefinition object - -@description('Id of the user or app to assign application roles') -param principalId string - -// Tags that should be applied to all resources. -// -// Note that 'azd-service-name' tags should be applied separately to service host resources. -// Example usage: -// tags: union(tags, { 'azd-service-name': }) -var tags = { - 'azd-env-name': environmentName -} - -// Organize resources in a resource group -resource rg 'Microsoft.Resources/resourceGroups@2021-04-01' = { - name: 'rg-${environmentName}' - location: location - tags: tags -} - -module resources 'resources.bicep' = { - scope: rg - name: 'resources' - params: { - location: location - tags: tags - principalId: principalId - apiExists: apiExists - apiDefinition: apiDefinition - } -} -output AZURE_CONTAINER_REGISTRY_ENDPOINT string = resources.outputs.AZURE_CONTAINER_REGISTRY_ENDPOINT -output AZURE_KEY_VAULT_ENDPOINT string = resources.outputs.AZURE_KEY_VAULT_ENDPOINT -output AZURE_KEY_VAULT_NAME string = resources.outputs.AZURE_KEY_VAULT_NAME diff --git a/cli/azd/internal/scaffold/testdata/TestExecInfra-API_only/main.parameters.json b/cli/azd/internal/scaffold/testdata/TestExecInfra-API_only/main.parameters.json deleted file mode 100644 index 6d98042dfb3..00000000000 --- a/cli/azd/internal/scaffold/testdata/TestExecInfra-API_only/main.parameters.json +++ /dev/null @@ -1,37 +0,0 @@ -{ - "$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentParameters.json#", - "contentVersion": "1.0.0.0", - "parameters": { - "environmentName": { - "value": "${AZURE_ENV_NAME}" - }, - "location": { - "value": "${AZURE_LOCATION}" - }, - "apiExists": { - "value": "${SERVICE_API_RESOURCE_EXISTS=false}" - }, - "apiDefinition": { - "value": { - "settings": [ - { - "name": "", - "value": "${VAR}", - "_comment_name": "The name of the environment variable when running in Azure. If empty, ignored.", - "_comment_value": "The value to provide. This can be a fixed literal, or an expression like ${VAR} to use the value of 'VAR' from the current environment." - }, - { - "name": "", - "value": "${VAR_S}", - "secret": true, - "_comment_name": "The name of the environment variable when running in Azure. If empty, ignored.", - "_comment_value": "The value to provide. This can be a fixed literal, or an expression like ${VAR_S} to use the value of 'VAR_S' from the current environment." - } - ] - } - }, - "principalId": { - "value": "${AZURE_PRINCIPAL_ID}" - } - } -} diff --git a/cli/azd/internal/scaffold/testdata/TestExecInfra-API_only/modules/fetch-container-image.bicep b/cli/azd/internal/scaffold/testdata/TestExecInfra-API_only/modules/fetch-container-image.bicep deleted file mode 100644 index 78d1e7eeb5e..00000000000 --- a/cli/azd/internal/scaffold/testdata/TestExecInfra-API_only/modules/fetch-container-image.bicep +++ /dev/null @@ -1,8 +0,0 @@ -param exists bool -param name string - -resource existingApp 'Microsoft.App/containerApps@2023-05-02-preview' existing = if (exists) { - name: name -} - -output containers array = exists ? existingApp.properties.template.containers : [] diff --git a/cli/azd/internal/scaffold/testdata/TestExecInfra-API_only/resources.bicep b/cli/azd/internal/scaffold/testdata/TestExecInfra-API_only/resources.bicep deleted file mode 100644 index e7c9dcfa1ea..00000000000 --- a/cli/azd/internal/scaffold/testdata/TestExecInfra-API_only/resources.bicep +++ /dev/null @@ -1,174 +0,0 @@ -@description('The location used for all deployed resources') -param location string = resourceGroup().location - -@description('Tags that will be applied to all resources') -param tags object = {} - - -param apiExists bool -@secure() -param apiDefinition object - -@description('Id of the user or app to assign application roles') -param principalId string - -var abbrs = loadJsonContent('./abbreviations.json') -var resourceToken = uniqueString(subscription().id, resourceGroup().id, location) - -// Monitor application with Azure Monitor -module monitoring 'br/public:avm/ptn/azd/monitoring:0.1.0' = { - name: 'monitoring' - params: { - logAnalyticsName: '${abbrs.operationalInsightsWorkspaces}${resourceToken}' - applicationInsightsName: '${abbrs.insightsComponents}${resourceToken}' - applicationInsightsDashboardName: '${abbrs.portalDashboards}${resourceToken}' - location: location - tags: tags - } -} - -// Container registry -module containerRegistry 'br/public:avm/res/container-registry/registry:0.1.1' = { - name: 'registry' - params: { - name: '${abbrs.containerRegistryRegistries}${resourceToken}' - location: location - acrAdminUserEnabled: true - tags: tags - publicNetworkAccess: 'Enabled' - roleAssignments:[ - { - principalId: apiIdentity.outputs.principalId - principalType: 'ServicePrincipal' - roleDefinitionIdOrName: subscriptionResourceId('Microsoft.Authorization/roleDefinitions', '7f951dda-4ed3-4680-a7ca-43fe172d538d') - } - ] - } -} - -// Container apps environment -module containerAppsEnvironment 'br/public:avm/res/app/managed-environment:0.4.5' = { - name: 'container-apps-environment' - params: { - logAnalyticsWorkspaceResourceId: monitoring.outputs.logAnalyticsWorkspaceResourceId - name: '${abbrs.appManagedEnvironments}${resourceToken}' - location: location - zoneRedundant: false - } -} - -module apiIdentity 'br/public:avm/res/managed-identity/user-assigned-identity:0.2.1' = { - name: 'apiidentity' - params: { - name: '${abbrs.managedIdentityUserAssignedIdentities}api-${resourceToken}' - location: location - } -} - -module apiFetchLatestImage './modules/fetch-container-image.bicep' = { - name: 'api-fetch-image' - params: { - exists: apiExists - name: 'api' - } -} - -var apiAppSettingsArray = filter(array(apiDefinition.settings), i => i.name != '') -var apiSecrets = map(filter(apiAppSettingsArray, i => i.?secret != null), i => { - name: i.name - value: i.value - secretRef: i.?secretRef ?? take(replace(replace(toLower(i.name), '_', '-'), '.', '-'), 32) -}) -var apiEnv = map(filter(apiAppSettingsArray, i => i.?secret == null), i => { - name: i.name - value: i.value -}) - -module api 'br/public:avm/res/app/container-app:0.8.0' = { - name: 'api' - params: { - name: 'api' - ingressTargetPort: 3100 - scaleMinReplicas: 1 - scaleMaxReplicas: 10 - secrets: { - secureList: union([ - ], - map(apiSecrets, secret => { - name: secret.secretRef - value: secret.value - })) - } - containers: [ - { - image: apiFetchLatestImage.outputs.?containers[?0].?image ?? 'mcr.microsoft.com/azuredocs/containerapps-helloworld:latest' - name: 'main' - resources: { - cpu: json('0.5') - memory: '1.0Gi' - } - env: union([ - { - name: 'APPLICATIONINSIGHTS_CONNECTION_STRING' - value: monitoring.outputs.applicationInsightsConnectionString - } - { - name: 'AZURE_CLIENT_ID' - value: apiIdentity.outputs.clientId - } - { - name: 'PORT' - value: '3100' - } - ], - apiEnv, - map(apiSecrets, secret => { - name: secret.name - secretRef: secret.secretRef - })) - } - ] - managedIdentities:{ - systemAssigned: false - userAssignedResourceIds: [apiIdentity.outputs.resourceId] - } - registries:[ - { - server: containerRegistry.outputs.loginServer - identity: apiIdentity.outputs.resourceId - } - ] - environmentResourceId: containerAppsEnvironment.outputs.resourceId - location: location - tags: union(tags, { 'azd-service-name': 'api' }) - } -} -// Create a keyvault to store secrets -module keyVault 'br/public:avm/res/key-vault/vault:0.6.1' = { - name: 'keyvault' - params: { - name: '${abbrs.keyVaultVaults}${resourceToken}' - location: location - tags: tags - enableRbacAuthorization: false - accessPolicies: [ - { - objectId: principalId - permissions: { - secrets: [ 'get', 'list' ] - } - } - { - objectId: apiIdentity.outputs.principalId - permissions: { - secrets: [ 'get', 'list' ] - } - } - ] - secrets: [ - ] - } -} -output AZURE_CONTAINER_REGISTRY_ENDPOINT string = containerRegistry.outputs.loginServer -output AZURE_KEY_VAULT_ENDPOINT string = keyVault.outputs.uri -output AZURE_KEY_VAULT_NAME string = keyVault.outputs.name