我需要使用PoweShell或API从Microsoft.Search/searchServices获得列表查询键。 到目前为止,我要调查的是:
Get-AzureRmResource -ResourceType "Microsoft.Search/searchServices/listQueryKeys" -ResourceGroupName 'resource-group-name' -ResourceName 'resource-name' -ApiVersion '2015-08-19'
仅返回名称的对象数组:
@{Name=a}
@{Name=query-key-created-from-powershell}
我尚未找到获取查询键的API。 有一种简单的方法来获取管理员密钥:
Invoke-AzureRmResourceAction -Action listAdminKeys -ResourceType "Microsoft.Search/searchServices" -ResourceGroupName 'resource-group-name' -ResourceName 'resource-name' -ApiVersion 2015-08-19
但是我无法获取QueryKeys。这不起作用:
Invoke-AzureRmResourceAction -Action listQueryKeys -ResourceType "Microsoft.Search/searchServices" -ResourceGroupName 'resource-group-name' -ResourceName 'resource-name' -ApiVersion 2015-08-19
docs仅指创建或删除查询键。 如何获取查询键作为名称键集合?
答案 0 :(得分:3)
尝试使用以下cmdlet:
const path = require('path');
const webpack = require('webpack');
const SRC_PATH = path.resolve(__dirname, 'catalog/view/');
const DIST_PATH = path.resolve(__dirname, 'catalog/view/prod');
const MiniCssExtractPlugin = require("mini-css-extract-plugin");
const CleanWebpackPlugin = require('clean-webpack-plugin');
const CopyWebpackPlugin = require('copy-webpack-plugin');
const UglifyJsPlugin = require('uglifyjs-webpack-plugin');
const OptimizeCSSAssetsPlugin = require("optimize-css-assets-webpack-plugin");
const ManifestPlugin = require('webpack-manifest-plugin');
const config = (env, argv) => ({
context: SRC_PATH,
entry: './app.js',
output: {
filename: '[name].js',
path: DIST_PATH,
},
//mode: argv.mode === 'production' ? 'production' : 'development',
devtool: argv.mode === 'production' ? 'source-maps' : 'eval',
module: {
rules: [
{
test: /\.js$/,
include: SRC_PATH,
use: {
loader: "babel-loader",
options: {
presets: ["@babel/preset-env"]
}
}
},
{
test: /\.(sa|sc|c)ss$/,
use: [
MiniCssExtractPlugin.loader,
'css-loader'
]
},
{
test: /\.(woff(2)?|ttf|eot|svg)(\?v=\d+\.\d+\.\d+)?$/,
use: [{
loader: 'file-loader',
options: {
name: '[name].[ext]',
outputPath: 'fonts/'
}
}]
},
{
test: require.resolve('jquery'),
use: [{
loader: 'expose-loader',
options: 'jQuery'
}, {
loader: 'expose-loader',
options: '$'
}]
}
],
},
optimization: {
minimizer: [
new UglifyJsPlugin({
cache: true,
parallel: true,
sourceMap: true // set to true if you want JS source maps
}),
new OptimizeCSSAssetsPlugin({})
],
runtimeChunk: {
name: 'runtime'
},
splitChunks: {
chunks: 'all',
minSize: 30000,
maxSize: 0,
minChunks: 1,
maxAsyncRequests: 5,
maxInitialRequests: 3,
automaticNameDelimiter: '~',
name: true,
cacheGroups: {
styles: {
name: 'styles',
test: /\.css$/,
chunks: 'all',
enforce: true
},
vendors: {
test: /[\\/]node_modules[\\/]/,
name: 'vendors',
chunks: 'all'
}
}
}
},
plugins: [
new CleanWebpackPlugin(DIST_PATH),
new MiniCssExtractPlugin({
// Options similar to the same options in webpackOptions.output
// both options are optional
filename: '[name].css',
}),
new webpack.HashedModuleIdsPlugin(),
new ManifestPlugin(),
new webpack.ProvidePlugin({
jQuery: 'jquery',
$: 'jquery',
})
]
})
module.exports = config;
检查您具有正确版本的Azure PowerShell。
答案 1 :(得分:1)
要获取Azure搜索服务的查询键,@ Victor Silva的解决方案可以正常工作。
Get-AzureRmSearchQueryKey -ResourceGroupName "resourceGroupName" -ServiceName "serviceName"
我已经在AzureDevOps任务'xxxx'6.11.0中下载了文件,但AzureRM.Search不包含在其中
对于进一步的问题,由于AzureRM.Search
模块处于预览版本,因此AzureRM 6.11.0
模块中未包含该模块,请参阅此{中的包装详细信息 {3}}。因此,如果要使用此命令Get-AzureRmSearchQueryKey
,则需要独立安装AzureRM.Search
,使用Install-Module -Name AzureRM.Search -AllowPrerelease
,并参考此link。
更新:
如果您想通过API列出查询键,则可以使用此link。
GET https://management.azure.com/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Search/searchServices/{searchServiceName}/listQueryKeys?api-version=2015-08-19