diff --git a/iotedgedev/modules.py b/iotedgedev/modules.py
index d36367e..8b058ba 100644
--- a/iotedgedev/modules.py
+++ b/iotedgedev/modules.py
@@ -84,31 +84,30 @@ class Modules:
         tags_to_build = set()
 
         for module in os.listdir(self.envvars.MODULES_PATH):
-            if module not in bypass_modules:
-                module_dir = os.path.join(self.envvars.MODULES_PATH, module)
-                module_json = Module(self.output, self.utility, os.path.join(module_dir, "module.json"))
-                for platform in module_json.platforms:
-                    # get the Dockerfile from module.json
-                    dockerfile = os.path.abspath(os.path.join(module_dir, module_json.get_dockerfile_by_platform(platform)))
-                    container_tag = "" if self.envvars.CONTAINER_TAG == "" else "-" + self.envvars.CONTAINER_TAG
-                    tag = "{0}:{1}{2}-{3}".format(module_json.repository, module_json.tag_version, container_tag, platform).lower()
-                    image_tag_map[(module, platform)] = tag
-                    tag_dockerfile_map[tag] = (module, dockerfile)
-                    tag_build_options_map[tag] = module_json.build_options
-                    if len(active_platform) > 0 and (active_platform[0] == "*" or platform in active_platform):
-                        tags_to_build.add(tag)
+            module_dir = os.path.join(self.envvars.MODULES_PATH, module)
+            module_json = Module(self.output, self.utility, os.path.join(module_dir, "module.json"))
+            for platform in module_json.platforms:
+                # get the Dockerfile from module.json
+                dockerfile = os.path.abspath(os.path.join(module_dir, module_json.get_dockerfile_by_platform(platform)))
+                container_tag = "" if self.envvars.CONTAINER_TAG == "" else "-" + self.envvars.CONTAINER_TAG
+                tag = "{0}:{1}{2}-{3}".format(module_json.repository, module_json.tag_version, container_tag, platform).lower()
+                image_tag_map[(module, platform)] = tag
+                tag_dockerfile_map[tag] = (module, dockerfile)
+                tag_build_options_map[tag] = module_json.build_options
+                if not self.utility.in_asterisk_list(module, bypass_modules) and self.utility.in_asterisk_list(platform, active_platform):
+                    tags_to_build.add(tag)
 
         deployment_manifest = DeploymentManifest(self.envvars, self.output, self.utility, self.envvars.DEPLOYMENT_CONFIG_TEMPLATE_FILE, True)
         modules_to_process = deployment_manifest.get_modules_to_process()
 
         replacements = {}
         for module, platform in modules_to_process:
-            if module not in bypass_modules:
-                key = (module, platform)
-                if key in image_tag_map:
-                    tag = image_tag_map.get(key)
+            key = (module, platform)
+            if key in image_tag_map:
+                tag = image_tag_map.get(key)
+                replacements["${{MODULES.{0}.{1}}}".format(module, platform)] = tag
+                if not self.utility.in_asterisk_list(module, bypass_modules):
                     tags_to_build.add(tag)
-                    replacements["${{MODULES.{0}.{1}}}".format(module, platform)] = tag
 
         for tag in tags_to_build:
             if tag in tag_dockerfile_map:
diff --git a/iotedgedev/utility.py b/iotedgedev/utility.py
index 13fc09b..d55f55f 100644
--- a/iotedgedev/utility.py
+++ b/iotedgedev/utility.py
@@ -103,6 +103,9 @@ class Utility:
     def get_active_docker_platform(self):
         return [platform.strip() for platform in self.envvars.ACTIVE_DOCKER_PLATFORMS.split(",") if platform]
 
+    def in_asterisk_list(self, item, asterisk_list):
+        return len(asterisk_list) > 0 and (asterisk_list[0] == "*" or item in asterisk_list)
+
     def get_modules_in_config(self, moduleType):
         modules_config = json.load(open(self.envvars.DEPLOYMENT_CONFIG_FILE_PATH))
 

Image placeholder is not expanded when the module is in BYPASS_MODULES
diff --git a/tests/test_utility.py b/tests/test_utility.py
index 6786256..8242b6d 100644
--- a/tests/test_utility.py
+++ b/tests/test_utility.py
@@ -42,3 +42,15 @@ def test_copy_template_expand_env(utility, tmpdir):
     dest = tmpdir.join("deployment_template_2.dest.json").strpath
     utility.copy_template(test_file_1, dest, replacements=replacements, expand_env=True)
     assert_json_file_equal(test_file_2, dest)
+
+
+def test_in_asterisk_list(utility):
+    assert utility.in_asterisk_list("filtermodule", "pipemodule, filtermodule")
+
+
+def test_in_asterisk_list_empty(utility):
+    assert not utility.in_asterisk_list("filtermodule", "")
+
+
+def test_in_asterisk_list_asterisk(utility):
+    assert utility.in_asterisk_list("filtermodule", "*")

pip install -e .
parse_log_pytest
requirements.txt
pytest
3.6
requirements.txt
pytest --no-header -rA --tb=line --color=no -p no:cacheprovider -W ignore::DeprecationWarning
adal==1.2.7
applicationinsights==0.11.10
argcomplete==1.12.3
attrs==22.2.0
azure-cli==2.40.0
azure-cli-cloud==2.1.1
azure-cli-command-modules-nspkg==2.0.3
azure-cli-configure==2.0.24
azure-cli-core==2.40.0
azure-cli-extension==0.2.5
azure-cli-iot==0.3.11
azure-cli-nspkg==3.0.4
azure-cli-profile==2.1.5
azure-cli-resource==2.1.16
azure-cli-telemetry==1.0.8
azure-common==1.1.28
azure-core==1.24.2
azure-mgmt-authorization==0.50.0
azure-mgmt-core==1.3.2
azure-mgmt-iothub==0.8.2
azure-mgmt-iothubprovisioningservices==0.2.0
azure-mgmt-managementgroups==0.1.0
azure-mgmt-nspkg==3.0.2
azure-nspkg==3.0.2
bcrypt==4.0.1
certifi==2021.5.30
cffi==1.15.1
charset-normalizer==2.0.12
click==8.0.4
cryptography==39.0.2
docker==5.0.3
fstrings==0.1.0
humanfriendly==10.0
idna==3.10
importlib-metadata==4.8.3
iniconfig==1.1.1
-e git+https://github.com/Azure/iotedgedev.git@31d6219f41caf9401f5c49263a963e3a748e69bf#egg=iotedgedev
isodate==0.6.1
jmespath==0.10.0
knack==0.10.1
msal==1.18.0b1
msal-extensions==1.0.0
msrest==0.7.1
msrestazure==0.6.4.post1
oauthlib==3.2.2
packaging==21.3
paramiko==2.12.0
pkginfo==1.10.0
pluggy==1.0.0
portalocker==2.7.0
psutil==5.9.8
py==1.11.0
pycparser==2.21
Pygments==2.14.0
PyJWT==2.4.0
PyNaCl==1.5.0
pyOpenSSL==23.2.0
pyparsing==3.1.4
PySocks==1.7.1
pytest==7.0.1
python-dateutil==2.9.0.post0
python-dotenv==0.20.0
PyYAML==6.0.1
requests==2.27.1
requests-oauthlib==2.0.0
six==1.17.0
tabulate==0.8.10
tomli==1.2.3
typing_extensions==4.1.1
urllib3==1.26.20
websocket-client==1.3.1
zipp==3.6.0

name: iotedgedev
channels:
  - defaults
  - https://repo.anaconda.com/pkgs/main
  - https://repo.anaconda.com/pkgs/r
  - conda-forge
dependencies:
  - _libgcc_mutex=0.1=main
  - _openmp_mutex=5.1=1_gnu
  - ca-certificates=2025.2.25=h06a4308_0
  - certifi=2021.5.30=py36h06a4308_0
  - ld_impl_linux-64=2.40=h12ee557_0
  - libffi=3.3=he6710b0_2
  - libgcc-ng=11.2.0=h1234567_1
  - libgomp=11.2.0=h1234567_1
  - libstdcxx-ng=11.2.0=h1234567_1
  - ncurses=6.4=h6a678d5_0
  - openssl=1.1.1w=h7f8727e_0
  - pip=21.2.2=py36h06a4308_0
  - python=3.6.13=h12debd9_1
  - readline=8.2=h5eee18b_0
  - setuptools=58.0.4=py36h06a4308_0
  - sqlite=3.45.3=h5eee18b_0
  - tk=8.6.14=h39e8969_0
  - wheel=0.37.1=pyhd3eb1b0_0
  - xz=5.6.4=h5eee18b_1
  - zlib=1.2.13=h5eee18b_1
  - pip:
      - adal==1.2.7
      - applicationinsights==0.11.10
      - argcomplete==1.12.3
      - attrs==22.2.0
      - azure-cli==2.40.0
      - azure-cli-cloud==2.1.1
      - azure-cli-command-modules-nspkg==2.0.3
      - azure-cli-configure==2.0.24
      - azure-cli-core==2.40.0
      - azure-cli-extension==0.2.5
      - azure-cli-iot==0.3.11
      - azure-cli-nspkg==3.0.4
      - azure-cli-profile==2.1.5
      - azure-cli-resource==2.1.16
      - azure-cli-telemetry==1.0.8
      - azure-common==1.1.28
      - azure-core==1.24.2
      - azure-mgmt-authorization==0.50.0
      - azure-mgmt-core==1.3.2
      - azure-mgmt-iothub==0.8.2
      - azure-mgmt-iothubprovisioningservices==0.2.0
      - azure-mgmt-managementgroups==0.1.0
      - azure-mgmt-nspkg==3.0.2
      - azure-nspkg==3.0.2
      - bcrypt==4.0.1
      - cffi==1.15.1
      - charset-normalizer==2.0.12
      - click==8.0.4
      - cryptography==39.0.2
      - docker==5.0.3
      - fstrings==0.1.0
      - humanfriendly==10.0
      - idna==3.10
      - importlib-metadata==4.8.3
      - iniconfig==1.1.1
      - isodate==0.6.1
      - jmespath==0.10.0
      - knack==0.10.1
      - msal==1.18.0b1
      - msal-extensions==1.0.0
      - msrest==0.7.1
      - msrestazure==0.6.4.post1
      - oauthlib==3.2.2
      - packaging==21.3
      - paramiko==2.12.0
      - pkginfo==1.10.0
      - pluggy==1.0.0
      - portalocker==2.7.0
      - psutil==5.9.8
      - py==1.11.0
      - pycparser==2.21
      - pygments==2.14.0
      - pyjwt==2.4.0
      - pynacl==1.5.0
      - pyopenssl==23.2.0
      - pyparsing==3.1.4
      - pysocks==1.7.1
      - pytest==7.0.1
      - python-dateutil==2.9.0.post0
      - python-dotenv==0.20.0
      - pyyaml==6.0.1
      - requests==2.27.1
      - requests-oauthlib==2.0.0
      - six==1.17.0
      - tabulate==0.8.10
      - tomli==1.2.3
      - typing-extensions==4.1.1
      - urllib3==1.26.20
      - websocket-client==1.3.1
      - zipp==3.6.0
prefix: /opt/conda/envs/iotedgedev

tests/test_utility.py::test_in_asterisk_list tests/test_utility.py::test_in_asterisk_list_empty tests/test_utility.py::test_in_asterisk_list_asterisk
tests/test_utility.py::test_copy_template tests/test_utility.py::test_copy_template_expand_env
iotedgedev/utility.py iotedgedev/modules.py
iotedgedev/utility.py iotedgedev/modules.py