File: test-resources.bicep

package info (click to toggle)
python-azure 20230112%2Bgit-1
  • links: PTS, VCS
  • area: main
  • in suites: bookworm
  • size: 749,544 kB
  • sloc: python: 6,815,827; javascript: 287; makefile: 195; xml: 109; sh: 105
file content (51 lines) | stat: -rw-r--r-- 2,067 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
param isPublicCloud bool = environment().name == 'AzureCloud'
param searchEndpointSuffix string = 'search.windows.net'
param storageEndpointSuffix string = 'core.windows.net'
param location string = '${resourceGroup().location}'
param searchSku string = 'standard'
param searchServiceName string = 'search-${uniqueString(resourceGroup().id)}'
param searchApiVersion string = '2021-04-01-Preview'
param storageAccountName string = 'storage${uniqueString(resourceGroup().id)}'
param storageContainerName string = 'storage-container-${resourceGroup().name}'
param storageApiVersion string = '2021-06-01'


resource searchService 'Microsoft.Search/searchServices@2021-04-01-Preview' = {
  name: searchServiceName
  location: location // semantic search is available here
  sku: {
    name: searchSku
  }
  properties:  isPublicCloud ? {
    semanticSearch: 'standard'
  } : {}
}

resource storageService 'Microsoft.Storage/storageAccounts@2021-06-01' = {
  name: storageAccountName
  location: location
  sku: {
    /* cspell:disable-next-line */
    name: 'Standard_RAGRS'
  }
  kind: 'StorageV2'
  properties: {
    accessTier: 'Hot'
    supportsHttpsTrafficOnly: true
  }
}

resource container 'Microsoft.Storage/storageAccounts/blobServices/containers@2021-06-01' = {
  name: '${storageAccountName}/default/${storageContainerName}'
  dependsOn: [
    storageService
  ]
}

output search_service_endpoint string = 'https://${searchServiceName}.${searchEndpointSuffix}'
output search_service_api_key string = searchService.listAdminKeys(searchApiVersion).primaryKey
output search_query_api_key string = searchService.listQueryKeys(searchApiVersion).value[0].key
output search_service_name string = searchServiceName
output search_storage_connection_string string = 'DefaultEndpointsProtocol=https;AccountName=${storageAccountName};AccountKey=${storageService.listKeys(storageApiVersion).keys[0].value};EndpointSuffix=${storageEndpointSuffix}'
output search_storage_container_name string = storageContainerName
output search_endpoint_suffix string = searchEndpointSuffix