2016-02-16 115 views
3

我们使用部署模板设置了Azure Web应用程序。现在从命令行我们可以检查一些配置设置。我们如何显示当前的连接字符串?我们试过这个:显示连接字符串

azure webapp show <resource-group> <site-name> 

这只给我们一些细节,不包括连接字符串。

Web app Name 
SKU   
Enabled  
Last Modified 
Location  
Host Name  

我们也试过寻找resources.azure.com,我们看到连接字符串列在那里。我们只是不知道如何通过Azure CLI访问它。

回答

2

您可以列出连接字符串如果您从ARM切换到ASM模式并使用azure site connectionstring list ...

$ azure config set mode asm 
info: Executing command config set 
info: Setting "mode" to value "asm" 
info: Changes saved 
info: config set command OK 

$ azure site connectionstring list <webAppName> --json 
[ 
    { 
    "connectionString": "my super secret connection string!", 
    "name": "DefaultConnection", 
    "type": 2 
    } 
] 
2

目前你不能。最好你有一些额外的信息使用-vv选项。

azure webapp show [resource-group] [name] -vv 

的ConnectionString不会在那里,甚至寿的appSettings中生成的JSON显示出来,它总是会不管你把价值英寸

"siteProperties":{ 
    "metadata":null, 
    "properties":[], 
    "appSettings":null 
}