Skip to content

Commit

Permalink
Java Azure functions fixes
Browse files Browse the repository at this point in the history
(cherry picked from commit abbd2fc)
  • Loading branch information
Sabrina Juarez Garcia committed Jan 13, 2025
1 parent faf4a55 commit 86ba0f2
Show file tree
Hide file tree
Showing 4 changed files with 37 additions and 11 deletions.
23 changes: 17 additions & 6 deletions src/AzureFunctions/Templates/Java/host.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,18 @@
{
"version": "2.0",
"extensionBundle": {
"id": "Microsoft.Azure.Functions.ExtensionBundle",
"version": "[4.*, 5.0.0)"
}
}
"version": "2.0",
"extensionBundle": {
"id": "Microsoft.Azure.Functions.ExtensionBundle",
"version": "[4.*, 5.0.0)"
},
"logging": {
"logLevel": {
"default": "Information"
},
"applicationInsights": {
"samplingSettings": {
"isEnabled": true,
"excludedTypes": "Request"
}
}
}
}
9 changes: 6 additions & 3 deletions src/AzureFunctions/blobStorage/deployblobstorage.msbuild
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,11 @@

<Message Text="Pushing Blob Storage application settings." Importance="high" />
<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)' != ''">
<Output TaskParameter="ExitCode" PropertyName="PUSH_COSMOSDB_SETTINGS_EXIT_CODE"/>
</Exec>

<Output TaskParameter="ExitCode" PropertyName="PUSH_BLOB_SETTINGS_EXIT_CODE"/>
</Exec>

<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)' != ''">
<Output TaskParameter="ExitCode" PropertyName="PUSH_BLOB_SETTINGS_EXIT_CODE"/>
</Exec>
</Target>
</Project>
8 changes: 8 additions & 0 deletions src/AzureFunctions/cosmosdb/deploycosmosdb.msbuild
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,18 @@
<Output TaskParameter="ExitCode" PropertyName="PUSH_COSMOSDB_SETTINGS_EXIT_CODE"/>
</Exec>

<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">
<Output TaskParameter="ExitCode" PropertyName="PUSH_COSMOSDB_SETTINGS_EXIT_CODE"/>
</Exec>

<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)' != ''">
<Output TaskParameter="ExitCode" PropertyName="PUSH_COSMOSDB_LEASE_SETTINGS_EXIT_CODE"/>
</Exec>

<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)' != ''">
<Output TaskParameter="ExitCode" PropertyName="PUSH_COSMOSDB_LEASE_SETTINGS_EXIT_CODE"/>
</Exec>

<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)' != ''">
<Output TaskParameter="ExitCode" PropertyName="PUSH_COSMOSDB_LEASE_DB_SETTINGS_EXIT_CODE"/>
</Exec>
Expand Down
8 changes: 6 additions & 2 deletions src/AzureFunctions/deploy.msbuild
Original file line number Diff line number Diff line change
Expand Up @@ -77,15 +77,19 @@
<Output TaskParameter="ExitCode" PropertyName="PUSHQUEUESETTINGS_EXIT_CODE"/>
</Exec>

<Exec Command="az functionapp config appsettings set --name $(AZURE_FUNCTIONS_FUNCTION_APP) --resource-group $(AZURE_FUNCTIONS_RESOURCE_GROUP) --settings &quot;queue_name=$(AZURE_FUNCTIONS_QUEUE_NAME)&quot;" EchoOff="true" ContinueOnError="true" Condition="'$(AZURE_FUNCTIONS_TRIGGER_TYPE)' == 'Queue' AND '$(AZURE_FUNCTIONS_QUEUE_NAME)' != '' AND '$(GENERATOR)' == 'Java' AND '$(SuccessfullOperation)' == 'true'">
<Output TaskParameter="ExitCode" PropertyName="PUSHQUEUEJAVASETTINGS_EXIT_CODE"/>
<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'">
<Output TaskParameter="ExitCode" PropertyName="PUSHQUEUESETTINGS_EXIT_CODE"/>
</Exec>

<!-- Service Bus -->
<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'">
<Output TaskParameter="ExitCode" PropertyName="PUSHSBSETTINGS_EXIT_CODE"/>
</Exec>

<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'">
<Output TaskParameter="ExitCode" PropertyName="PUSHSBSETTINGS_EXIT_CODE"/>
</Exec>

<!-- Define App Settings for GAM connection -->

<PropertyGroup>
Expand Down

0 comments on commit 86ba0f2

Please sign in to comment.