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

fix: Correctly set computer vision location #1045

Merged
merged 2 commits into from
Jun 18, 2024
Merged

fix: Correctly set computer vision location #1045

merged 2 commits into from
Jun 18, 2024

Conversation

adamdougal
Copy link
Collaborator

@adamdougal adamdougal commented Jun 13, 2024

  • This was causing the deployment to fail when advanced image processing
    was enabled as it overrides the default location in the main.bicep
    to ""

- This was causing the deployment to fail when advanced image processing
  was enabled as it overrides the default location in the `main.bicep`
  to ''
- Tried adding the same logic to the `main.bicepparam` file but it
  clashes with the validation in the `main.bicep`
Copy link

github-actions bot commented Jun 13, 2024

Coverage

Coverage Report •
FileStmtsMissCoverMissing
TOTAL257757377% 
report-only-changed-files is enabled. No files were changed during this commit :)

Tests Skipped Failures Errors Time
288 0 💤 0 ❌ 0 🔥 38.372s ⏱️

@cecheta
Copy link
Collaborator

cecheta commented Jun 18, 2024

Would this work?

@description('Location of Computer Vision Resource (if useAdvancedImageProcessing=true)')
@allowed([
  // List taken from https://learn.microsoft.com/en-us/azure/ai-services/computer-vision/how-to/image-retrieval?tabs=python#prerequisites
  'eastus'
  'westus'
  'koreacentral'
  'francecentral'
  'northeurope'
  'westeurope'
  'southeastasia'
  ''
])
param computerVisionLocation string = ''

...

module computerVision 'core/ai/cognitiveservices.bicep' = if (useAdvancedImageProcessing) {
  name: 'computerVision'
  scope: rg
  params: {
    name: computerVisionName
    kind: 'ComputerVision'
    location: computerVisionLocation != '' ? computerVisionLocation : location
    tags: tags
    sku: {
      name: computerVisionSkuName
    }
  }
}

@adamdougal adamdougal changed the title fix: Remove computer vision location param from bicep param file fix: Correctly set computer vision location Jun 18, 2024
@adamdougal
Copy link
Collaborator Author

@cecheta Great suggestion! That appears to work perfectly. Might be worth turning off whitespace in the review tab as it looks like my IDE auto formatted the files

@cecheta
Copy link
Collaborator

cecheta commented Jun 18, 2024

@cecheta Great suggestion! That appears to work perfectly. Might be worth turning off whitespace in the review tab as it looks like my IDE auto formatted the files

Pre-commit should be formatting the files, but looks like you're using an old version of bicep

@adamdougal adamdougal added this pull request to the merge queue Jun 18, 2024
Merged via the queue into main with commit 4d5dee0 Jun 18, 2024
13 checks passed
@adamdougal adamdougal deleted the cvlocation branch June 18, 2024 15:37
Copy link

🎉 This PR is included in version 1.6.0 🎉

The release is available on GitHub release

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants