问题是,在pythonsdk中,我无法列出与Azure函数应用程序相关的所有配置信息。因此,使用python SDK get_configration()API时,不包含键ftpsState。所以我想在我的回复中列出那个键。你知道吗
我在找一个能解决我问题的建议。你知道吗
我已经为web应用程序设置了azure客户端并调用函数get\u configuration(),但是在响应中,我没有得到一个必须依赖于我的工作的字段。你知道吗
我的回答是
[
{
'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'
}
]
但是如果我检查基于web的API并调用类似的API,我们就会得到正确的响应。你知道吗
我的web基础引用API:https://docs.microsoft.com/en-us/rest/api/appservice/webapps/getconfiguration
以及它的反应
{
"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
}
}
你知道吗我的客户.web客户端是使用python SDK为web应用程序创建的。你知道吗
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
我希望输出键为“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'
}
]
我试图成功地重现您的问题,我发现这是由于当前包} 及其^{} 版本来发现它。你知道吗
azure==4.0.0
和azure-mgmt-web==0.35.0
不支持ftps_state
属性(如果您通过pip install azure
或pip install azure-mgmt-web
安装)。您可以参考azure_4.0.0
的源代码^{站点配置_资源.pyazure 4.0.0标签
站点配置_资源.py主分支机构
因此,首先,您需要通过pip卸载
azure-sdk-for-python
的所有包,如下所示。你知道吗然后,必须从^{} 源repo安装包
azure-mgmt-web
,如下所示。你知道吗然后,运行我的示例代码并得到您想要的结果,如下所示。你知道吗
相关问题 更多 >
编程相关推荐