From ea3c3b9cd0cc47eadee53f294dd23bdc1175131a Mon Sep 17 00:00:00 2001 From: kylebunting Date: Mon, 16 Sep 2024 15:45:56 -0600 Subject: [PATCH] Minor bicep updates --- docs/01_deploy_app_resources/0101.md | 6 ++++-- .../DeployApimAndRedisResources.bicep | 11 ++++++++--- src/InfrastructureAsCode/DeployAzureResources.bicep | 2 +- 3 files changed, 13 insertions(+), 6 deletions(-) diff --git a/docs/01_deploy_app_resources/0101.md b/docs/01_deploy_app_resources/0101.md index 33283ef78..b26c45503 100644 --- a/docs/01_deploy_app_resources/0101.md +++ b/docs/01_deploy_app_resources/0101.md @@ -69,12 +69,14 @@ The key tasks are as follows: 7. Use the `DeployAzureResources.bicep` script in the `src/InfrastructureAsCode/` folder to deploy resources out. {: .note } - > You may receive an error while running this that you must accept the Responsible AI Notice before creating a TextAnalytics (Language) service. To do so, open the [Azure Portal](https://portal.azure.com) and search for "Language" in the menu. Choose the **Language** service and then select Create. On the first page of the form, select the **Continue to create your resource** button at the bottom of the screen. Then, check the box certifying that you have reviewed and acknowledge the terms in the Responsible AI Notice. You can then close the Create Language page and try running the Bicep script again. + > You may receive an error while running this that you must accept the Responsible AI Notice before creating a TextAnalytics (Language) service. To do so, open the [Azure Portal](https://portal.azure.com/) and search for "Language" in the menu. Choose the **Language** service and then select Create. On the first page of the form, select the **Continue to create your resource** button at the bottom of the screen. Then, check the box certifying that you have reviewed and acknowledge the terms in the Responsible AI Notice. You can then close the Create Language page and try running the Bicep script again. 8. Use the `DeployApimAndRedisResource.bicep` script in the `src/InfrastructureAsCode/` folder to deploy **Azure API Management** and **Azure Cache for Redis Enterprise** resources into your resource group. + **Azure API Management** and **Azure Cache for Redis Enterprise** resources can take a longer time to deploy, so they are provided in a separate file. You do not have to wait for the deployment of these resources to complete before starting on the remaining tasks in this exercise. + {: .note } - > **Azure API Management** and **Azure Cache for Redis Enterprise** resources can take a longer time to deploy, so they are provided in a separate file. You do not have to wait for the deployment of these resources to complete before starting on the remaining tasks in this exercise. + > You may receive an error while running this Bicep script related to a terminal provisioning state for the Redis Enterprise database. This may happen because you have not agreed to the legal terms and privacy statements associated with using Marketplace offerings in your subscription. To do so, open the [Azure Portal](https://portal.azure.com/), select **Create a resource** from the menu, and search for "Azure Cache for Redis". Choose the **Azure Cache for Redis** service and select Create. On the **Basics** tab of the **New Redis Cache** page, choose the **Enterprise** option under **Cache SKU**. This selection will display a **Terms** section on the form. Check the box agreeing to the legal terms and privacy statements associated with the Marketplace offering. You can then close the Create Language page and try running the Bicep script again. ## Success Criteria diff --git a/src/InfrastructureAsCode/DeployApimAndRedisResources.bicep b/src/InfrastructureAsCode/DeployApimAndRedisResources.bicep index 0659a3109..1d1c2a0d6 100644 --- a/src/InfrastructureAsCode/DeployApimAndRedisResources.bicep +++ b/src/InfrastructureAsCode/DeployApimAndRedisResources.bicep @@ -13,6 +13,9 @@ var redisCacheName = '${uniqueString(resourceGroup().id)}-redis' var redisCacheSku = 'Enterprise_E1' var redisCacheCapacity = 2 +@description('Restore the service instead of creating a new instance. This is useful if you previously soft-deleted the service and want to restore it. If you are restoring a service, set this to true. Otherwise, leave this as false.') +param restore bool = false + resource apiManagementService 'Microsoft.ApiManagement/service@2023-09-01-preview' = { name: apiManagementServiceName location: location @@ -26,6 +29,7 @@ resource apiManagementService 'Microsoft.ApiManagement/service@2023-09-01-previe properties: { publisherEmail: apimPublisherEmail publisherName: apimPublisherName + restore: restore } } @@ -39,18 +43,19 @@ resource redisCache 'Microsoft.Cache/redisEnterprise@2024-03-01-preview' = { identity: { type: 'SystemAssigned' } - properties: {} } resource redisCacheDatabase 'Microsoft.Cache/redisEnterprise/databases@2024-03-01-preview' = { - parent: redisCache name: 'default' + parent: redisCache properties: { - clientProtocol: 'Encrypted' evictionPolicy: 'NoEviction' clusteringPolicy: 'EnterpriseCluster' deferUpgrade: 'NotDeferred' modules: [ + { + name: 'RedisJSON' + } { name: 'RediSearch' } diff --git a/src/InfrastructureAsCode/DeployAzureResources.bicep b/src/InfrastructureAsCode/DeployAzureResources.bicep index ff44f050c..b04054a15 100644 --- a/src/InfrastructureAsCode/DeployAzureResources.bicep +++ b/src/InfrastructureAsCode/DeployAzureResources.bicep @@ -18,7 +18,7 @@ param deployments array = [ } ] -@description('Restore the service instead of creating a new instance. This is useful if you previously soft-delted the service and want to restore it. If you are restoring a service, set this to true. Otherwise, leave this as false.') +@description('Restore the service instead of creating a new instance. This is useful if you previously soft-deleted the service and want to restore it. If you are restoring a service, set this to true. Otherwise, leave this as false.') param restore bool = false var cosmosDbName = '${uniqueString(resourceGroup().id)}-cosmosdb'