This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import com.microsoft.azure.AzureEnvironment; | |
import com.microsoft.azure.PagedList; | |
import com.microsoft.azure.credentials.ApplicationTokenCredentials; | |
import com.microsoft.azure.management.Azure; | |
import com.microsoft.azure.management.compute.KnownWindowsVirtualMachineImage; | |
import com.microsoft.azure.management.compute.VirtualMachine; | |
import com.microsoft.azure.management.compute.VirtualMachineSizeTypes; | |
import com.microsoft.azure.management.resources.ResourceGroup; | |
import com.microsoft.azure.management.resources.fluentcore.arm.Region; | |
import com.vianet.azure.sdk.Application; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import com.microsoft.azure.management.compute.ComputeManagementClient; | |
import com.microsoft.azure.management.compute.ComputeManagementService; | |
import com.microsoft.azure.management.compute.models.*; | |
import com.microsoft.azure.management.network.NetworkResourceProviderClient; | |
import com.microsoft.azure.management.network.NetworkResourceProviderService; | |
import com.microsoft.azure.management.network.models.*; | |
import com.microsoft.azure.utility.AuthHelper; | |
import com.microsoft.windowsazure.Configuration; | |
import com.microsoft.windowsazure.exception.ServiceException; | |
import com.microsoft.windowsazure.management.configuration.ManagementConfiguration; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import com.microsoft.aad.adal4j.AuthenticationContext; | |
import com.microsoft.aad.adal4j.AuthenticationResult; | |
import org.w3c.dom.Document; | |
import org.w3c.dom.Node; | |
import org.xml.sax.InputSource; | |
import javax.naming.ServiceUnavailableException; | |
import javax.net.ssl.HttpsURLConnection; | |
import javax.xml.parsers.DocumentBuilder; | |
import javax.xml.parsers.DocumentBuilderFactory; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import org.glassfish.hk2.api.JustInTimeInjectionResolver; | |
import org.glassfish.hk2.utilities.binding.AbstractBinder; | |
import javax.inject.Singleton; | |
import javax.ws.rs.core.Feature; | |
import javax.ws.rs.core.FeatureContext; | |
public class AutoScanFeature implements Feature { | |
@Override |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System; | |
namespace PKCS1ToPKCS8Application | |
{ | |
class Program | |
{ | |
static void Main(string[] args) | |
{ | |
byte[] importedPrivateKeyBytes = Convert.FromBase64String("MIIEowIBAAKCAQEAtuHuMvnE3fYz/eom8mF7xxLXPETjfUpVYHL6AUVwXKKCrZ6uFszh2bY7ADoiIpuPTS0NVNYeKLlu6T59qzyr0bnT8KgXdZJFVzYWIh8VOLTb2zghlu8BeBoJP9t/a34Mj7gGJUZWBgECopEGCXrFwyIvXSW0JU5YrJinyyPhUjUXLeyowJUXoLwEafOHBRRiZZv1SNlntQOAenHFB/1uv2Y5xmdHm7xl+jjeo469u+pY535RCekmam9hWbZcn/WZEf9BZEmE2i4v7Qj72V92LrSUSSjF6w6lgU3B+Byu0XR8ZeUjD+FP9ZKvJyEtxlxOVaADQ+/udghUr1PnfXIHRQIDAQABAoIBAHG1UBFJ0unfJrx9VfHmQruoL0M94eQIz8TEOEWKEy7FrFKfEscCZHqlH1Io0wiJiDQICv3wk5fmk9taC3DorDweOnSrTsq/Q3XSHzjf8qXrbbeD0v6xZEx0g8O8iiEfolfJp6iNbvcUsbq6SPKj70pAewqDYtq/N8s4rztS98nQQ5PAQ10Zv3X910lc0vnPlPKew4y7w6hwb/pbiEBLbbV9tYAVaAm63n/EYxjo3UCRA0BJZxhJbRdEQzCEzClXlo6txx7nGQz/omv574P22ASCAfyrFNhaT20DR+ilIXe+edBpJehD6Q/lpO56STawb9xCAk6+aerM5dcIBMTETRECgYEA3RdnfpY1Z8KtOT1rVUeI094vylP1HONrcXNSsV0sbNPSwoK91UpO0mfsLLWxLtjvX52yixhfKxQ0QLYq3nyC8SRj2GE07aO1HZ81MI/9Y6ynJkw+ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
一般情况下,如果我们没有为Azure Service Fabric开启群集安全证书功能,我们只需要将域名的DNS解析绑定到Service Fabric群集使用的负载均衡器对应的公网IP上即可。 | |
但对于开启了安全证书功能的群集,我们需要将证书和域名进行绑定,相对要麻烦一些。 | |
1. 生成证书 | |
我们可以在CA申请自定义域名的可信证书,也可以使用自签名证书,无论哪种证书,我们都需要将证书使用者的名称和自定义域名保持一致。 | |
借助Github上的PowerShell模块生成证书并上传KeyVault。 | |
下载地址:https://github.com/ChackDan/Service-Fabric/tree/master/Scripts/ServiceFabricRPHelpers | |
Import-Module "C:\..\ServiceFabricRPHelpers\ServiceFabricRPHelpers.psm1" | |
$ResouceGroup = "kevin-group" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import base64 | |
import hmac | |
import urllib.parse | |
import paho.mqtt.client as mqtt | |
import time | |
hubAddress = "freeiottest.azure-devices.cn" | |
deviceId = "myDeviceId" | |
deviceKey = '<your device key>' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Param | |
( | |
[Parameter(ParameterSetName='Setting', Mandatory=$true)] | |
[String] | |
$SubscriptionId, | |
[Parameter(ParameterSetName='Setting', Mandatory=$true)] | |
[String] | |
$UserName, |