Skip to content
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

File cognitiveservices.bicep does not include the networkAcls property #250

Open
gillesev opened this issue Dec 6, 2023 · 7 comments
Open
Labels
bug Something isn't working

Comments

@gillesev
Copy link

gillesev commented Dec 6, 2023

The file https://github.com/Azure-Samples/azure-search-openai-demo-csharp/blob/main/infra/core/ai/cognitiveservices.bicep should be (following fix Azure-Samples/azure-search-openai-demo#799 issued for the python version of the azure-search-openai-demo):

metadata description = 'Creates an Azure Cognitive Services instance.'
param name string
param location string = resourceGroup().location
param tags object = {}
@description('The custom subdomain name used to access the API. Defaults to the value of the name parameter.')
param customSubDomainName string = name
param deployments array = []
param kind string = 'OpenAI'

@Allowed([ 'Enabled', 'Disabled' ])
param publicNetworkAccess string = 'Enabled'
param sku object = {
name: 'S0'
}

param allowedIpRules array = []
param networkAcls object = empty(allowedIpRules) ? {
defaultAction: 'Allow'
} : {
ipRules: allowedIpRules
defaultAction: 'Deny'
}

resource account 'Microsoft.CognitiveServices/accounts@2023-05-01' = {
name: name
location: location
tags: tags
kind: kind
properties: {
customSubDomainName: customSubDomainName
publicNetworkAccess: publicNetworkAccess
networkAcls: networkAcls
}
sku: sku
}

@batchsize(1)
resource deployment 'Microsoft.CognitiveServices/accounts/deployments@2023-05-01' = [for deployment in deployments: {
parent: account
name: deployment.name
properties: {
model: deployment.model
raiPolicyName: contains(deployment, 'raiPolicyName') ? deployment.raiPolicyName : null
}
sku: contains(deployment, 'sku') ? deployment.sku : {
name: 'Standard'
capacity: 20
}
}]

output endpoint string = account.properties.endpoint
output id string = account.id
output name string = account.name

@luisquintanilla
Copy link
Collaborator

Hi @gillesev,

Are you running into issues deploying the app because of this or are you noting that there are differences?

cc @jongio for visibility

@gillesev
Copy link
Author

@luisquintanilla : indeed, when running the azd up command, I would receive an error related to the 'Document intelligence' resource being provisioned: "BadRequest: NetworkAcls is required for this resource." See the error that had been reported for the sister python project: Azure-Samples/azure-search-openai-demo#799).

@luisquintanilla
Copy link
Collaborator

@gillesev and to confirm, you're running the latest version in the main branch?

@gillesev
Copy link
Author

Yes

@jongio
Copy link
Member

jongio commented Jan 2, 2024

Here's the latest for AI cognitive services: https://github.com/Azure/azure-dev/blob/main/templates/common/infra/bicep/core/ai/cognitiveservices.bicep - You'll need to copy that over to this project.

@Rickcau
Copy link

Rickcau commented Jan 11, 2024

I am getting this networkAcls error on my openai service. Has this fix not been merged to main yet? Basically, I already have AI and Cog Services up and running and working with other solutions. I simply want to run this sample in Codespaces and play around. I therefore run all the azd env set commands to setup AOPEN AI variables in the .env. The deployment fails on the openai service. Take a look at the screenshot below for more details.

Deploy-Failure

@jongio
Copy link
Member

jongio commented Jan 11, 2024

@Rickcau Try replacing your infra/core/ai/cognitiveservices.bicep file with the one found here and run it again.

https://github.com/Azure/azure-dev/blob/main/templates/common/infra/bicep/core/ai/cognitiveservices.bicep

Sorry for hassle, we are working on making this easier.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

4 participants