ARM Template with app function and event hubs not created the return

Evendor Media 1 Reputation point
2020-06-05T09:12:02.517+00:00

Hi,
I need help. I developed a function app. I am working on creating a ARM template which will create a function app and deploy from github.
With this I don’t problem.

The function app send messages to Event hubs. This resource also included in the ARM template and deploy both, but don’t created the “Return” in the function app.

            {
                "type": "Microsoft.Web/sites",
                "apiVersion": "2018-11-01",
                "name": "[parameters('functionapp_name')]",
                "location": "[parameters('location')]",
                "dependsOn": [
                    "[concat('Microsoft.Web/serverfarms/', parameters('serverfarms_name'))]",
                    "[resourceId('Microsoft.Storage/storageAccounts', parameters('storageAccounts_name'))]"
                ],
                "tags": "[parameters('resourceTags')]",
                "kind": "functionapp",
                "properties": {
                    "name": "[parameters('functionapp_name')]",
                    "siteConfig": {
                        "appSettings": [
                            {
                                "name": "FUNCTIONS_EXTENSION_VERSION",
                                "value": "~2"
                                //"slotSetting": false
                            },
                            {
                                "name": "FUNCTIONS_WORKER_RUNTIME",
                                "value": "dotnet"
                                //"slotSetting": false
                            },
                            {
                                "name": "AzureWebJobsStorage",
                                "value": "[concat('DefaultEndpointsProtocol=https;AccountName=',parameters('storageAccounts_name'),';AccountKey=',listKeys(resourceId('Microsoft.Storage/storageAccounts', parameters('storageAccounts_name')), '2019-06-01').keys[0].value)]" 
                                //"slotSetting": false
                            },
                            {
                                "name": "WEBSITE_CONTENTAZUREFILECONNECTIONSTRING",
                                "value": "[concat('DefaultEndpointsProtocol=https;AccountName=',parameters('storageAccounts_name'),';AccountKey=',listKeys(resourceId('Microsoft.Storage/storageAccounts', parameters('storageAccounts_name')), '2019-06-01').keys[0].value,';EndpointSuffix=','core.windows.net')]"
                                //"slotSetting": false
                            },
                            {
                                "name": "WEBSITE_CONTENTSHARE",
                                "value": "[toLower(parameters('functionapp_name'))]"
                                //"slotSetting": false
                            },
                            {
                                "name": "anhns-audiencPruebaEventhub-hbb8_RootManageSharedAccessKey_EVENTHUB",
                                "value": "[concat('Endpoint=sb://', parameters('namespaces_name'), '.servicebus.windows.net/;SharedAccessKeyName=RootManageSharedAccessKey;SharedAccessKey=', listkeys(resourceId('Microsoft.Eventhub/namespaces/authorizationRules',parameters('namespaces_name'),'RootManageSharedAccessKey'),'2017-04-01').primaryConnectionString,';EntityPath=',parameters('eventHubs_name'))]"
                                //"slotSetting": false
                            } 
                        ]
                    },
                    "serverFarmId": "[resourceId('Microsoft.Web/serverfarms', parameters('serverfarms_name'))]",
                    "clientAffinityEnabled": true
                }
            },
            {
                "type": "Microsoft.Web/sites/sourcecontrols",
                "apiVersion": "2018-11-01",
                "name": "[concat(parameters('functionApp_name'),'/', variables('web_name'))]",
                "dependsOn": [
                    "[resourceId('Microsoft.Web/Sites', parameters('functionApp_name'))]"
                ],
                "properties": {
                    "RepoUrl": "[parameters('repoURL')]",
                    "branch": "[parameters('branch')]",
                    "IsManualIntegration": true
                }
            },
            {
                "type": "Microsoft.EventHub/namespaces/AuthorizationRules",
                "apiVersion": "2017-04-01",
                "name": "[concat(parameters('namespaces_name'), '/RootManageSharedAccessKey')]",
                "location": "[parameters('location')]",
                "dependsOn": [
                    "[resourceId('Microsoft.EventHub/namespaces', parameters('namespaces_name'))]"
                ],
                "properties": {
                    "rights": [
                        "Listen",
                        "Manage",
                        "Send"
                    ]
                }
            },
            {
                "type": "Microsoft.EventHub/namespaces/eventhubs",
                "apiVersion": "2017-04-01",
                "name": "[concat(parameters('namespaces_name'), '/', parameters('eventHubs_name'))]",
                "location": "[parameters('location')]",
                "dependsOn": [
                    "[resourceId('Microsoft.EventHub/namespaces', parameters('namespaces_name'))]"
                ],
                "properties": {
                    "messageRetentionInDays": 1,
                    "partitionCount": 1,
                    "status": "Active"
                }
            },
            {
                "type": "Microsoft.EventHub/namespaces/networkRuleSets",
                "apiVersion": "2018-01-01-preview",
                "name": "[concat(parameters('namespaces_name'), '/default')]",
                "location": "[parameters('location')]",
                "dependsOn": [
                    "[resourceId('Microsoft.EventHub/namespaces', parameters('namespaces_name'))]"
                ],
                "properties": {
                    "defaultAction": "Deny",
                    "virtualNetworkRules": [],
                    "ipRules": []
                }        
            },
            {
                "type": "Microsoft.EventHub/namespaces/eventhubs/consumergroups",
                "apiVersion": "2017-04-01",
                "name": "[concat(parameters('namespaces_name'), '/', parameters('eventHubs_name'), '/$Default')]",
                "location": "[parameters('location')]",
                "dependsOn": [
                    "[resourceId('Microsoft.EventHub/namespaces/eventhubs', parameters('namespaces_name'), parameters('eventHubs_name'))]",
                    "[resourceId('Microsoft.EventHub/namespaces', parameters('namespaces_name'))]"
                ],
                "properties": {}
            }
    ],
    "outputs": {
        "storageEndpoint": {
            "type": "object",
            "value": "[reference(parameters('storageAccounts_name')).primaryEndpoints]"
        }   
    }

I couldn't find any samples in GitHub for template deployments for both resources.
But template deployments I found only upto creating function app.

Any help regarding this is much appreciated.

Regards,

Azure Functions
Azure Functions
An Azure service that provides an event-driven serverless compute platform.
4,208 questions
Azure Event Hubs
Azure Event Hubs
An Azure real-time data ingestion service.
555 questions
{count} votes

1 answer

Sort by: Most helpful
  1. MayankBargali-MSFT 68,066 Reputation points
    2020-07-02T08:03:38.243+00:00

    @EvendorMedia-2800

    I wish to engage with you offline for a closer look and provide quick and specialized assistance, please send an email with the subject line “Attn:Mayank” to AzCommunity[at]Microsoft[dot]com referencing this thread along with the ARM template and parameter file

    0 comments No comments