Saturday, August 28, 2021

azure function app with storage

 {

    "$schema""http://schema.management.azure.com/schemas/2015-01-01/deploymentTemplate.json#",
    "contentVersion""1.0.0.0",
    "parameters": {
        "location": {
            "type""string"
        },
        "storageAccountName": {
            "type""string"
        },
        "accountType": {
            "type""string"
        },
        "kind": {
            "type""string"
        },
        "accessTier": {
            "type""string"
        },
        "minimumTlsVersion": {
            "type""string"
        },
        "supportsHttpsTrafficOnly": {
            "type""bool"
        },
        "allowBlobPublicAccess": {
            "type""bool"
        },
        "allowSharedKeyAccess": {
            "type""bool"
        },
        "defaultOAuth": {
            "type""bool"
        },
        "networkAclsBypass": {
            "type""string"
        },
        "networkAclsDefaultAction": {
            "type""string"
        },
        "routingChoice": {
            "type""string"
        },
        "isHnsEnabled": {
            "type""bool"
        },
        "isContainerSoftDeleteEnabled": {
            "type""bool"
        },
        "containerSoftDeleteRetentionDays": {
            "type""int"
        },
        "isShareSoftDeleteEnabled": {
            "type""bool"
        },
        "shareSoftDeleteRetentionDays": {
            "type""int"
        }
    },
    "variables": {},
    "resources": [
        {
            "name""[parameters('storageAccountName')]",
            "type""Microsoft.Storage/storageAccounts",
            "apiVersion""2021-06-01",
            "location""[parameters('location')]",
            "properties": {
                "accessTier""[parameters('accessTier')]",
                "minimumTlsVersion""[parameters('minimumTlsVersion')]",
                "supportsHttpsTrafficOnly""[parameters('supportsHttpsTrafficOnly')]",
                "allowBlobPublicAccess""[parameters('allowBlobPublicAccess')]",
                "allowSharedKeyAccess""[parameters('allowSharedKeyAccess')]",
                "defaultToOAuthAuthentication""[parameters('defaultOAuth')]",
                "networkAcls": {
                    "bypass""[parameters('networkAclsBypass')]",
                    "defaultAction""[parameters('networkAclsDefaultAction')]",
                    "ipRules": []
                },
                "routingPreference": {
                    "routingChoice""[parameters('routingChoice')]",
                    "publishMicrosoftEndpoints"false,
                    "publishInternetEndpoints"false
                },
                "isHnsEnabled""[parameters('isHnsEnabled')]"
            },
            "dependsOn": [],
            "sku": {
                "name""[parameters('accountType')]"
            },
            "kind""[parameters('kind')]",
            "tags": {
                "name""function-app-storage-acc"
            }
        },
        {
            "name""[concat(parameters('storageAccountName'), '/default')]",
            "type""Microsoft.Storage/storageAccounts/blobServices",
            "apiVersion""2021-06-01",
            "properties": {
                "containerDeleteRetentionPolicy": {
                    "enabled""[parameters('isContainerSoftDeleteEnabled')]",
                    "days""[parameters('containerSoftDeleteRetentionDays')]"
                }
            },
            "dependsOn": [
                "[concat('Microsoft.Storage/storageAccounts/', parameters('storageAccountName'))]"
            ]
        },
        {
            "name""[concat(parameters('storageAccountName'), '/default')]",
            "type""Microsoft.Storage/storageAccounts/fileservices",
            "apiVersion""2021-06-01",
            "properties": {
                "shareDeleteRetentionPolicy": {
                    "enabled""[parameters('isShareSoftDeleteEnabled')]",
                    "days""[parameters('shareSoftDeleteRetentionDays')]"
                }
            },
            "dependsOn": [
                "[concat('Microsoft.Storage/storageAccounts/', parameters('storageAccountName'))]",
                "[concat(concat('Microsoft.Storage/storageAccounts/', parameters('storageAccountName')), '/blobServices/default')]"
            ]
        }
    ],
    "outputs": {}
}

Tuesday, August 24, 2021

azure function- arm

 Function App

by Microsoft
Subscription    xxxxxxxxxxxxxxb
Resource Group    xxxxxxxxxxxxx-grp
Name
poc-swamyt
Runtime stack
Java 8.0
Tags
name: function-app
Storage account
storageaccountoctopaa67
Tags
name: function-app
Plan type
App service plan
Name
ASP-xxxx-test-app-svc-8941
Operating System
Linux
Region
East US 2
SKU
Premium V2
Size
Small
ACU
210 total ACU
Memory
3.5 GB memory
Application Insights
Enabled
Name
xxxx-app-insights
Region
West US 2

{
    "$schema""https://schema.management.azure.com/schemas/2019-04-01/deploymentTemplate.json#",
    "contentVersion""1.0.0.0",
    "parameters": {
        "sites_poc_swamyt_name": {
            "defaultValue""poc-swamyt",
            "type""String"
        },
        "serverfarms_ASP_octopus_test_app_svc_8941_externalid": {
            "defaultValue""/subscriptions/xxxxx-xxx-xx-xx-xxx/resourceGroups/xxx-resource-grp/providers/Microsoft.Web/serverfarms/ASP-xxxx-test-app-svc-8941",
            "type""String"
        }
    },
    "variables": {},
    "resources": [
        {
            "type""Microsoft.Web/sites",
            "apiVersion""2021-01-15",
            "name""[parameters('sites_poc_swamyt_name')]",
            "location""East US 2",
            "tags": {
                "name""function-app"
            },
            "kind""functionapp,linux",
            "properties": {
                "enabled"true,
                "hostNameSslStates": [
                    {
                        "name""[concat(parameters('sites_poc_swamyt_name'), '.azurewebsites.net')]",
                        "sslState""Disabled",
                        "hostType""Standard"
                    },
                    {
                        "name""[concat(parameters('sites_poc_swamyt_name'), '.scm.azurewebsites.net')]",
                        "sslState""Disabled",
                        "hostType""Repository"
                    }
                ],
                "serverFarmId""[parameters('serverfarms_ASP_xxxx_test_app_svc_8941_externalid')]",
                "reserved"true,
                "isXenon"false,
                "hyperV"false,
                "siteConfig": {
                    "numberOfWorkers"1,
                    "linuxFxVersion""Java|8",
                    "acrUseManagedIdentityCreds"false,
                    "alwaysOn"true,
                    "http20Enabled"false,
                    "functionAppScaleLimit"0,
                    "minimumElasticInstanceCount"0
                },
                "scmSiteAlsoStopped"false,
                "clientAffinityEnabled"false,
                "clientCertEnabled"false,
                "clientCertMode""Required",
                "hostNamesDisabled"false,
                "customDomainVerificationId""xxxxxxx",
                "containerSize"1536,
                "dailyMemoryTimeQuota"0,
                "keyVaultReferenceIdentity""SystemAssigned",
                "httpsOnly"false,
                "redundancyMode""None",
                "storageAccountRequired"false
            }
        },
        {
            "type""Microsoft.Web/sites/basicPublishingCredentialsPolicies",
            "apiVersion""2021-01-15",
            "name""[concat(parameters('sites_poc_swamyt_name'), '/ftp')]",
            "location""East US 2",
            "dependsOn": [
                "[resourceId('Microsoft.Web/sites', parameters('sites_poc_swamyt_name'))]"
            ],
            "tags": {
                "name""function-app"
            },
            "properties": {
                "allow"true
            }
        },
        {
            "type""Microsoft.Web/sites/basicPublishingCredentialsPolicies",
            "apiVersion""2021-01-15",
            "name""[concat(parameters('sites_poc_swamyt_name'), '/scm')]",
            "location""East US 2",
            "dependsOn": [
                "[resourceId('Microsoft.Web/sites', parameters('sites_poc_swamyt_name'))]"
            ],
            "tags": {
                "name""function-app"
            },
            "properties": {
                "allow"true
            }
        },
        {
            "type""Microsoft.Web/sites/config",
            "apiVersion""2021-01-15",
            "name""[concat(parameters('sites_poc_swamyt_name'), '/web')]",
            "location""East US 2",
            "dependsOn": [
                "[resourceId('Microsoft.Web/sites', parameters('sites_poc_swamyt_name'))]"
            ],
            "tags": {
                "name""function-app"
            },
            "properties": {
                "numberOfWorkers"1,
                "defaultDocuments": [
                    "Default.htm",
                    "Default.html",
                    "Default.asp",
                    "index.htm",
                    "index.html",
                    "iisstart.htm",
                    "default.aspx",
                    "index.php"
                ],
                "netFrameworkVersion""v4.0",
                "linuxFxVersion""Java|8",
                "requestTracingEnabled"false,
                "remoteDebuggingEnabled"false,
                "httpLoggingEnabled"false,
                "acrUseManagedIdentityCreds"false,
                "logsDirectorySizeLimit"35,
                "detailedErrorLoggingEnabled"false,
                "publishingUsername""$poc-swamyt",
                "azureStorageAccounts": {},
                "scmType""None",
                "use32BitWorkerProcess"false,
                "webSocketsEnabled"false,
                "alwaysOn"true,
                "managedPipelineMode""Integrated",
                "virtualApplications": [
                    {
                        "virtualPath""/",
                        "physicalPath""site\\wwwroot",
                        "preloadEnabled"true
                    }
                ],
                "loadBalancing""LeastRequests",
                "experiments": {
                    "rampUpRules": []
                },
                "autoHealEnabled"false,
                "vnetRouteAllEnabled"false,
                "vnetPrivatePortsCount"0,
                "localMySqlEnabled"false,
                "ipSecurityRestrictions": [
                    {
                        "ipAddress""xx/32",
                        "action""Allow",
                        "tag""Default",
                        "priority"2147483641,
                        "name""Global Innovation Lab"
                    },
                    
                    {
                        "ipAddress""Any",
                        "action""Deny",
                        "priority"2147483647,
                        "name""Deny all",
                        "description""Deny all access"
                    }
                ],
                "scmIpSecurityRestrictions": [
                    {
                        "ipAddress""xxxx/32",
                        "action""Allow",
                        "tag""Default",
                        "priority"2147483641,
                        "name""Global Innovation Lab"
                    },
                    
                    
                    {
                        "ipAddress""Any",
                        "action""Deny",
                        "priority"2147483647,
                        "name""Deny all",
                        "description""Deny all access"
                    }
                ],
                "scmIpSecurityRestrictionsUseMain"false,
                "http20Enabled"false,
                "minTlsVersion""1.2",
                "scmMinTlsVersion""1.0",
                "ftpsState""AllAllowed",
                "preWarmedInstanceCount"0,
                "functionAppScaleLimit"0,
                "functionsRuntimeScaleMonitoringEnabled"false,
                "minimumElasticInstanceCount"0
            }
        },
        {
            "type""Microsoft.Web/sites/hostNameBindings",
            "apiVersion""2021-01-15",
            "name""[concat(parameters('sites_poc_swamyt_name'), '/', parameters('sites_poc_swamyt_name'), '.azurewebsites.net')]",
            "location""East US 2",
            "dependsOn": [
                "[resourceId('Microsoft.Web/sites', parameters('sites_poc_swamyt_name'))]"
            ],
            "properties": {
                "siteName""poc-swamyt",
                "hostNameType""Verified"
            }
        },
        {
            "type""Microsoft.Web/sites/snapshots",
            "apiVersion""2015-08-01",
            "name""[concat(parameters('sites_poc_swamyt_name'), '/2021-08-24T12_56_50_4269006')]",
            "dependsOn": [
                "[resourceId('Microsoft.Web/sites', parameters('sites_poc_swamyt_name'))]"
            ]
        }
    ]
}