Example #1
0
        private Azure(RestClient restClient, string subscriptionId, string tenantId, IAuthenticated authenticated)
        {
            resourceManager          = ResourceManager.Fluent.ResourceManager.Authenticate(restClient).WithSubscription(subscriptionId);
            storageManager           = StorageManager.Authenticate(restClient, subscriptionId);
            computeManager           = ComputeManager.Authenticate(restClient, subscriptionId);
            networkManager           = NetworkManager.Authenticate(restClient, subscriptionId);
            batchManager             = BatchManager.Authenticate(restClient, subscriptionId);
            keyVaultManager          = KeyVaultManager.Authenticate(restClient, subscriptionId, tenantId);
            trafficManager           = TrafficManager.Fluent.TrafficManager.Authenticate(restClient, subscriptionId);
            dnsZoneManager           = DnsZoneManager.Authenticate(restClient, subscriptionId);
            sqlManager               = SqlManager.Authenticate(restClient, subscriptionId);
            redisManager             = RedisManager.Authenticate(restClient, subscriptionId);
            cdnManager               = CdnManager.Authenticate(restClient, subscriptionId);
            appServiceManager        = AppServiceManager.Authenticate(restClient, subscriptionId, tenantId);
            searchManager            = SearchManager.Authenticate(restClient, subscriptionId);
            serviceBusManager        = ServiceBusManager.Authenticate(restClient, subscriptionId);
            containerInstanceManager = ContainerInstanceManager.Authenticate(restClient, subscriptionId);
            registryManager          = RegistryManager.Authenticate(restClient, subscriptionId);
            containerServiceManager  = ContainerServiceManager.Authenticate(restClient, subscriptionId);
            cosmosDBManager          = CosmosDBManager.Authenticate(restClient, subscriptionId);
            authorizationManager     = AuthorizationManager.Authenticate(restClient, subscriptionId);
            msiManager               = MsiManager.Authenticate(restClient, subscriptionId);
            batchAIManager           = BatchAIManager.Authenticate(restClient, subscriptionId);
            monitorManager           = MonitorManager.Authenticate(restClient, subscriptionId);
            eventHubManager          = EventHubManager.Authenticate(restClient, subscriptionId);

            SubscriptionId     = subscriptionId;
            this.authenticated = authenticated;
        }
Example #2
0
        public static void Main(string[] args)
        {
            try
            {
                //=================================================================
                // Authenticate
                var credentials =
                    SdkContext.AzureCredentialsFactory.FromFile(
                        Environment.GetEnvironmentVariable("AZURE_AUTH_LOCATION"));

                var azure = Azure.Configure()
                            .WithLogLevel(HttpLoggingDelegatingHandler.Level.Basic)
                            .Authenticate(credentials)
                            .WithDefaultSubscription();
                var networkManager = NetworkManager.Authenticate(credentials, azure.SubscriptionId);

                // Print selected subscription
                Utilities.Log("Selected subscription: " + azure.SubscriptionId);
                RunSample(azure, networkManager);
            }
            catch (Exception ex)
            {
                Utilities.Log(ex);
            }
        }
Example #3
0
 public ComputeManager(RestClient restClient, string subscriptionId) :
     base(restClient, subscriptionId, ComputeManagementClient.NewInstance(restClient))
 {
     Inner.SubscriptionId = subscriptionId;
     storageManager       = StorageManager.Authenticate(restClient, subscriptionId);
     networkManager       = NetworkManager.Authenticate(restClient, subscriptionId);
     rbacManager          = GraphRbacManager.Authenticate(restClient, restClient.Credentials.TenantId);
 }
Example #4
0
 public ComputeManager(RestClient restClient, string subscriptionId) :
     base(restClient, subscriptionId, new ComputeManagementClient(restClient)
 {
     SubscriptionId = subscriptionId
 })
 {
     storageManager = StorageManager.Authenticate(restClient, subscriptionId);
     networkManager = NetworkManager.Authenticate(restClient, subscriptionId);
     rbacManager    = GraphRbacManager.Authenticate(restClient, restClient.Credentials.TenantId);
 }
Example #5
0
    public void OnLoginClicked()
    {
        NetworkManager network = NetworkManager.Instance;

        network.Authenticate(new RLoginData
        {
            username = _username.text,
            password = _password.text
        }).Then((arg) =>
        {
            Debug.Log(arg);
        }).Catch((arg) => Debug.LogError(arg));
    }
 public ComputeManager(RestClient restClient, string subscriptionId) :
     base(restClient, subscriptionId, new ComputeManagementClient(new Uri(restClient.BaseUri),
                                                                  restClient.Credentials,
                                                                  restClient.RootHttpHandler,
                                                                  restClient.Handlers.ToArray())
 {
     SubscriptionId = subscriptionId
 })
 {
     storageManager = StorageManager.Authenticate(restClient, subscriptionId);
     networkManager = NetworkManager.Authenticate(restClient, subscriptionId);
     rbacManager    = GraphRbacManager.Authenticate(restClient, ((AzureCredentials)(restClient.Credentials)).TenantId);
 }