1

I created an Azure custom provider by following the documentation in the link below:

https://learn.microsoft.com/en-us/azure/azure-resource-manager/custom-providers/

I am able to successfully create resources for the types defined in the custom provider using ARM templates. However, I do not see those resources on the azure portal under the specific resource group.

Is this behavior expected?

SigmaCloud
  • 29
  • 2

1 Answers1

0
  • I have deployed the custom provider in azure portal using ARM template by following below steps

  • Open azure portal and search for custom deployment as below

enter image description here

  • Taken reference from Microsoft Doc

  • After opening custom deployment, i have used the below code and then click on save

{
    "$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentTemplate.json#",
  "contentVersion": "1.0.0.0",
  "parameters": {
        "funcName": {
            "type": "string",
      "defaultValue": "[uniqueString(resourceGroup().id)]",
      "metadata": {
                "description": "The unique name of the function application"
      }
        },
    "storageName": {
            "type": "string",
      "defaultValue": "[concat('store', uniquestring(resourceGroup().id))]",
      "metadata": {
                "description": "The unique name of the storage account."
      }
        },
    "location": {
            "type": "string",
      "defaultValue": "eastus",
      "metadata": {
                "description": "The location for the resources."
      }
        },
    "zipFileBlobUri": {
            "type": "string",
      "defaultValue": "https://github.com/Azure/azure-docs-json-samples/blob/master/custom-providers/_artifacts/functionpackage.zip?raw=true",
      "metadata": {
                "description": "The URI to the uploaded function zip file"
      }
        }
    },
  "resources": [
    {
        "type": "Microsoft.Web/sites",
      "apiVersion": "2022-03-01",
      "name": "[parameters('funcName')]",
      "location": "[parameters('location')]",
      "kind": "functionapp",
      "identity": {
            "type": "SystemAssigned"
      },
      "dependsOn": [
        "[resourceId('Microsoft.Storage/storageAccounts', parameters('storageName'))]"
      ],
      "properties": {
            "name": "[parameters('funcName')]",
        "siteConfig": {
                "appSettings": [
                  {
                    "name": "AzureWebJobsDashboard",
              "value": "[concat('DefaultEndpointsProtocol=https;AccountName=',parameters('storageName'),';AccountKey=',listKeys(resourceId('Microsoft.Storage/storageAccounts', parameters('storageName')), '2022-05-01').keys[0].value)]"
                  },
            {
                    "name": "AzureWebJobsStorage",
              "value": "[concat('DefaultEndpointsProtocol=https;AccountName=',parameters('storageName'),';AccountKey=',listKeys(resourceId('Microsoft.Storage/storageAccounts', parameters('storageName')), '2022-05-01').keys[0].value)]"
            },
            {
                    "name": "FUNCTIONS_EXTENSION_VERSION",
              "value": "~2"
            },
            {
                    "name": "WEBSITE_CONTENTAZUREFILECONNECTIONSTRING",
              "value": "[concat('DefaultEndpointsProtocol=https;AccountName=',parameters('storageName'),';AccountKey=',listKeys(resourceId('Microsoft.Storage/storageAccounts', parameters('storageName')), '2022-05-01').keys[0].value)]"
            },
            {
                    "name": "WEBSITE_CONTENTSHARE",
              "value": "[toLower(parameters('funcName'))]"
            },
            {
                    "name": "WEBSITE_NODE_DEFAULT_VERSION",
              "value": "6.5.0"
            },
            {
                    "name": "WEBSITE_RUN_FROM_PACKAGE",
              "value": "[parameters('zipFileBlobUri')]"
            }
          ]
        },
        "clientAffinityEnabled": false,
        "reserved": false
      }
    },
    {
        "type": "Microsoft.Storage/storageAccounts",
      "apiVersion": "2022-05-01",
      "name": "[parameters('storageName')]",
      "location": "[parameters('location')]",
      "kind": "StorageV2",
      "sku": {
            "name": "Standard_LRS"
      }
    },
    {
        "type": "Microsoft.CustomProviders/resourceProviders",
      "apiVersion": "2018-09-01-preview",
      "name": "[parameters('funcName')]",
      "location": "[parameters('location')]",
      "dependsOn": [
        "[concat('Microsoft.Web/sites/',parameters('funcName'))]"
      ],
      "properties": {
            "actions": [
              {
                "name": "ping",
            "routingType": "Proxy",
            "endpoint": "[concat('https://', parameters('funcName'), '.azurewebsites.net/api/{requestPath}')]"
              }
        ],
        "resourceTypes": [
          {
                "name": "users",
            "routingType": "Proxy,Cache",
            "endpoint": "[concat('https://', parameters('funcName'), '.azurewebsites.net/api/{requestPath}')]"
          }
        ]
      }
    },
    {
        "type": "Microsoft.CustomProviders/resourceProviders/users",
      "apiVersion": "2018-09-01-preview",
      "name": "[concat(parameters('funcName'), '/ana')]",
      "location": "parameters('location')",
      "dependsOn": [
        "[concat('Microsoft.CustomProviders/resourceProviders/',parameters('funcName'))]"
      ],
      "properties": {
            "FullName": "Ana Bowman",
        "Location": "Moon"
      }
    }
  ],
  "outputs": {
        "principalId": {
            "type": "string",
      "value": "[reference(concat('Microsoft.Web/sites/', parameters('funcName')), '2022-03-01', 'Full').identity.principalId]"
        }
    }
}
  • Fill the following details like Subscription id, resource group, location and click on review+create

enter image description here

  • After deploying into the azure portal, we will get below

enter image description here

  • After deploying it to azure poral Goto azure portal and click on your resource group and click on the check box you will find as below

enter image description here

Tarun Krishna
  • 366
  • 2
  • 6
  • Yes, the custom provider shows in the portal. I am referring to a resource created using the custom provider. Have you tried that? – SigmaCloud Nov 18 '22 at 17:58
  • I didn't get exactly what you are saying. can you tell me more about it ? – Tarun Krishna Nov 18 '22 at 18:43
  • As per your ARM template deployment, where is the 'Microsoft.CustomProviders/resourceProviders/users' resource showing on the portal? – SigmaCloud Nov 19 '22 at 00:16
  • Please follow the steps so you can get an idea what capability's that custom provider has Open azure portal => Search for subscription as shown [image1](https://i.imgur.com/X3WDRFx.png) => Select subscription name => follow the steps shown in [image2](https://i.imgur.com/pvLKtME.png), AFAIK, the custom provider as the capability as shown in [Image3](https://i.imgur.com/ohBWEi5.png) so it's not possible to track the custom provider in a particular resource Group (or) Subscription – Tarun Krishna Nov 19 '22 at 05:16