在 Azure Cloud Shell 中,我可以用来az account list-locations获取订阅中支持的所有位置的列表。如何过滤响应以仅包含位置的名称属性并排除所有其他属性?
而不是像这样的对象列表:
{
"displayName": "UK West",
"id": "<<removed>>",
"latitude": "53.427",
"longitude": "-3.084",
"name": "ukwest",
"subscriptionId": null
}
Run Code Online (Sandbox Code Playgroud)
我想获得这样的名称集合:
{
"name": "ukwest",
"name": "ukwest2",
"name": "ukwest3",
}
Run Code Online (Sandbox Code Playgroud) 在Step 3 - Create a Public IP本教程使用 Ansible 将 Windows VM 部署到 Azure 中,当我YAML playbook在Azure Cloud Shell. 问题:我可能缺少什么导致了这个错误,以及如何纠正它?我在网上看到了类似的问题,但它没有帮助,因为我没有犯该在线帖子中提到的错误。
create_public_ip.yaml:
---
- hosts: localhost
tasks:
- name: Create public IP address
azure_rm_publicipaddress:
resource_group: rg-cs-ansible
allocation_method: Static
name: pip-cs-web
register: output_ip_address
- name: Output public IP
debug:
msg: "The public IP is {{ output_ip_address.state.ip_address }}"
Run Code Online (Sandbox Code Playgroud)
错误:
ERROR! We were unable to read either as JSON nor YAML, these are …Run Code Online (Sandbox Code Playgroud) 我试图在现有的azure sql服务器上配置防火墙规则.我使用Azure Cloud shell运行以下命令,这会导致错误.
〜$ az sql server防火墙 - 规则列表--server mydbserver.database.windows.net --resource-group myresourcegroup
无法对嵌套资源执行请求的操作.找不到父资源'mydbserver.database.windows.net'.
每当我启动 Azure Cloud Shell 时,都会收到以下错误:
无法装载 azure 文件共享。您的云驱动器将不可用 您的 Cloud Shell 会话将是短暂的,因此任何文件或系统更改都不会在当前会话之外持续存在。
有人可以帮助我或解释为什么会发生这种情况吗?
web-services azure azure-virtual-machine azureportal azure-cloud-shell
在Powershell中cd有效,但在我的Azure Cloud Shell中不起作用。我想念什么?
复制的会话显示了我尝试进入quickstart目录(在powershell shell中创建)
Welcome to Azure Cloud Shell
Type "az" to use Azure CLI 2.0
Type "help" to learn about Cloud Shell
MOTD: Switch to Bash from PowerShell: bash
VERBOSE: Authenticating to Azure ...
VERBOSE: Building your Azure drive …
Azure:/
PS Azure:\> ls -F
clouddrive@ quickstart/ test/
Azure:/
PS Azure:\> cd quickstart
cd : Cannot find path 'Azure:/quickstart' because it does not exist.
At line:1 char:1
+ cd quickstart
+ ~~~~~~~~~~~~~
+ CategoryInfo : ObjectNotFound: …Run Code Online (Sandbox Code Playgroud) 我正在尝试按照此处提供的说明创建 Application Insights 资源: https: //learn.microsoft.com/en-us/azure/azure-monitor/app/powershell
但是,当我执行文档中的命令时:
New-AzResourceGroupDeployment -ResourceGroupName Fabrikam -TemplateFile .\template1.json -appName myNewApp
Run Code Online (Sandbox Code Playgroud)
替换 Fabrikam 我的资源组名称,它会抛出 ResourceGroupNotFound。如果我列出资源组:
az group list
Run Code Online (Sandbox Code Playgroud)
我可以清楚地看到列表中的资源组,因此我知道我处于正确的订阅上下文中。
我错过了什么明显的事情吗?
我已将我的 template1.json 版本上传到 CLI 存储。