通过API具有IP地址的Azure VM

编程入门 行业动态 更新时间:2024-10-26 02:31:26
本文介绍了通过API具有IP地址的Azure VM的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

你好-如何使用通过API的请求使用公共IP地址创建Azure VM.这是当前的请求正文,但我不知道我需要添加什么才能使VM具有公共IP地址. -谢谢 { 位置":"ukwest", 属性":{ "hardwareProfile":{ "vmSize":"Standard_B1s" }, "storageProfile":{ "imageReference":{ "id":"/subscriptions/28f23ba2-c344-448c-808b-e45a97a29764/resourceGroups/main/providers/Microsoft.Compute/images/ukproxy" }, "osDisk":{ 缓存":"ReadWrite", "managedDisk":{ "storageAccountType":"Standard_LRS" }, 名称":"myVMosdisk", " createOption":"FromImage" } }, "osProfile":{ "adminUsername":"user", " computerName":"用户" ;, " adminPassword":"password!" }, " networkProfile":{ "networkInterfaces":[ { "id":"/subscriptions/28f23ba2-c344-448c-808b-e45a97a29764/resourceGroups/main/providers/Microsoft.Network/networkInterfaces/nic", 属性":{ "primary":true } } ] } }, "名称":"VM" }

Hello - how do I create a Azure VM with a public IP address using requests through there API. This is the current request body but I dont know what I need to add to have the VM have an public IP address - Thanks { "location": "ukwest", "properties": { "hardwareProfile": { "vmSize": "Standard_B1s" }, "storageProfile": { "imageReference": { "id": "/subscriptions/28f23ba2-c344-448c-808b-e45a97a29764/resourceGroups/main/providers/Microsoft.Compute/images/ukproxy" }, "osDisk": { "caching": "ReadWrite", "managedDisk": { "storageAccountType": "Standard_LRS" }, "name": "myVMosdisk", "createOption": "FromImage" } }, "osProfile": { "adminUsername": "user", "computerName": "user", "adminPassword": "password!" }, "networkProfile": { "networkInterfaces": [ { "id": "/subscriptions/28f23ba2-c344-448c-808b-e45a97a29764/resourceGroups/main/providers/Microsoft.Network/networkInterfaces/nic", "properties": { "primary": true } } ] } }, "name": "VM" }

推荐答案

您好,SneakerSpace,

Hi SneakerSpace,

我看到您已经创建了一个名为"nic"的网络接口. 查看示例 在此处创建带有公共IP地址的网络接口.在这里,我们指的是我们已经创建的公共IP地址.

I see that you have created a network interface called 'nic'. Look at the example here which creates a network interface with public ip address. Here we are referring to the public ip address which we created already.

创建公共IP的示例为 这里.在这里,公共ip地址是使用默认值创建的.您可以浏览api文档中的所有选项.

Example to create a public ip is here. Here public ip address is created with default values. You can go through the api document for all the options.

如果要使用的编程语言有可用的SDK,也可以考虑使用SDK.

Also consider using SDK's if a SDK is available for the programming language which you are using.

尝试一下,让我知道.

更多推荐

通过API具有IP地址的Azure VM

本文发布于:2023-08-01 16:38:07,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1269911.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:地址   IP   API   Azure   VM

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!