VS代码IntelliSense不适用于某些ARM命令

发布于 2025-02-13 05:46:24 字数 743 浏览 4 评论 0原文

我创建了一个ARM模板来部署Azure存储帐户。 VS代码臂Intellisense到目前为止工作正常。 但是,对于“复制”(复制已经创建的存储帐户),它根本不起作用。我想念什么?

{
    "$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentTemplate.json#",
    "contentVersion": "1.0.0.0",
    "parameters": {},
    "functions": [],
    "variables": {},
    "resources": [
        {
            "name": "appstore22121975",
            "type": "Microsoft.Storage/storageAccounts",
            "apiVersion": "2021-04-01",
            "tags": {
                "displayName": "appstore"
            },
            "location": "East US",
            "kind": "StorageV2",
            "sku": {
                "name": "Standard_LRS"
            }
        }
    ],
    "outputs": {}
}

I have created an ARM template to deploy Azure Storage Account. VS Code ARM intellisense worked fine until now.
However, for 'copy'(to copy the storage account already created) it simply does not work. What am i missing?

{
    "$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentTemplate.json#",
    "contentVersion": "1.0.0.0",
    "parameters": {},
    "functions": [],
    "variables": {},
    "resources": [
        {
            "name": "appstore22121975",
            "type": "Microsoft.Storage/storageAccounts",
            "apiVersion": "2021-04-01",
            "tags": {
                "displayName": "appstore"
            },
            "location": "East US",
            "kind": "StorageV2",
            "sku": {
                "name": "Standard_LRS"
            }
        }
    ],
    "outputs": {}
}

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

月下凄凉 2025-02-20 05:46:24

我们尝试使用配置中的VS代码中的ARM模板创建一个存储帐户,并成功地工作

以下是我们遵循的解决方法;

但是,对于“复制”(复制已经创建的存储帐户)
根本不起作用

,您似乎已经创建了一个具有相同名称的存储帐户,并尝试再次创建具有相同名称的存储帐户,该名称已经创建了已经创建的

如果是这种情况, 请确保 创建存储帐户相应地,使用全球唯一的名称 使它起作用

template.json: -

{
"$schema": "http://schema.management.azure.com/schemas/2015-01-01/deploymentTemplate.json#",
"contentVersion": "1.0.0.0",
"parameters": {
"location": {
"type": "string"
},
"storageAccountName": {
"type": "string"
},
"accountType": {
"type": "string"
},
"kind": {
"type": "string"
},
"accessTier": {
"type": "string"
},
"minimumTlsVersion": {
"type": "string"
},
"supportsHttpsTrafficOnly": {
"type": "bool"
},
"publicNetworkAccess": {
"type": "string"
},
"allowBlobPublicAccess": {
"type": "bool"
},
"allowSharedKeyAccess": {
"type": "bool"
},
"allowCrossTenantReplication": {
"type": "bool"
},
"defaultOAuth": {
"type": "bool"
},
"networkAclsBypass": {
"type": "string"
},
"networkAclsDefaultAction": {
"type": "string"
},
"dnsEndpointType": {
"type": "string"
},
"keySource": {
"type": "string"
},
"encryptionEnabled": {
"type": "bool"
},
"keyTypeForTableAndQueueEncryption": {
"type": "string"
},
"infrastructureEncryptionEnabled": {
"type": "bool"
},
"isContainerRestoreEnabled": {
"type": "bool"
},
"isBlobSoftDeleteEnabled": {
"type": "bool"
},
"blobSoftDeleteRetentionDays": {
"type": "int"
},
"isContainerSoftDeleteEnabled": {
"type": "bool"
},
"containerSoftDeleteRetentionDays": {
"type": "int"
},
"changeFeed": {
"type": "bool"
},
"isVersioningEnabled": {
"type": "bool"
},
"isShareSoftDeleteEnabled": {
"type": "bool"
},
"shareSoftDeleteRetentionDays": {
"type": "int"
}
},
"variables": {},
"resources": [
{
"name": "[parameters('storageAccountName')]",
"type": "Microsoft.Storage/storageAccounts",
"apiVersion": "2021-09-01",
"location": "[parameters('location')]",
"properties": {
"accessTier": "[parameters('accessTier')]",
"minimumTlsVersion": "[parameters('minimumTlsVersion')]",
"supportsHttpsTrafficOnly": "[parameters('supportsHttpsTrafficOnly')]",
"publicNetworkAccess": "[parameters('publicNetworkAccess')]",
"allowBlobPublicAccess": "[parameters('allowBlobPublicAccess')]",
"allowSharedKeyAccess": "[parameters('allowSharedKeyAccess')]",
"allowCrossTenantReplication": "[parameters('allowCrossTenantReplication')]",
"defaultToOAuthAuthentication": "[parameters('defaultOAuth')]",
"networkAcls": {
"bypass": "[parameters('networkAclsBypass')]",
"defaultAction": "[parameters('networkAclsDefaultAction')]",
"ipRules": []
},
"dnsEndpointType": "[parameters('dnsEndpointType')]",
"encryption": {
"keySource": "[parameters('keySource')]",
"services": {
"blob": {
"enabled": "[parameters('encryptionEnabled')]"
},
"file": {
"enabled": "[parameters('encryptionEnabled')]"
},
"table": {
"enabled": "[parameters('encryptionEnabled')]"
},
"queue": {
"enabled": "[parameters('encryptionEnabled')]"
}
},
"requireInfrastructureEncryption": "[parameters('infrastructureEncryptionEnabled')]"
}
},
"dependsOn": [],
"sku": {
"name": "[parameters('accountType')]"
},
"kind": "[parameters('kind')]",
"tags": {}
},
{
"name": "[concat(parameters('storageAccountName'), '/default')]",
"type": "Microsoft.Storage/storageAccounts/blobServices",
"apiVersion": "2021-09-01",
"properties": {
"restorePolicy": {
"enabled": "[parameters('isContainerRestoreEnabled')]"
},
"deleteRetentionPolicy": {
"enabled": "[parameters('isBlobSoftDeleteEnabled')]",
"days": "[parameters('blobSoftDeleteRetentionDays')]"
},
"containerDeleteRetentionPolicy": {
"enabled": "[parameters('isContainerSoftDeleteEnabled')]",
"days": "[parameters('containerSoftDeleteRetentionDays')]"
},
"changeFeed": {
"enabled": "[parameters('changeFeed')]"
},
"isVersioningEnabled": "[parameters('isVersioningEnabled')]"
},
"dependsOn": [
"[concat('Microsoft.Storage/storageAccounts/', parameters('storageAccountName'))]"
]
},
{
"name": "[concat(parameters('storageAccountName'), '/default')]",
"type": "Microsoft.Storage/storageAccounts/fileservices",
"apiVersion": "2021-09-01",
"properties": {
"shareDeleteRetentionPolicy": {
"enabled": "[parameters('isShareSoftDeleteEnabled')]",
"days": "[parameters('shareSoftDeleteRetentionDays')]"
}
},
"dependsOn": [
"[concat('Microsoft.Storage/storageAccounts/', parameters('storageAccountName'))]",
"[concat(concat('Microsoft.Storage/storageAccounts/', parameters('storageAccountName')), '/blobServices/default')]"
]
}
],
"outputs": {}
}

对于注释,我们已在资源中使用此API版本

"resources": [
    {
    "name": "[parameters('storageAccountName')]",
    "type": "Microsoft.Storage/storageAccounts",
    "apiVersion": "2021-09-01",
    "location": "[parameters('location')]",

。 em> 倾向

{
    "$schema": "https://schema.management.azure.com/schemas/2015-01-01/deploymentParameters.json#",
    "contentVersion": "1.0.0.0",
    "parameters": {
    "location": {
    "value": "eastus"
    },
    "storageAccountName": {
    "value": "something22175"
    },
    "accountType": {
    "value": "Standard_LRS"
    },
    "kind": {
    "value": "StorageV2"
    },
    "accessTier": {
    "value": "Hot"
    },
    "minimumTlsVersion": {
    "value": "TLS1_2"
    },
    "supportsHttpsTrafficOnly": {
    "value": true
    },
    "publicNetworkAccess": {
    "value": "Enabled"
    },
    "allowBlobPublicAccess": {
    "value": true
    },
    "allowSharedKeyAccess": {
    "value": true
    },
    "allowCrossTenantReplication": {
    "value": true
    },
    "defaultOAuth": {
    "value": false
    },
    "networkAclsBypass": {
    "value": "AzureServices"
    },
    "networkAclsDefaultAction": {
    "value": "Allow"
    },
    "dnsEndpointType": {
    "value": "Standard"
    },
    "keySource": {
    "value": "Microsoft.Storage"
    },
    "encryptionEnabled": {
    "value": true
    },
    "keyTypeForTableAndQueueEncryption": {
    "value": "Account"
    },
    "infrastructureEncryptionEnabled": {
    "value": false
    },
    "isContainerRestoreEnabled": {
    "value": false
    },
    "isBlobSoftDeleteEnabled": {
    "value": true
    },
    "blobSoftDeleteRetentionDays": {
    "value": 7
    },
    "isContainerSoftDeleteEnabled": {
    "value": true
    },
    "containerSoftDeleteRetentionDays": {
    "value": 7
    },
    "changeFeed": {
    "value": false
    },
    "isVersioningEnabled": {
    "value": false
    },
    "isShareSoftDeleteEnabled": {
    "value": true
    },
    "shareSoftDeleteRetentionDays": {
    "value": 7
    }
    }
    }

。安装和更新 。

输出详细信息: -

注2: - 对于Intellisense,如果您想尝试重新部署相同的尝试刷新VS代码并再次部署,它应该起作用

有关更多信息,请参阅下面的链接: -

We have tried to create an storage account using ARM Template in VS CODE with your configuration as well and works successfully.

Below are the workaround we followed;

However, for 'copy'(to copy the storage account already created) it
simply does not work

It seems you have created one storage account with the same name and trying to create the storage account with the same name again which has been created already.

If that is the case ,Please make sure to Create storage account with globally unique name accordingly to get it work.

template.json:-

{
"$schema": "http://schema.management.azure.com/schemas/2015-01-01/deploymentTemplate.json#",
"contentVersion": "1.0.0.0",
"parameters": {
"location": {
"type": "string"
},
"storageAccountName": {
"type": "string"
},
"accountType": {
"type": "string"
},
"kind": {
"type": "string"
},
"accessTier": {
"type": "string"
},
"minimumTlsVersion": {
"type": "string"
},
"supportsHttpsTrafficOnly": {
"type": "bool"
},
"publicNetworkAccess": {
"type": "string"
},
"allowBlobPublicAccess": {
"type": "bool"
},
"allowSharedKeyAccess": {
"type": "bool"
},
"allowCrossTenantReplication": {
"type": "bool"
},
"defaultOAuth": {
"type": "bool"
},
"networkAclsBypass": {
"type": "string"
},
"networkAclsDefaultAction": {
"type": "string"
},
"dnsEndpointType": {
"type": "string"
},
"keySource": {
"type": "string"
},
"encryptionEnabled": {
"type": "bool"
},
"keyTypeForTableAndQueueEncryption": {
"type": "string"
},
"infrastructureEncryptionEnabled": {
"type": "bool"
},
"isContainerRestoreEnabled": {
"type": "bool"
},
"isBlobSoftDeleteEnabled": {
"type": "bool"
},
"blobSoftDeleteRetentionDays": {
"type": "int"
},
"isContainerSoftDeleteEnabled": {
"type": "bool"
},
"containerSoftDeleteRetentionDays": {
"type": "int"
},
"changeFeed": {
"type": "bool"
},
"isVersioningEnabled": {
"type": "bool"
},
"isShareSoftDeleteEnabled": {
"type": "bool"
},
"shareSoftDeleteRetentionDays": {
"type": "int"
}
},
"variables": {},
"resources": [
{
"name": "[parameters('storageAccountName')]",
"type": "Microsoft.Storage/storageAccounts",
"apiVersion": "2021-09-01",
"location": "[parameters('location')]",
"properties": {
"accessTier": "[parameters('accessTier')]",
"minimumTlsVersion": "[parameters('minimumTlsVersion')]",
"supportsHttpsTrafficOnly": "[parameters('supportsHttpsTrafficOnly')]",
"publicNetworkAccess": "[parameters('publicNetworkAccess')]",
"allowBlobPublicAccess": "[parameters('allowBlobPublicAccess')]",
"allowSharedKeyAccess": "[parameters('allowSharedKeyAccess')]",
"allowCrossTenantReplication": "[parameters('allowCrossTenantReplication')]",
"defaultToOAuthAuthentication": "[parameters('defaultOAuth')]",
"networkAcls": {
"bypass": "[parameters('networkAclsBypass')]",
"defaultAction": "[parameters('networkAclsDefaultAction')]",
"ipRules": []
},
"dnsEndpointType": "[parameters('dnsEndpointType')]",
"encryption": {
"keySource": "[parameters('keySource')]",
"services": {
"blob": {
"enabled": "[parameters('encryptionEnabled')]"
},
"file": {
"enabled": "[parameters('encryptionEnabled')]"
},
"table": {
"enabled": "[parameters('encryptionEnabled')]"
},
"queue": {
"enabled": "[parameters('encryptionEnabled')]"
}
},
"requireInfrastructureEncryption": "[parameters('infrastructureEncryptionEnabled')]"
}
},
"dependsOn": [],
"sku": {
"name": "[parameters('accountType')]"
},
"kind": "[parameters('kind')]",
"tags": {}
},
{
"name": "[concat(parameters('storageAccountName'), '/default')]",
"type": "Microsoft.Storage/storageAccounts/blobServices",
"apiVersion": "2021-09-01",
"properties": {
"restorePolicy": {
"enabled": "[parameters('isContainerRestoreEnabled')]"
},
"deleteRetentionPolicy": {
"enabled": "[parameters('isBlobSoftDeleteEnabled')]",
"days": "[parameters('blobSoftDeleteRetentionDays')]"
},
"containerDeleteRetentionPolicy": {
"enabled": "[parameters('isContainerSoftDeleteEnabled')]",
"days": "[parameters('containerSoftDeleteRetentionDays')]"
},
"changeFeed": {
"enabled": "[parameters('changeFeed')]"
},
"isVersioningEnabled": "[parameters('isVersioningEnabled')]"
},
"dependsOn": [
"[concat('Microsoft.Storage/storageAccounts/', parameters('storageAccountName'))]"
]
},
{
"name": "[concat(parameters('storageAccountName'), '/default')]",
"type": "Microsoft.Storage/storageAccounts/fileservices",
"apiVersion": "2021-09-01",
"properties": {
"shareDeleteRetentionPolicy": {
"enabled": "[parameters('isShareSoftDeleteEnabled')]",
"days": "[parameters('shareSoftDeleteRetentionDays')]"
}
},
"dependsOn": [
"[concat('Microsoft.Storage/storageAccounts/', parameters('storageAccountName'))]",
"[concat(concat('Microsoft.Storage/storageAccounts/', parameters('storageAccountName')), '/blobServices/default')]"
]
}
],
"outputs": {}
}

For a Note we have used this api version for the storage account in resource.

"resources": [
    {
    "name": "[parameters('storageAccountName')]",
    "type": "Microsoft.Storage/storageAccounts",
    "apiVersion": "2021-09-01",
    "location": "[parameters('location')]",

Deplyment.parameter.json

{
    "$schema": "https://schema.management.azure.com/schemas/2015-01-01/deploymentParameters.json#",
    "contentVersion": "1.0.0.0",
    "parameters": {
    "location": {
    "value": "eastus"
    },
    "storageAccountName": {
    "value": "something22175"
    },
    "accountType": {
    "value": "Standard_LRS"
    },
    "kind": {
    "value": "StorageV2"
    },
    "accessTier": {
    "value": "Hot"
    },
    "minimumTlsVersion": {
    "value": "TLS1_2"
    },
    "supportsHttpsTrafficOnly": {
    "value": true
    },
    "publicNetworkAccess": {
    "value": "Enabled"
    },
    "allowBlobPublicAccess": {
    "value": true
    },
    "allowSharedKeyAccess": {
    "value": true
    },
    "allowCrossTenantReplication": {
    "value": true
    },
    "defaultOAuth": {
    "value": false
    },
    "networkAclsBypass": {
    "value": "AzureServices"
    },
    "networkAclsDefaultAction": {
    "value": "Allow"
    },
    "dnsEndpointType": {
    "value": "Standard"
    },
    "keySource": {
    "value": "Microsoft.Storage"
    },
    "encryptionEnabled": {
    "value": true
    },
    "keyTypeForTableAndQueueEncryption": {
    "value": "Account"
    },
    "infrastructureEncryptionEnabled": {
    "value": false
    },
    "isContainerRestoreEnabled": {
    "value": false
    },
    "isBlobSoftDeleteEnabled": {
    "value": true
    },
    "blobSoftDeleteRetentionDays": {
    "value": 7
    },
    "isContainerSoftDeleteEnabled": {
    "value": true
    },
    "containerSoftDeleteRetentionDays": {
    "value": 7
    },
    "changeFeed": {
    "value": false
    },
    "isVersioningEnabled": {
    "value": false
    },
    "isShareSoftDeleteEnabled": {
    "value": true
    },
    "shareSoftDeleteRetentionDays": {
    "value": 7
    }
    }
    }

NOTE 1:- Make sure the we have following ARM EXTENSION installed and updated.

enter image description here

OUTPUT DETAILS:-
enter image description here
enter image description here

enter image description here

NOTE 2:- For the intellisense If you are trying to redeploy the same try to refresh the VS CODE and deploy it again,It should work.

For more information please refer the below links:-

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文