小编Jas*_* Ye的帖子

Azure CLI如何检查资源是否存在

我开始编写一个bash脚本来在新的或现有的资源组中配置VM,以便我们可以强制执行命名约定和配置.

在bash脚本中,如何检查资源是否已存在,以便我不再尝试创建它?

#1. If a new resource group is desired, create it now.  Microsoft Docs
az group create --name $RESOURCEGROUPNAME --location $LOCATION


#2. Create a virtual network and subnet if one has not already been created.  Microsoft Docs
#   Consider a separate VNet for each resource group. 
#   az network vnet list -output table
az network vnet create \
--resource-group $RESOURCEGROUPNAME \
--name $RESOURCEGROUPNAME-vnet \
--address-prefix 10.0.x.0/24 \
--subnet-name default \
--subnet-prefix 10.0.x.0/24


#x is the next available 3rd octet …
Run Code Online (Sandbox Code Playgroud)

azure azure-virtual-machine azure-cli azure-cli2

3
推荐指数
3
解决办法
4177
查看次数

“无法挂载天蓝色文件共享。您的云驱动器将不可用”

每当我启动 Azure Cloud Shell 时,都会收到以下错误:

无法装载 azure 文件共享。您的云驱动器将不可用 您的 Cloud Shell 会话将是短暂的,因此任何文件或系统更改都不会在当前会话之外持续存在。

有人可以帮助我或解释为什么会发生这种情况吗?

web-services azure azure-virtual-machine azureportal azure-cloud-shell

3
推荐指数
1
解决办法
4100
查看次数

imagepullbackoff while pulling image from azure container registry

First i have created the docker image and created kubernetes cluster in azure container service. Then tag and push the image to my repository, but while pulling my image from azure container registry to kubernetes cluster the pod are created but in status it shows imagepullback off

The yaml file for basic api image

**apiVersion: v1
kind: Pod
metadata:
  name: myapis
spec:
  containers:
    - name: myapis
      image: ciqsample.azurecr.io/myapis
  imagePullSecrets:
    - name: samplekey**
Run Code Online (Sandbox Code Playgroud)

azure docker kubernetes

2
推荐指数
2
解决办法
5135
查看次数

使用 Azure python sdk 创建 NSG 不使用安全规则

我在用

\n\n

\xce\xbb pip show azure\nName: azure\nVersion: 2.0.0

\n\n

我想创建一个具有特定安全规则的 NSG。我有以下代码。

\n\n

````

\n\n
from azure.mgmt.compute import ComputeManagementClient\nfrom azure.mgmt.network import NetworkManagementClient\nfrom azure.common.credentials import ServicePrincipalCredentials\nfrom azure.mgmt.network.v2017_03_01.models import NetworkSecurityGroup\nfrom azure.mgmt.network.v2017_03_01.models import SecurityRule\nsubscription_id = \'my-id\'\ncredentials = ...\n\ncompute_client = ComputeManagementClient(\n    credentials,\n    subscription_id\n)\n\nnetwork_client = NetworkManagementClient(\n    credentials,\n    subscription_id\n)\nfrom azure.mgmt.resource.resources import ResourceManagementClient\n\nresource_client = ResourceManagementClient(\n    credentials,\n    subscription_id\n)\nresource_client.providers.register(\'Microsoft.Compute\')\nresource_client.providers.register(\'Microsoft.Network\')\n\nresource_group_name = \'test-rg\'\n\nsecurity_rule = SecurityRule( protocol=\'Tcp\', source_address_prefix=\'Internet\', \n                              source_port_range="*", destination_port_range="3389", priority=100,\n                              destination_address_prefix=\'*\', access=\'Allow\', direction=\'Inbound\')\nnsg_params = NetworkSecurityGroup(id=\'test-nsg\', location=\'UK South\', tags={ \'name\' : \'testnsg\' })\nnetwork_client.network_security_groups.create_or_update(resource_group_name, "test-nsg", parameters=nsg_params, security_rules=[security_rule])\n
Run Code Online (Sandbox Code Playgroud)\n\n

这确实使 NSG 很好,但未能创建适当的规则。

\n\n

我缺少什么? …

azure azure-virtual-network azure-sdk-python

2
推荐指数
1
解决办法
2665
查看次数

如何将dns设置为azure aks?

我目前正在使用Azure AKS.

我有一个前端应用程序,它使用LoadBalancer来拥有一个公共IP来访问该服务.

我应该将我的域名指向公共IP地址吗?

由于IP是动态的,如果端口被破坏并再次重新创建,则会生成新的IP.

我应该使用Ingress/Nginx控制器来管理IP吗?

azure azure-virtual-network azure-container-service

1
推荐指数
2
解决办法
6431
查看次数