Skip to content

Commit c85a87e

Browse files
sjuarezgxSabrina Juarez Garcia
and
Sabrina Juarez Garcia
authored
Java Azure functions fixes (#128)
* Java Azure functions fixes * Do not support Blob Trigger yet due to limitations of Java Azure SDK- metadata cannot be read. --------- Co-authored-by: Sabrina Juarez Garcia <[email protected]>
1 parent d4174e6 commit c85a87e

File tree

5 files changed

+40
-9
lines changed

5 files changed

+40
-9
lines changed
+17-6
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,18 @@
11
{
2-
"version": "2.0",
3-
"extensionBundle": {
4-
"id": "Microsoft.Azure.Functions.ExtensionBundle",
5-
"version": "[4.*, 5.0.0)"
6-
}
7-
}
2+
"version": "2.0",
3+
"extensionBundle": {
4+
"id": "Microsoft.Azure.Functions.ExtensionBundle",
5+
"version": "[4.*, 5.0.0)"
6+
},
7+
"logging": {
8+
"logLevel": {
9+
"default": "Information"
10+
},
11+
"applicationInsights": {
12+
"samplingSettings": {
13+
"isEnabled": true,
14+
"excludedTypes": "Request"
15+
}
16+
}
17+
}
18+
}

src/AzureFunctions/blobStorage/deployblobstorage.msbuild

+6-3
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,11 @@
44

55
<Message Text="Pushing Blob Storage application settings." Importance="high" />
66
<Exec Command="az functionapp config appsettings set --name $(AZURE_FUNCTIONS_FUNCTION_APP) --resource-group $(AZURE_FUNCTIONS_RESOURCE_GROUP) --settings &quot;$(AZURE_FUNCTIONS_BLOB_STORAGE_CONNECTION)=$(AZURE_FUNCTIONS_BLOB_STORAGE_CONNECTION_APPSETTINGVALUE)&quot;" EchoOff="true" ContinueOnError="true" Condition="'$(AZURE_FUNCTIONS_BLOB_STORAGE_CONNECTION)' != '' AND '$(AZURE_FUNCTIONS_BLOB_STORAGE_CONNECTION_APPSETTINGVALUE)' != ''">
7-
<Output TaskParameter="ExitCode" PropertyName="PUSH_COSMOSDB_SETTINGS_EXIT_CODE"/>
8-
</Exec>
9-
7+
<Output TaskParameter="ExitCode" PropertyName="PUSH_BLOB_SETTINGS_EXIT_CODE"/>
8+
</Exec>
9+
10+
<Exec Command="az functionapp config appsettings set --name $(AZURE_FUNCTIONS_FUNCTION_APP) --resource-group $(AZURE_FUNCTIONS_RESOURCE_GROUP) --settings &quot;AzureWebJobs$(AZURE_FUNCTIONS_BLOB_STORAGE_CONNECTION)=$(AZURE_FUNCTIONS_BLOB_STORAGE_CONNECTION_APPSETTINGVALUE)&quot;" EchoOff="true" ContinueOnError="true" Condition="'$(AZURE_FUNCTIONS_BLOB_STORAGE_CONNECTION)' != '' AND '$(AZURE_FUNCTIONS_BLOB_STORAGE_CONNECTION_APPSETTINGVALUE)' != ''">
11+
<Output TaskParameter="ExitCode" PropertyName="PUSH_BLOB_SETTINGS_EXIT_CODE"/>
12+
</Exec>
1013
</Target>
1114
</Project>

src/AzureFunctions/cosmosdb/deploycosmosdb.msbuild

+8
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,18 @@
66
<Output TaskParameter="ExitCode" PropertyName="PUSH_COSMOSDB_SETTINGS_EXIT_CODE"/>
77
</Exec>
88

9+
<Exec Command="az functionapp config appsettings set --name $(AZURE_FUNCTIONS_FUNCTION_APP) --resource-group $(AZURE_FUNCTIONS_RESOURCE_GROUP) --settings &quot;AzureWebJobs$(AZURE_FUNCTIONS_COSMOSDB_CONNECTION)=$(AZURE_FUNCTIONS_COSMOSDB_CONNECTION_APPSETTINGVALUE)&quot; &quot;$(AZURE_FUNCTIONS_COSMOSDB_DATABASE)=$(AZURE_FUNCTIONS_COSMOSDB_DATABASE_APPSETTINGVALUE)&quot; &quot;$(AZURE_FUNCTIONS_COSMOSDB_CONTAINER)=$(AZURE_FUNCTIONS_COSMOSDB_CONTAINER_APPSETTINGVALUE)&quot;" EchoOff="true" ContinueOnError="true">
10+
<Output TaskParameter="ExitCode" PropertyName="PUSH_COSMOSDB_SETTINGS_EXIT_CODE"/>
11+
</Exec>
12+
913
<Exec Command="az functionapp config appsettings set --name $(AZURE_FUNCTIONS_FUNCTION_APP) --resource-group $(AZURE_FUNCTIONS_RESOURCE_GROUP) --settings &quot;$(AZURE_FUNCTIONS_COSMOSDB_LEASE_CONNECTION)=$(AZURE_FUNCTIONS_COSMOSDB_LEASE_CONNECTION_APPSETTINGVALUE)&quot;" EchoOff="true" ContinueOnError="true" Condition="'$(AZURE_FUNCTIONS_COSMOSDB_LEASE_CONNECTION)' != '' AND '$(AZURE_FUNCTIONS_COSMOSDB_LEASE_CONNECTION_APPSETTINGVALUE)' != ''">
1014
<Output TaskParameter="ExitCode" PropertyName="PUSH_COSMOSDB_LEASE_SETTINGS_EXIT_CODE"/>
1115
</Exec>
1216

17+
<Exec Command="az functionapp config appsettings set --name $(AZURE_FUNCTIONS_FUNCTION_APP) --resource-group $(AZURE_FUNCTIONS_RESOURCE_GROUP) --settings &quot;AzureWebJobs$(AZURE_FUNCTIONS_COSMOSDB_LEASE_CONNECTION)=$(AZURE_FUNCTIONS_COSMOSDB_LEASE_CONNECTION_APPSETTINGVALUE)&quot;" EchoOff="true" ContinueOnError="true" Condition="'$(AZURE_FUNCTIONS_COSMOSDB_LEASE_CONNECTION)' != '' AND '$(AZURE_FUNCTIONS_COSMOSDB_LEASE_CONNECTION_APPSETTINGVALUE)' != ''">
18+
<Output TaskParameter="ExitCode" PropertyName="PUSH_COSMOSDB_LEASE_SETTINGS_EXIT_CODE"/>
19+
</Exec>
20+
1321
<Exec Command="az functionapp config appsettings set --name $(AZURE_FUNCTIONS_FUNCTION_APP) --resource-group $(AZURE_FUNCTIONS_RESOURCE_GROUP) --settings &quot;$(AZURE_FUNCTIONS_COSMOSDB_LEASE_DATABASE)=$(AZURE_FUNCTIONS_COSMOSDB_LEASE_DATABASE_APPSETTINGVALUE)&quot;" EchoOff="true" ContinueOnError="true" Condition="'$(AZURE_FUNCTIONS_COSMOSDB_LEASE_DATABASE)' != '' AND '$(AZURE_FUNCTIONS_COSMOSDB_LEASE_DATABASE_APPSETTINGVALUE)' != ''">
1422
<Output TaskParameter="ExitCode" PropertyName="PUSH_COSMOSDB_LEASE_DB_SETTINGS_EXIT_CODE"/>
1523
</Exec>

src/AzureFunctions/deploy.msbuild

+8
Original file line numberDiff line numberDiff line change
@@ -83,11 +83,19 @@
8383
<Output TaskParameter="ExitCode" PropertyName="PUSHQUEUESETTINGS_EXIT_CODE"/>
8484
</Exec>
8585

86+
<Exec Command="az functionapp config appsettings set --name $(AZURE_FUNCTIONS_FUNCTION_APP) --resource-group $(AZURE_FUNCTIONS_RESOURCE_GROUP) --settings &quot;AzureWebJobs$(AZURE_FUNCTIONS_QUEUE_CONNECTION)=$(AZURE_FUNCTIONS_QUEUE_CONNECTION_APPSETTINGVALUE)&quot;" EchoOff="true" ContinueOnError="true" Condition="'$(AZURE_FUNCTIONS_TRIGGER_TYPE)' == 'Queue' AND '$(AZURE_FUNCTIONS_QUEUE_CONNECTION)' != '' AND '$(AZURE_FUNCTIONS_QUEUE_CONNECTION_APPSETTINGVALUE)' != '' AND '$(SuccessfullOperation)' == 'true'">
87+
<Output TaskParameter="ExitCode" PropertyName="PUSHQUEUESETTINGS_EXIT_CODE"/>
88+
</Exec>
89+
8690
<!-- Service Bus -->
8791
<Exec Command="az functionapp config appsettings set --name $(AZURE_FUNCTIONS_FUNCTION_APP) --resource-group $(AZURE_FUNCTIONS_RESOURCE_GROUP) --settings &quot;$(AZURE_FUNCTIONS_SERVICEBUS_CONNECTION)=$(AZURE_FUNCTIONS_SERVICEBUS_CONNECTION_APPSETTINGVALUE)&quot;" EchoOff="true" ContinueOnError="true" Condition="'$(AZURE_FUNCTIONS_TRIGGER_TYPE)' == 'servicebus' AND '$(AZURE_FUNCTIONS_SERVICEBUS_CONNECTION)' != '' AND '$(AZURE_FUNCTIONS_SERVICEBUS_CONNECTION_APPSETTINGVALUE)' != '' AND '$(SuccessfullOperation)' == 'true'">
8892
<Output TaskParameter="ExitCode" PropertyName="PUSHSBSETTINGS_EXIT_CODE"/>
8993
</Exec>
9094

95+
<Exec Command="az functionapp config appsettings set --name $(AZURE_FUNCTIONS_FUNCTION_APP) --resource-group $(AZURE_FUNCTIONS_RESOURCE_GROUP) --settings &quot;AzureWebJobs$(AZURE_FUNCTIONS_SERVICEBUS_CONNECTION)=$(AZURE_FUNCTIONS_SERVICEBUS_CONNECTION_APPSETTINGVALUE)&quot;" EchoOff="true" ContinueOnError="true" Condition="'$(AZURE_FUNCTIONS_TRIGGER_TYPE)' == 'servicebus' AND '$(AZURE_FUNCTIONS_SERVICEBUS_CONNECTION)' != '' AND '$(AZURE_FUNCTIONS_SERVICEBUS_CONNECTION_APPSETTINGVALUE)' != '' AND '$(SuccessfullOperation)' == 'true'">
96+
<Output TaskParameter="ExitCode" PropertyName="PUSHSBSETTINGS_EXIT_CODE"/>
97+
</Exec>
98+
9199
<!-- Define App Settings for GAM connection -->
92100

93101
<PropertyGroup>

src/Common/Azure/azurefunctions-create-Javapackage.targets

+1
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77

88
<Target Name="PreValidate" Condition="'$(GENERATOR)' == 'Java'">
99
<Message Text="Start Create Package for $(ApplicationType)" Importance="high"/>
10+
<Error Text ="Blob Azure functions not supported for this platform yet." Condition="'$(AZURE_FUNCTIONS_TRIGGER_TYPE)' == 'blobstorage'" />
1011
<PropertyGroup>
1112
<!-- ApplicationType Web or Function -->
1213
<AzureTemporalDir>$(DeployFullPath)/azuredeploy</AzureTemporalDir>

0 commit comments

Comments
 (0)