The problem is that with the python SDK I am not able to list all config info related to Azure function app. So with python SDK get_configration() API in not containing a key ftpsState. So I want to list that key in my response.
I am looking for a suggestion which can solve my problem.
I have setup azure client for web apps and calling the function get_configuration(), but in the response, I am not getting a field which I have to rely on my work.
Reference for Python SDK which I have referred. https://learn.microsoft.com/en-us/python/api/azure-mgmt-web/azure.mgmt.web.operations.web_apps_operations.webappsoperations?view=azure-python#get-configuration-resource-group-name--name--custom-headers-none--raw-false----operation-config-
My response is
[
{
'id': '/subscriptions/<mysubscription>/resourceGroups/fnf/providers/Microsoft.Web/sites/fnf/config/web',
'type': 'Microsoft.Web/sites/config',
'properties': {
'managedPipelineMode': 'Integrated',
'autoHealEnabled': False,
'phpVersion': '5.6',
'publishingUsername': '$fnf',
'vnetName': '',
'scmType': 'None',
'detailedErrorLoggingEnabled': False,
'linuxFxVersion': '',
'experiments': {
'rampUpRules': [
]
},
'loadBalancing': 'LeastRequests',
'numberOfWorkers': 1,
'cors': {
'allowedOrigins': [
'https://functions.azure.com',
'https://functions-staging.azure.com',
'https://functions-next.azure.com'
]
},
'http20Enabled': False,
'nodeVersion': '',
'webSocketsEnabled': True,
'requestTracingEnabled': False,
'alwaysOn': False,
'logsDirectorySizeLimit': 35,
'use32BitWorkerProcess': True,
'netFrameworkVersion': 'v4.0',
'minTlsVersion': '1.2',
'virtualApplications': [
{
'preloadEnabled': False,
'physicalPath': 'site\\wwwroot',
'virtualPath': '/'
}
],
'pythonVersion': '',
'remoteDebuggingVersion': 'VS2017',
'localMySqlEnabled': False,
'appCommandLine': '',
'httpLoggingEnabled': False,
'defaultDocuments': [
'Default.htm',
'Default.html',
'Default.asp',
'index.htm',
'index.html',
'iisstart.htm',
'default.aspx',
'index.php'
],
'remoteDebuggingEnabled': False
},
'name': 'fnf'
}
]
But If I check the web-based API and call similar API from we getting the proper response.
My web base reference API: https://learn.microsoft.com/en-us/rest/api/appservice/webapps/getconfiguration
and its response
{
"id": "/subscriptions/<mysubscription>/resourceGroups/fnf/providers/Microsoft.Web/sites/fnf/config/web",
"name": "fnf",
"type": "Microsoft.Web/sites/config",
"location": "Central US",
"properties": {
"numberOfWorkers": 1,
"defaultDocuments": [
"Default.htm",
"Default.html",
"Default.asp",
"index.htm",
"index.html",
"iisstart.htm",
"default.aspx",
"index.php"
],
"netFrameworkVersion": "v4.0",
"phpVersion": "5.6",
"pythonVersion": "",
"nodeVersion": "",
"linuxFxVersion": "",
"windowsFxVersion": null,
"requestTracingEnabled": false,
"remoteDebuggingEnabled": false,
"remoteDebuggingVersion": "VS2017",
"httpLoggingEnabled": false,
"logsDirectorySizeLimit": 35,
"detailedErrorLoggingEnabled": false,
"publishingUsername": "$fnf",
"publishingPassword": null,
"appSettings": null,
"metadata": null,
"connectionStrings": null,
"machineKey": null,
"handlerMappings": null,
"documentRoot": null,
"scmType": "None",
"use32BitWorkerProcess": true,
"webSocketsEnabled": true,
"alwaysOn": false,
"javaVersion": null,
"javaContainer": null,
"javaContainerVersion": null,
"appCommandLine": "",
"managedPipelineMode": 0,
"virtualApplications": [
{
"virtualPath": "/",
"physicalPath": "site\\wwwroot",
"preloadEnabled": false,
"virtualDirectories": null
}
],
"winAuthAdminState": 0,
"winAuthTenantState": 0,
"customAppPoolIdentityAdminState": false,
"customAppPoolIdentityTenantState": false,
"runtimeADUser": null,
"runtimeADUserPassword": null,
"loadBalancing": 1,
"routingRules": [],
"experiments": {
"rampUpRules": []
},
"limits": null,
"autoHealEnabled": false,
"autoHealRules": null,
"tracingOptions": null,
"vnetName": "",
"siteAuthEnabled": true,
"siteAuthSettings": {
"enabled": null,
"unauthenticatedClientAction": null,
"tokenStoreEnabled": null,
"allowedExternalRedirectUrls": null,
"defaultProvider": null,
"clientId": null,
"clientSecret": null,
"clientSecretCertificateThumbprint": null,
"issuer": null,
"allowedAudiences": null,
"additionalLoginParams": null,
"isAadAutoProvisioned": false,
"googleClientId": null,
"googleClientSecret": null,
"googleOAuthScopes": null,
"facebookAppId": null,
"facebookAppSecret": null,
"facebookOAuthScopes": null,
"twitterConsumerKey": null,
"twitterConsumerSecret": null,
"microsoftAccountClientId": null,
"microsoftAccountClientSecret": null,
"microsoftAccountOAuthScopes": null
},
"cors": {
"allowedOrigins": [
"https://functions.azure.com",
"https://functions-staging.azure.com",
"https://functions-next.azure.com"
],
"supportCredentials": false
},
"push": null,
"apiDefinition": null,
"apiManagementConfig": null,
"autoSwapSlotName": null,
"localMySqlEnabled": false,
"managedServiceIdentityId": null,
"xManagedServiceIdentityId": null,
"ipSecurityRestrictions": null,
"scmIpSecurityRestrictions": null,
"scmIpSecurityRestrictionsUseMain": null,
"http20Enabled": false,
"minTlsVersion": "1.2",
"ftpsState": "FtpsOnly",
"reservedInstanceCount": 0,
"preWarmedInstanceCount": null,
"healthCheckPath": null
}
}
self.my_client.web is client created for the web app with python SDK.
def get_config(self, f_id):
pf = p_id(f_id) #extract info in a dict
cnf = self.my_client.web.web_apps.get_configuration(
resource_group_name=pf['resource_group'],
name=pf['resource_name'],
subscription_id=pf.get('subscription')
)
return cnf
I am expecting the output with the key "ftpsState".
[
{
'id': '/subscriptions/<mysubscription>/resourceGroups/fnf/providers/Microsoft.Web/sites/fnf/config/web',
'type': 'Microsoft.Web/sites/config',
'properties': {
'managedPipelineMode': 'Integrated',
'autoHealEnabled': False,
'phpVersion': '5.6',
'publishingUsername': '$fnf',
'vnetName': '',
'scmType': 'None',
'detailedErrorLoggingEnabled': False,
'linuxFxVersion': '',
'experiments': {
'rampUpRules': [
]
},
'loadBalancing': 'LeastRequests',
'numberOfWorkers': 1,
'cors': {
'allowedOrigins': [
'https://functions.azure.com',
'https://functions-staging.azure.com',
'https://functions-next.azure.com'
]
},
'http20Enabled': False,
'ftpsState': 'FtpsOnly',
'nodeVersion': '',
'webSocketsEnabled': True,
'requestTracingEnabled': False,
'alwaysOn': False,
'logsDirectorySizeLimit': 35,
'use32BitWorkerProcess': True,
'netFrameworkVersion': 'v4.0',
'minTlsVersion': '1.2',
'virtualApplications': [
{
'preloadEnabled': False,
'physicalPath': 'site\\wwwroot',
'virtualPath': '/'
}
],
'pythonVersion': '',
'remoteDebuggingVersion': 'VS2017',
'localMySqlEnabled': False,
'appCommandLine': '',
'httpLoggingEnabled': False,
'defaultDocuments': [
'Default.htm',
'Default.html',
'Default.asp',
'index.htm',
'index.html',
'iisstart.htm',
'default.aspx',
'index.php'
],
'remoteDebuggingEnabled': False
},
'name': 'fnf'
}
]