Warning: file_get_contents(/data/phpspider/zhask/data//catemap/0/azure/12.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
C# 如何通过代码创建新的Microsoft Azure HybridConnection?_C#_Azure - Fatal编程技术网

C# 如何通过代码创建新的Microsoft Azure HybridConnection?

C# 如何通过代码创建新的Microsoft Azure HybridConnection?,c#,azure,C#,Azure,我正在使用HybridConnectionNamespace并通过Azure门户创建多个HybridConnections。问题很简单。如何以编程方式创建它(Azure SDK、PowerShell脚本等) 使用PowerShell cmdlet |混合连接管理器: 添加HybridConnection 更新HybridConnection 删除杂交连接 获得杂交连接 设置HybridConnectionManager配置 GoodLuck使用PowerShell cmdlet |混合连接管理

我正在使用HybridConnectionNamespace并通过Azure门户创建多个HybridConnections。问题很简单。如何以编程方式创建它(Azure SDK、PowerShell脚本等)


使用PowerShell cmdlet |混合连接管理器:

添加HybridConnection

更新HybridConnection

删除杂交连接

获得杂交连接

设置HybridConnectionManager配置


GoodLuck

使用PowerShell cmdlet |混合连接管理器:

添加HybridConnection

更新HybridConnection

删除杂交连接

获得杂交连接

设置HybridConnectionManager配置


GoodLuck

根据本文,目前有两种不同的方法来创建中继名称空间

Azure门户和Azure资源管理器模板

如果您想以编程方式创建它,我建议您可以使用azure rest api通过代码发送部署模板

更多详细信息,您可以参考以下内容和代码:

注意:如果您想使用RESTAPI向azure发送请求,您需要首先创建azure Active Directory应用程序和服务主体。在生成服务主体之后,您可以获得applicationid、access key和talentid。更多细节,你可以参考这个

Rest正文(json.txt):

注意:您需要更改参数的名称和位置值

{"properties":{"mode":"incremental","debugSetting":{"detailLevel":"RequestContent, ResponseContent"},"parameters":{"name":{"value":"yourrelayname"},"location":{"value":"location"}},"template":{"$schema":"http://schema.management.azure.com/schemas/2014-04-01-preview/deploymentTemplate.json#","contentVersion":"1.0.0.0","parameters":{"name":{"type":"string"},"location":{"type":"string"}},"resources":[{"apiVersion":"2016-07-01","name":"[parameters('name')]","location":"[parameters('location')]","type":"Microsoft.Relay/namespaces","properties":{"namespaceType":"Relay"}}]}}}
代码:

结果:


根据本文,目前有两种不同的方法来创建中继名称空间

Azure门户和Azure资源管理器模板

如果您想以编程方式创建它,我建议您可以使用azure rest api通过代码发送部署模板

更多详细信息,您可以参考以下内容和代码:

注意:如果您想使用RESTAPI向azure发送请求,您需要首先创建azure Active Directory应用程序和服务主体。在生成服务主体之后,您可以获得applicationid、access key和talentid。更多细节,你可以参考这个

Rest正文(json.txt):

注意:您需要更改参数的名称和位置值

{"properties":{"mode":"incremental","debugSetting":{"detailLevel":"RequestContent, ResponseContent"},"parameters":{"name":{"value":"yourrelayname"},"location":{"value":"location"}},"template":{"$schema":"http://schema.management.azure.com/schemas/2014-04-01-preview/deploymentTemplate.json#","contentVersion":"1.0.0.0","parameters":{"name":{"type":"string"},"location":{"type":"string"}},"resources":[{"apiVersion":"2016-07-01","name":"[parameters('name')]","location":"[parameters('location')]","type":"Microsoft.Relay/namespaces","properties":{"namespaceType":"Relay"}}]}}}
代码:

结果:


谢谢你的回答,但我正在谈论这个。谢谢你的回答,但我正在谈论这个。