function-app-with-private-eventhub

所属分类:collect
开发工具:HCL
文件大小:0KB
下载次数:0
上传日期:2023-01-31 19:12:58
上 传 者sh-1993
说明:  使用与虚拟网络集成的Azure功能通过事件中心私下发送消息。,
(Use Azure Functions integrated with a virtual network to send messages privately through an Event Hub.,)

文件列表:
CHANGELOG.md (326, 2023-01-31)
CONTRIBUTING.md (3961, 2023-01-31)
IaC/ (0, 2023-01-31)
IaC/bicep/ (0, 2023-01-31)
IaC/bicep/azuredeploy.parameters.json (298, 2023-01-31)
IaC/bicep/main.bicep (4951, 2023-01-31)
IaC/bicep/modules/ (0, 2023-01-31)
IaC/bicep/modules/app-insights.bicep (814, 2023-01-31)
IaC/bicep/modules/azure-functions.bicep (2036, 2023-01-31)
IaC/bicep/modules/bastion.bicep (1193, 2023-01-31)
IaC/bicep/modules/network.bicep (8410, 2023-01-31)
IaC/bicep/modules/private-event-hub.bicep (4623, 2023-01-31)
IaC/bicep/modules/private-key-vault.bicep (2910, 2023-01-31)
IaC/bicep/modules/private-storage.bicep (8644, 2023-01-31)
IaC/bicep/modules/windows-vm.bicep (2260, 2023-01-31)
IaC/terraform/ (0, 2023-01-31)
IaC/terraform/main.tf (9582, 2023-01-31)
IaC/terraform/modules/ (0, 2023-01-31)
IaC/terraform/modules/application-insights/ (0, 2023-01-31)
IaC/terraform/modules/application-insights/main.tf (571, 2023-01-31)
IaC/terraform/modules/application-insights/outputs.tf (145, 2023-01-31)
IaC/terraform/modules/application-insights/variables.tf (541, 2023-01-31)
IaC/terraform/modules/azure-bastion/ (0, 2023-01-31)
IaC/terraform/modules/azure-bastion/main.tf (607, 2023-01-31)
IaC/terraform/modules/azure-bastion/variables.tf (658, 2023-01-31)
IaC/terraform/modules/azure-functions/ (0, 2023-01-31)
IaC/terraform/modules/azure-functions/main.tf (1659, 2023-01-31)
IaC/terraform/modules/azure-functions/variables.tf (1585, 2023-01-31)
IaC/terraform/modules/private-event-hub/ (0, 2023-01-31)
IaC/terraform/modules/private-event-hub/main.tf (2607, 2023-01-31)
IaC/terraform/modules/private-event-hub/outputs.tf (188, 2023-01-31)
IaC/terraform/modules/private-event-hub/variables.tf (1893, 2023-01-31)
IaC/terraform/modules/private-key-vault/ (0, 2023-01-31)
IaC/terraform/modules/private-key-vault/main.tf (2521, 2023-01-31)
IaC/terraform/modules/private-key-vault/outputs.tf (125, 2023-01-31)
... ...

# Function App with Private Event Hub Integration between Event Hubs and Azure Virtual Networks creates a secure messaging layer that can be accessed from other services within the network. Azure Functions can be similarly integrated with services inside virtual networks, enabling creation of workloads that execute on message ingestion, through input bindings. ## Features This project framework provides the following features: * An Azure Event Hub used to ingest messages. * A Function App with an Event Hub triggered Azure Function. * An Azure Key Vault instance used to securely store all secret values. * An Azure Virtual Network, Private Endpoints, and network access controls that restrict access to the Event Hub, Storage Account, and Key Vault. * All components are deployable via Bicep or Terraform. ## Architecture ![Architecture diagram](https://github.com/Azure-Samples/function-app-with-private-eventhub/blob/master/./media/privateEventHubArchitectureDiagram.png) ## Getting Started ### Prerequisites * [Azure CLI](https://github.com/Azure-Samples/function-app-with-private-eventhub/blob/master/https://docs.microsoft.com/cli/azure/install-azure-cli) (2.42.0) * [Azure Functions Core Tools](https://github.com/Azure-Samples/function-app-with-private-eventhub/blob/master/https://docs.microsoft.com/azure/azure-functions/functions-run-local?tabs=windows%2Ccsharp%2Cbash#install-the-azure-functions-core-tools) * [.NET](https://github.com/Azure-Samples/function-app-with-private-eventhub/blob/master/https://docs.microsoft.com/dotnet/core/install/) * [Bicep](https://github.com/Azure-Samples/function-app-with-private-eventhub/blob/master/https://docs.microsoft.com/azure/azure-resource-manager/bicep/install) or [Terraform](https://github.com/Azure-Samples/function-app-with-private-eventhub/blob/master/https://www.terraform.io/downloads.html) ### Deploy the Infrastructure The project can be deployed using _either_ Bicep _or_ Terraform. #### Bicep 1. Create a new Azure resource group to deploy the Bicep template to, passing in a location and name - `az group create --location --name ` 2. The [azuredeploy.parameters.json](https://github.com/Azure-Samples/function-app-with-private-eventhub/blob/master/./IaC/bicep/azuredeploy.parameters.json) file contains the necessary variables to deploy the Bicep project. Update the file with appropriate values. Descriptions for each parameter can be found in the [main.bicep](https://github.com/Azure-Samples/function-app-with-private-eventhub/blob/master/./IaC/bicep/main.bicep) file. 3. Optionally, verify what Bicep will deploy, passing in the name of the resource group created earlier and the necessary parameters for the Bicep template - `az deployment group what-if --resource-group --template-file .\main.bicep --parameters .\azuredeploy.parameters.json` 4. Deploy the template, passing in the name of the resource group created earlier and the necessary parameters for the Bicep template - `az deployment group create --resource-group --template-file .\main.bicep --parameters .\azuredeploy.parameters.json` #### Terraform 1. The [terraform.tfvars](https://github.com/Azure-Samples/function-app-with-private-eventhub/blob/master/./IaC/terraform/terraform.tfvars) file contains the necessary variables to apply the Terraform configuration. Update the file with appropriate values. Descriptions for each variable can be found in the [variables.tf](https://github.com/Azure-Samples/function-app-with-private-eventhub/blob/master/./IaC/terraform/variables.tf) file. 2. Initialize Terraform - `terraform init` 3. Optionally, verify what Terraform will deploy - `terraform plan` 4. Deploy the configuration - `terraform apply` ### Deploy the Function App Code The project provides sample Azure Functions code to verify that the solution is working correctly. It contains an Event Hub triggered Azure Function used to process incoming messages and a second, disabled, timer triggered Azure Function that sends messages to the Event Hub using output bindings and is used to test that the processor is operating properly. 1. Navigate to the [./src/eventhub-trigger](https://github.com/Azure-Samples/function-app-with-private-eventhub/blob/master/./src/eventhub-trigger) directory. 2. Deploy the code to the function app provisioned by Bicep or Terraform - `func azure functionapp publish --dotnet` ### Test the Event Hub and Function App 1. Navigate to the [Azure Portal](https://github.com/Azure-Samples/function-app-with-private-eventhub/blob/master/https://portal.azure.com) and find the Function App that was provisioned. 2. Open the **Configuration** blade. 3. Find the `AzureWebJobs.Tester.Disabled` application setting and edit the value to `false`. 4. Save the changes. 5. Find the Application Insights resource that was provisioned. 6. Open the **Logs** blade. 7. Query for the results from the `requests` table. 8. Observe the successful `EventHubProcessor` runs. ## Resources * [Tutorial: Integrate Azure Functions with an Azure virtual network by using private endpoints](https://github.com/Azure-Samples/function-app-with-private-eventhub/blob/master/https://docs.microsoft.com/azure/azure-functions/functions-create-vnet) * [Integrate your app with an Azure virtual network](https://github.com/Azure-Samples/function-app-with-private-eventhub/blob/master/https://docs.microsoft.com/azure/app-service/overview-vnet-integration) * [Azure Functions networking options](https://github.com/Azure-Samples/function-app-with-private-eventhub/blob/master/https://docs.microsoft.com/azure/azure-functions/functions-networking-options) * [Network security for Azure Event Hubs](https://github.com/Azure-Samples/function-app-with-private-eventhub/blob/master/https://docs.microsoft.com/azure/event-hubs/network-security) * [Configure Azure Storage firewalls and virtual networks](https://github.com/Azure-Samples/function-app-with-private-eventhub/blob/master/https://docs.microsoft.com/azure/storage/common/storage-network-security) * [Configure Azure Key Vault firewalls and virtual networks](https://github.com/Azure-Samples/function-app-with-private-eventhub/blob/master/https://docs.microsoft.com/en-us/azure/key-vault/general/network-security) * [Analyze Azure Functions telemetry in Application Insights](https://github.com/Azure-Samples/function-app-with-private-eventhub/blob/master/https://docs.microsoft.com/azure/azure-functions/analyze-telemetry-data)

近期下载者

相关文件


收藏者