Skip to content

chore: tf-azure-ai-foundry#43

Merged
eugbyte merged 13 commits into
mainfrom
chore/tf-azure-ai-foundry
Oct 5, 2025
Merged

chore: tf-azure-ai-foundry#43
eugbyte merged 13 commits into
mainfrom
chore/tf-azure-ai-foundry

Conversation

@eugbyte
Copy link
Copy Markdown
Owner

@eugbyte eugbyte commented Oct 4, 2025

No description provided.

@eugbyte eugbyte marked this pull request as ready for review October 5, 2025 01:54
@eugbyte eugbyte requested a review from Copilot October 5, 2025 01:55
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR refactors Azure AI Foundry Content Safety integration to create the resource via Terraform instead of using external variables. The changes make the content safety service optional and improve error handling.

  • Adds Terraform resource for Azure Cognitive Account (Content Safety)
  • Makes Content Safety client optional with graceful error handling
  • Removes external variables in favor of direct resource references

Reviewed Changes

Copilot reviewed 7 out of 8 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
ObjectStorageService.cs Refactored constructor to make Content Safety client optional with error handling
EmailBackgroundService.cs Simplified logger extension usage
BookingService.cs Removed unused Exists method
Settings.cs Added ReSharper suppressions for model class
variables.tf Removed Content Safety external variables
container-app.tf Updated environment variables to use Terraform resource references
ai-content-moderation.tf Added new Terraform resource for Content Safety service

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

Comment on lines +28 to +29
// silence the error
_logger.LogError("error creating content safety client: {}. Content moderation skipped.", ex.Message);
Copy link

Copilot AI Oct 5, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The error message uses a placeholder '{}' which is not standard for .NET logging. Use '{Message}' or positional parameters like '{0}' for proper structured logging.

Copilot uses AI. Check for mistakes.
response = await _contentSafetyClient.AnalyzeImageAsync(request);
} catch (RequestFailedException ex) {
logger.LogContentModerationError(ex.Status.ToString(), ex.ErrorCode ?? "", ex.Message);
_logger.LogContentModerationError(statusCode: ex.Status.ToString(), errorCode: ex.ErrorCode ?? "", ex.Message);
Copy link

Copilot AI Oct 5, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The named parameter 'statusCode:' is inconsistent with the other unnamed parameters. Either use named parameters for all arguments or remove the named parameter for consistency.

Suggested change
_logger.LogContentModerationError(statusCode: ex.Status.ToString(), errorCode: ex.ErrorCode ?? "", ex.Message);
_logger.LogContentModerationError(ex.Status.ToString(), ex.ErrorCode ?? "", ex.Message);

Copilot uses AI. Check for mistakes.
@eugbyte eugbyte merged commit cd8991e into main Oct 5, 2025
4 of 5 checks passed
@eugbyte eugbyte deleted the chore/tf-azure-ai-foundry branch October 5, 2025 02:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants