Skip to content

Make sure functions aren't marked as App Services - #41327

Merged
Jeremy Voss (jeremydvoss) merged 3 commits into
Azure:mainfrom
jeremydvoss:func-vs-appsvc
May 29, 2025
Merged

Make sure functions aren't marked as App Services#41327
Jeremy Voss (jeremydvoss) merged 3 commits into
Azure:mainfrom
jeremydvoss:func-vs-appsvc

Conversation

@jeremydvoss

Copy link
Copy Markdown
Member

Description

Functions can have WEBSITE_SITENAME. Make sure prefix does not count functions as app services.

All SDK Contribution checklist:

  • The pull request does not introduce [breaking changes]
  • CHANGELOG is updated for new features, bug fixes or other significant changes.
  • I have read the contribution guidelines.

General Guidelines and Best Practices

  • Title of the pull request is clear and informative.
  • There are a small number of commits, each of which have an informative message. This means that previously merged commits do not appear in the history of the PR. For more information on cleaning up the commits in your PR, see this page.

Testing Guidelines

  • Pull request includes test coverage for the included changes.

@github-actions github-actions Bot added the Monitor - Exporter Monitor OpenTelemetry Exporter label May 28, 2025
@jeremydvoss Jeremy Voss (jeremydvoss) changed the title Make sure functions aren't marked as windows Make sure functions aren't marked as App Services May 28, 2025
@jeremydvoss
Jeremy Voss (jeremydvoss) marked this pull request as ready for review May 28, 2025 17:45
Copilot AI review requested due to automatic review settings May 28, 2025 17:45

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

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 ensures that Azure Functions environments are detected before App Service in the attach logic so Functions sites aren’t misclassified as App Service.

  • Reordered conditions in _is_attach_enabled to check for Functions first, then App Service.
  • Updated test cases to include WEBSITE_SITE_NAME alongside FUNCTIONS_WORKER_RUNTIME.
  • Added a CHANGELOG entry for this bug fix.

Reviewed Changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 1 comment.

File Description
_utils.py Swapped order of _is_on_functions() and _is_on_app_service() checks in _is_attach_enabled.
tests/test_utils.py Added WEBSITE_SITE_NAME to environment patches for Functions tests.
CHANGELOG.md Documented the fix for not counting Functions as App Service.

Comment thread sdk/monitor/azure-monitor-opentelemetry-exporter/CHANGELOG.md Outdated
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Monitor - Exporter Monitor OpenTelemetry Exporter

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants