Skip to content

Commit a8464f8

Browse files
Copiloteggboy
andauthored
Address PR review: let BOM manage adapter version, move deploy config to profile, upgrade GH Actions
- Remove explicit version from spring-cloud-function-adapter-azure-web, now uses BOM-managed 4.3.2 (compatible with Spring Cloud 2025.0.2) - Move Azure resource identifiers (region, resource group) to a 'deploy' Maven profile to prevent accidental cloud deployments - Upgrade actions/checkout v3->v4 and github/codeql-action v2->v3 Agent-Logs-Url: https://github.com/eggboy/springcloud-azurefunction/sessions/79992a6a-dd80-40c0-9fa4-ab61b945aeee Co-authored-by: eggboy <825593+eggboy@users.noreply.github.com>
1 parent d5ff549 commit a8464f8

3 files changed

Lines changed: 39 additions & 11 deletions

File tree

.github/workflows/codeql.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -40,14 +40,14 @@ jobs:
4040

4141
steps:
4242
- name: Checkout repository
43-
uses: actions/checkout@v3
43+
uses: actions/checkout@v4
4444
- uses: actions/setup-java@v4
4545
with:
4646
java-version: 21
4747
distribution: temurin
4848
# Initializes the CodeQL tools for scanning.
4949
- name: Initialize CodeQL
50-
uses: github/codeql-action/init@v2
50+
uses: github/codeql-action/init@v3
5151
with:
5252
languages: ${{ matrix.language }}
5353
# If you wish to specify custom queries, you can do so here or in a config file.
@@ -61,7 +61,7 @@ jobs:
6161
# Autobuild attempts to build any compiled languages (C/C++, C#, Go, or Java).
6262
# If this step fails, then you should remove it and run the build manually (see below)
6363
- name: Autobuild
64-
uses: github/codeql-action/autobuild@v2
64+
uses: github/codeql-action/autobuild@v3
6565

6666
# ℹ️ Command-line programs to run using the OS shell.
6767
# 📚 See https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#jobsjob_idstepsrun
@@ -74,6 +74,6 @@ jobs:
7474
# ./location_of_script_within_repo/buildscript.sh
7575

7676
- name: Perform CodeQL Analysis
77-
uses: github/codeql-action/analyze@v2
77+
uses: github/codeql-action/analyze@v3
7878
with:
7979
category: "/language:${{matrix.language}}"

README.md

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,5 +34,14 @@ curl -X GET http://localhost:7072/api/AzureWebAdapter/user/1
3434

3535
```shell
3636
az login
37-
mvn azure-functions:deploy
37+
mvn azure-functions:deploy -Pdeploy
38+
```
39+
40+
You can override the default Azure resource settings with `-D` flags:
41+
42+
```shell
43+
mvn azure-functions:deploy -Pdeploy \
44+
-DfunctionAppName=my-app \
45+
-DfunctionAppRegion=westus \
46+
-DfunctionResourceGroup=my-resource-group
3847
```

pom.xml

Lines changed: 25 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -17,12 +17,10 @@
1717
<java.version>21</java.version>
1818
<spring-cloud.version>2025.0.2</spring-cloud.version>
1919
<spring-boot-thin-layout.version>1.0.31.RELEASE</spring-boot-thin-layout.version>
20-
<spring-cloud-function-adapter-azure-web.version>5.0.1</spring-cloud-function-adapter-azure-web.version>
2120
<start-class>io.jaylee.springcloud.AzurefunctionApplication</start-class>
2221
<azure.functions.maven.plugin.version>1.41.0</azure.functions.maven.plugin.version>
22+
<!-- Azure resource defaults for local packaging; override with -D flags or the 'deploy' profile -->
2323
<functionAppName>springcloud-azurefunction</functionAppName>
24-
<functionAppRegion>koreacentral</functionAppRegion>
25-
<functionResourceGroup>java-functions-group</functionResourceGroup>
2624
</properties>
2725
<dependencies>
2826
<dependency>
@@ -36,7 +34,6 @@
3634
<dependency>
3735
<groupId>org.springframework.cloud</groupId>
3836
<artifactId>spring-cloud-function-adapter-azure-web</artifactId>
39-
<version>${spring-cloud-function-adapter-azure-web.version}</version>
4037
</dependency>
4138

4239
<dependency>
@@ -82,8 +79,6 @@
8279
<version>${azure.functions.maven.plugin.version}</version>
8380
<configuration>
8481
<appName>${functionAppName}</appName>
85-
<resourceGroup>${functionResourceGroup}</resourceGroup>
86-
<region>${functionAppRegion}</region>
8782
<hostJson>${project.basedir}/src/main/resources/host.json</hostJson>
8883
<runtime>
8984
<os>linux</os>
@@ -128,4 +123,28 @@
128123
</plugins>
129124
</build>
130125

126+
<profiles>
127+
<profile>
128+
<id>deploy</id>
129+
<properties>
130+
<functionAppName>springcloud-azurefunction</functionAppName>
131+
<functionAppRegion>koreacentral</functionAppRegion>
132+
<functionResourceGroup>java-functions-group</functionResourceGroup>
133+
</properties>
134+
<build>
135+
<plugins>
136+
<plugin>
137+
<groupId>com.microsoft.azure</groupId>
138+
<artifactId>azure-functions-maven-plugin</artifactId>
139+
<configuration>
140+
<appName>${functionAppName}</appName>
141+
<resourceGroup>${functionResourceGroup}</resourceGroup>
142+
<region>${functionAppRegion}</region>
143+
</configuration>
144+
</plugin>
145+
</plugins>
146+
</build>
147+
</profile>
148+
</profiles>
149+
131150
</project>

0 commit comments

Comments
 (0)