• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

C# Azure.TokenCloudCredentials类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了C#中Microsoft.Azure.TokenCloudCredentials的典型用法代码示例。如果您正苦于以下问题:C# TokenCloudCredentials类的具体用法?C# TokenCloudCredentials怎么用?C# TokenCloudCredentials使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



TokenCloudCredentials类属于Microsoft.Azure命名空间,在下文中一共展示了TokenCloudCredentials类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C#代码示例。

示例1: CreateClusterAsync

        /// <summary>
        /// Initiates creation of a new cluster.
        /// </summary>
        /// <remarks>
        /// If a cluster with the given domain could not be created, an exception should be thrown indicating the failure reason.
        /// </remarks>
        /// <param name="name">A unique name for the cluster.</param>
        /// <returns>The FQDN of the new cluster.</returns>
        public async Task<string> CreateClusterAsync(string name, IEnumerable<int> ports)
        {
            string token = await this.GetAuthorizationTokenAsync();
            TokenCloudCredentials credential = new TokenCloudCredentials(this.settings.SubscriptionID.ToUnsecureString(), token);

            string rgStatus = await this.CreateResourceGroupAsync(credential, name);

            if (rgStatus == "Exists")
            {
                throw new System.InvalidOperationException(
                    "ResourceGroup/Cluster already exists. Please try passing a different name, or delete the ResourceGroup/Cluster first.");
            }

            string templateContent = this.armTemplate;
            string parameterContent = this.armParameters
                .Replace("_CLUSTER_NAME_", name)
                .Replace("_CLUSTER_LOCATION_", this.settings.Region)
                .Replace("_USER_", this.settings.Username.ToUnsecureString())
                .Replace("_PWD_", this.settings.Password.ToUnsecureString());

            int ix = 1;
            foreach(int port in ports)
            {
                parameterContent = parameterContent.Replace($"_PORT{ix}_", port.ToString());
                ++ix;
            }

            await this.CreateTemplateDeploymentAsync(credential, name, templateContent, parameterContent);

            return (name + "." + this.settings.Region + ".cloudapp.azure.com");
        }
开发者ID:TylerAngell,项目名称:service-fabric-dotnet-management-party-cluster,代码行数:39,代码来源:ArmClusterOperator.cs


示例2: Main

        private const double days = -10; //max = -90  (90 days of logs is stored by audit logs)

        static void Main(string[] args)
        {
            Console.WriteLine("Starting operations log export.");

            string token = GetAuthorizationHeader();

            TokenCloudCredentials credentials = new TokenCloudCredentials(SubscriptionID, token);
            InsightsClient client = new InsightsClient(credentials);

            DateTime endDateTime = DateTime.Now;
            DateTime startDateTime = endDateTime.AddDays(days);
            
            string filterString = FilterString.Generate<ListEventsForResourceProviderParameters>(eventData => (eventData.EventTimestamp >= startDateTime) && (eventData.EventTimestamp <= endDateTime));
                     
            EventDataListResponse response = client.EventOperations.ListEvents(filterString, selectedProperties: null);
            List<EventData> logList = new List<EventData>(response.EventDataCollection.Value);

            while (!string.IsNullOrEmpty(response.EventDataCollection.NextLink))
            {
                Console.WriteLine($"Retrieving page {response.EventDataCollection.NextLink}");

                response = client.EventOperations.ListEventsNext(response.EventDataCollection.NextLink);
                logList.AddRange(response.EventDataCollection.Value);
            }

            ResourceManagementClient resClient = new ResourceManagementClient(credentials);
          
            Console.WriteLine($"Page retrieval completed, preparing to write to a file {CSVExportNamePath}.");

            ExportOpsLogToCSV(logList, resClient);

            Console.WriteLine("Export completed.");
            Console.WriteLine("Press any key to exit");
            Console.ReadLine();
        }
开发者ID:renatafigueiral,项目名称:networking-dotnet-log-converter,代码行数:37,代码来源:Program.cs


示例3: GetShare

        public void GetShare()
        {
            var response = new HttpResponseMessage(HttpStatusCode.OK)
            {
                Content = new StringContent(ExpectedResults.ShareGetResponse)
            };

            var handler = new RecordedDelegatingHandler(response)
            {
                StatusCodeToReturn = HttpStatusCode.OK
            };

            var subscriptionId = Guid.NewGuid().ToString();

            var token = new TokenCloudCredentials(subscriptionId, Constants.TokenString);
            var client = GetClient(handler, token);

            var result = client.Shares.Get(Constants.ResourceGroupName, Constants.FarmId, Constants.ShareAName);

            var expectedUri = string.Format(
                GetUriTemplate,
                Constants.BaseUri,
                subscriptionId,
                Constants.ResourceGroupName,
                Constants.FarmId, 
                Uri.EscapeDataString(Constants.ShareAName)
                );

            Assert.Equal(handler.Uri.AbsoluteUri, expectedUri);

            Assert.Equal(HttpMethod.Get, handler.Method);
            
            CompareExpectedResult(result.Share);
        }
开发者ID:bganapa,项目名称:azure-sdk-for-net,代码行数:34,代码来源:ShareTests.cs


示例4: CallSDK

        private static void CallSDK(string resourceManagementEndpoint, string subscriptionId, string header, string resourceGroupName)
        {
            TokenCloudCredentials aadTokenCredentials = new TokenCloudCredentials(subscriptionId, header);
            Uri resourceManagerUri = new Uri(resourceManagementEndpoint);
            DataPipelineManagementClient client = new DataPipelineManagementClient(aadTokenCredentials, resourceManagerUri);

            // create a data factory
            Console.WriteLine("Creating a data factory");
            try
            { 
                client.DataFactories.CreateOrUpdate(resourceGroupName,
                    new DataFactoryCreateOrUpdateParameters()
                    {
                        DataFactory = new DataFactory()
                        {
                            Name = dataFactoryName,
                            Location = "westus",
                            Properties = new DataFactoryProperties() { }
                        }
                    }
                );
            }
            catch (Exception ex)
            {
                Console.WriteLine(ex.ToString());
            }
        }
开发者ID:laurikoobas,项目名称:Azure,代码行数:27,代码来源:Program.cs


示例5: GetWebSiteManagementClient

 public WebSiteManagementClient GetWebSiteManagementClient(RecordedDelegatingHandler handler)
 {
     handler.IsPassThrough = false;
     var token = new TokenCloudCredentials(Guid.NewGuid().ToString(), "abc123");
     var client = new WebSiteManagementClient(token).WithHandler(handler);
     client = client.WithHandler(handler);
     return client;
 }
开发者ID:ChandraSogali,项目名称:azure-sdk-for-net,代码行数:8,代码来源:WebHostingPlans.ScenarioTests.cs


示例6: GetUsageAggregationManagementClient

        public UsageAggregationManagementClient GetUsageAggregationManagementClient(RecordedDelegatingHandler handler)
        {
            handler.IsPassThrough = false;

            var token = new TokenCloudCredentials(Guid.NewGuid().ToString(), "abc123");
            UsageAggregationManagementClient client = new UsageAggregationManagementClient(token, new Uri("https://mn-azure/management/"));
            client = client.WithHandler(handler);
            return client;
        }
开发者ID:pattipaka,项目名称:azure-sdk-for-net,代码行数:9,代码来源:UsageAggregatesScenarioTests.cs


示例7: GetFeatureClient

        public FeatureClient GetFeatureClient(RecordedDelegatingHandler handler)
        {
            var token = new TokenCloudCredentials(Guid.NewGuid().ToString(), "abc123");
            handler.IsPassThrough = false;
            var client = new FeatureClient(token).WithHandler(handler);

            HttpMockServer.Mode = HttpRecorderMode.Playback;
            return client;
        }
开发者ID:theadriangreen,项目名称:azure-sdk-for-net,代码行数:9,代码来源:FeatureTests.InMemory.cs


示例8: RefreshTokenAsync

 private async Task RefreshTokenAsync()
 {
     var token = await GetTokenAsync(Guid.Parse(_connectionData.AzureRMTenantId));
     
     if (token == null)
         throw new InvalidOperationException("Sorry, a token could not be accquired. Please verify your Service Principal.");
     
     if (_accessToken == null)
         _accessToken = new TokenCloudCredentials(_connectionData.AzureSubscriptionId, token.access_token);
 }
开发者ID:peterschen,项目名称:SMAStudio,代码行数:10,代码来源:AzureRMService.cs


示例9: TestAsyncOperationWithEmptyPayload

 public void TestAsyncOperationWithEmptyPayload()
 {
     var tokenCredentials = new TokenCloudCredentials("123", "abc");
     var handler = new PlaybackTestHandler(MockAsyncOperaionWithEmptyBody());
     var fakeClient = new RedisManagementClient(tokenCredentials, handler);
     fakeClient.LongRunningOperationInitialTimeout = fakeClient.LongRunningOperationRetryTimeout = 0;
     var error = Assert.Throws<CloudException>(() =>
         fakeClient.RedisOperations.Delete("rg", "redis", "1234"));
     Assert.Equal("The response from long running operation does not contain a body.", error.Message);
 }
开发者ID:juvchan,项目名称:autorest,代码行数:10,代码来源:LongRunningOperationsTest.cs


示例10: TokenCloudCredentialAddsHeader

        public void TokenCloudCredentialAddsHeader()
        {
            var tokenCredentials = new TokenCloudCredentials("123","abc");
            var handler = new RecordedDelegatingHandler { StatusCodeToReturn = HttpStatusCode.OK };
            var fakeClient = new FakeServiceClientWithCredentials(tokenCredentials);
            fakeClient = new FakeServiceClientWithCredentials(tokenCredentials, handler);
            fakeClient.DoStuff().Wait();

            Assert.Equal("Bearer", handler.RequestHeaders.Authorization.Scheme);
            Assert.Equal("abc", handler.RequestHeaders.Authorization.Parameter);
        }
开发者ID:juvchan,项目名称:autorest,代码行数:11,代码来源:TokenCloudCredentialsTest.cs


示例11: ListHistoryActiveFaults

        public void ListHistoryActiveFaults()
        {
            var response = new HttpResponseMessage(HttpStatusCode.OK)
            {
                Content = new StringContent(ExpectedResults.HistoryActiveFaultListResponse)
            };

            var handler = new RecordedDelegatingHandler(response)
            {
                StatusCodeToReturn = HttpStatusCode.OK
            };

            var subscriptionId = Guid.NewGuid().ToString();

            var token = new TokenCloudCredentials(subscriptionId, Constants.TokenString);
            var client = GetClient(handler, token);
            var startTime = new DateTime(2015, 3, 18);
            var endTime = new DateTime(2015, 3, 18);
            var ResourceUri = "/subscriptions/serviceAdmin/resourceGroups/system/providers/Microsoft.Storage.Admin/farms/WEST_US_1/tableserverinstances/woss-node1";

            var result = client.Faults.ListHistoryFaults(
                Constants.ResourceGroupName,
                Constants.FarmId,
                startTime.ToString("o"),
                endTime.ToString("o"),
                ResourceUri);

            // validate requestor
            Assert.Equal(handler.Method, HttpMethod.Get);

            var expectedUri = string.Format(
                FaultListUriTemplate,
                Constants.BaseUri,
                subscriptionId,
                Constants.ResourceGroupName,
                Constants.FarmId);

            var expectedFilterUri = string.Format(
                HistoryFaultFilterUriTemplate,
                Uri.EscapeDataString(startTime.ToString("o")),
                Uri.EscapeDataString(endTime.ToString("o")),
                Uri.EscapeDataString(ResourceUri));

            expectedUri = string.Concat(expectedUri, expectedFilterUri);
            expectedUri = expectedUri.Replace(" ", "%20");

            Assert.Equal(handler.Uri.AbsoluteUri, expectedUri);

            Assert.True(result.Faults.Count > 1);
            CompareExpectedResult(result.Faults[0], false);
        }
开发者ID:bganapa,项目名称:azure-sdk-for-net,代码行数:51,代码来源:FaultTests.cs


示例12: Main

        static void Main(string[] args)
        {
            //https://msdn.microsoft.com/en-us/library/azure/dn790557.aspx#bk_portal
            string token = GetAuthorizationHeader();

            TokenCloudCredentials creds = new TokenCloudCredentials(subscriptionId,token);

            RedisManagementClient client = new RedisManagementClient(creds);
            var redisProperties = new RedisProperties();
            redisProperties.Sku = new Sku(redisSKUName,redisSKUFamily,redisSKUCapacity);
            redisProperties.RedisVersion = redisVersion;
            var redisParams = new RedisCreateOrUpdateParameters(redisProperties, redisCacheRegion);
            client.Redis.CreateOrUpdate(resourceGroupName,cacheName, redisParams);
        }
开发者ID:bibhaspaul,项目名称:RedisSamples,代码行数:14,代码来源:Program.cs


示例13: Main

        static void Main(string[] args)
        {
            // Define the base URI for management operations
            Uri baseUri = new Uri("https://management.azure.com");

            string token = GetAuthorizationHeader();
            var startTime = DateTime.Now;
            var endTime = startTime.ToUniversalTime().AddHours(1.0).ToLocalTime();
            var redisConnection = "";

            ConnectionMultiplexer connection = ConnectionMultiplexer.Connect(redisConnection);
            IDatabase cachedb = connection.GetDatabase();
            for (int i = 0; i < 10; i++)
            {
                cachedb.StringIncrement(i.ToString());
                Console.WriteLine("value=" + cachedb.StringGet(i.ToString()));

            }

            // Get the credentials
            // You can find instructions on how to get the token here:
            // http://msdn.microsoft.com/en-us/library/azure/dn790557.aspx
            SubscriptionCloudCredentials credentials = new TokenCloudCredentials(subscriptionId, token);

            // Create an instance of the InsightsClient from Microsoft.Azure.Insights
            InsightsClient client = new InsightsClient(credentials, baseUri);

            // Get the events for an Azure Resource (e.g. Website) (as described by the Azure Resource Manager APIs here:http://msdn.microsoft.com/en-us/library/azure/dn790569.aspx)
            // A resource URI looks like the following string:
            //"/subscriptions/########-####-####-####-############/resourceGroups/resourcegroupname1/providers/resourceprovider1/resourcename1"
            string resourceUri = string.Format("subscriptions/{0}/resourceGroups/{1}/providers/Microsoft.Cache/redis/{2}", subscriptionId,resourceGroupName, cacheName);

            //Define a FilterString
            string filterString = FilterString.Generate<ListEventsForResourceParameters>(eventData => (eventData.EventTimestamp >= startTime) && (eventData.EventTimestamp <= endTime) && (eventData.ResourceUri == resourceUri));

            //Get the events logs
            EventDataListResponse response = client.EventOperations.ListEvents(filterString, selectedProperties: null);

            //Check the status code of the response
            Console.WriteLine("HTTP Status Code returned for the call:" + response.StatusCode);

            var response2 = client.MetricDefinitionOperations.GetMetricDefinitions(resourceUri, "");
            var metrics = client.MetricOperations.GetMetrics(resourceUri, "startTime eq 2015-01-14T02:19:03.0712821Z and endTime eq 2015-01-14T03:19:03.0712821Z and timeGrain eq duration'PT5M'", response2.MetricDefinitionCollection.Value);
            Console.WriteLine("Print out the metrics logs");
            foreach (var item in metrics.MetricCollection.Value)
            {
                Console.WriteLine(item.Name.Value + "--" +item.MetricValues.Count);
            }
        }
开发者ID:hahaxj,项目名称:RedisSamples,代码行数:49,代码来源:Program.cs


示例14: create_adf_client

        private void create_adf_client()
        {
            var authenticationContext = new AuthenticationContext($"https://login.windows.net/{tenant_id}");
            var credential = new ClientCredential(clientId: client_id, clientSecret: client_key);
            var result = authenticationContext.AcquireToken(resource: "https://management.core.windows.net/", clientCredential: credential);

            if (result == null)
            {
                throw new InvalidOperationException("Failed to obtain the JWT token");
            }

            var token = result.AccessToken;

            var _credentials = new TokenCloudCredentials(subscription_id, token);
            inner_client = new DataFactoryManagementClient(_credentials);
        }
开发者ID:JustLogic,项目名称:EatCodeLive,代码行数:16,代码来源:DataFactoryHelper.cs


示例15: TestCreateOrUpdateWithAsyncHeader

        public void TestCreateOrUpdateWithAsyncHeader()
        {
            var tokenCredentials = new TokenCloudCredentials("123", "abc");
            var handler = new PlaybackTestHandler(MockCreateOrUpdateWithTwoTries());
            var fakeClient = new RedisManagementClient(tokenCredentials, handler);
            fakeClient.LongRunningOperationInitialTimeout = fakeClient.LongRunningOperationRetryTimeout = 0;
            fakeClient.RedisOperations.CreateOrUpdate("rg", "redis", new RedisCreateOrUpdateParameters(), "1234");

            Assert.Equal(HttpMethod.Put, handler.Requests[0].Method);
            Assert.Equal("https://management.azure.com/subscriptions/1234/resourceGroups/rg/providers/Microsoft.Cache/Redis/redis", 
                handler.Requests[0].RequestUri.ToString());
            Assert.Equal(HttpMethod.Get, handler.Requests[1].Method);
            Assert.Equal("http://custom/status",
                handler.Requests[1].RequestUri.ToString());
            Assert.Equal(HttpMethod.Get, handler.Requests[2].Method);
            Assert.Equal("https://management.azure.com/subscriptions/1234/resourceGroups/rg/providers/Microsoft.Cache/Redis/redis",
                handler.Requests[2].RequestUri.ToString());
        }
开发者ID:juvchan,项目名称:autorest,代码行数:18,代码来源:LongRunningOperationsTest.cs


示例16: MainAsync

        private static async Task MainAsync()
        {
            // Obtain an access token using the "common" AAD resource. This allows the application
            // to query AAD for information that lies outside the application's tenant (such as for
            // querying subscription information in your Azure account).
            AuthenticationContext authContext = new AuthenticationContext(AuthorityUri);
            AuthenticationResult authResult = authContext.AcquireToken(ResourceUri,
                                                                       ClientId,
                                                                       new Uri(RedirectUri),
                                                                       PromptBehavior.Auto);

            // The first credential object is used when querying for subscriptions, and is therefore
            // not associated with a specific subscription.
            TokenCloudCredentials subscriptionCreds = new TokenCloudCredentials(authResult.AccessToken);

            string subscriptionId = String.Empty;
            using (SubscriptionClient subClient = new SubscriptionClient(subscriptionCreds))
            {
                // Ask the user to select a subscription. We'll use the selected subscription's
                // ID when constructing another credential object used in initializing the management
                // clients for the remainder of the sample.
                subscriptionId = await SelectSubscriptionAsync(subClient);
            }

            // These credentials are associated with a subscription, and can therefore be used when
            // creating Resource and Batch management clients for use in manipulating entities within
            // the subscription (e.g. resource groups and Batch accounts).
            TokenCloudCredentials creds = new TokenCloudCredentials(subscriptionId, authResult.AccessToken);

            // With the ResourceManagementClient, we create a resource group in which to create the Batch account.
            using (ResourceManagementClient resourceManagementClient = new ResourceManagementClient(creds))
            {
                // Register with the Batch resource provider; this only needs to be performed once per subscription.
                resourceManagementClient.Providers.Register(BatchNameSpace);
                
                string location = await PromptUserForLocationAsync(resourceManagementClient);
                
                await CreateResourceGroupAsync(resourceManagementClient, location);

                await PerformBatchAccountOperationsAsync(creds, location);

                await DeleteResourceGroupAsync(resourceManagementClient);
            }
        }
开发者ID:Wahesh,项目名称:azure-batch-samples,代码行数:44,代码来源:Program.cs


示例17: GetSubscriptions

        public async Task<IList<SubscriptionObject>> GetSubscriptions()
        {
            if (azureADAuthResult == null)
                throw new Exception(Properties.Resources.AzureADAuthResult);

            // Common subscription object to host subscriptions from RDFE & ARM
            IList<SubscriptionObject> subscriptionList = new List<SubscriptionObject>();

            subscriptionCredentials = new Microsoft.Azure.TokenCloudCredentials(azureADAuthResult.AccessToken);
            subscriptionClient = new Microsoft.Azure.Subscriptions.SubscriptionClient(subscriptionCredentials);

            var cancelToken = new CancellationToken();
            Microsoft.Azure.Subscriptions.Models.SubscriptionListResult subscriptionResults = await subscriptionClient.Subscriptions.ListAsync(cancelToken);

            // Add any ARM subscriptions to the common subscription object
            foreach (var subscription in subscriptionResults.Subscriptions)
            {
                var subList = new SubscriptionObject();
                subList.Name = subscription.DisplayName;
                subList.SubscriptionId = subscription.SubscriptionId;
                subList.Authority = "common";
                subscriptionList.Add(subList);
            }

            // Add any RDFE subscriptions to the common subscription object
            IList<Microsoft.WindowsAzure.Subscriptions.Models.SubscriptionListOperationResponse.Subscription> RDFEsubscriptions = await GetRDFESubscriptions();
            foreach (var subscription in RDFEsubscriptions)
            {
                // Only add subscriptions that are not already in the subscription list
                if (subscriptionList.Where(x => x.SubscriptionId == subscription.SubscriptionId).Count() == 0)
                {
                    var subList = new SubscriptionObject();
                    subList.Name = subscription.SubscriptionName;
                    subList.SubscriptionId = subscription.SubscriptionId;
                    subList.Authority = subscription.ActiveDirectoryTenantId;
                    subscriptionList.Add(subList);
                }
            }

            return subscriptionList;
        }
开发者ID:befishe,项目名称:azure-automation-ise-addon,代码行数:41,代码来源:AutomationISEClient.cs


示例18: CreateQuota

        public void CreateQuota()
        {
            var response = new HttpResponseMessage(HttpStatusCode.OK)
            {
                Content = new StringContent(ExpectedResults.QuotaGetResponse)
            };

            var handler = new RecordedDelegatingHandler(response)
            {
                StatusCodeToReturn = HttpStatusCode.OK
            };

            var subscriptionId = Guid.NewGuid().ToString();

            var token = new TokenCloudCredentials(subscriptionId, Constants.TokenString);
            var client = GetClient(handler, token);

            var quotaReq = new QuotaCreateOrUpdateParameters
            {
                Properties = new Quota
                {
                    CapacityInGB = 100,
                    NumberOfStorageAccounts = 10
                }
            };

            var result = client.Quotas.CreateOrUpdate(Constants.LocationName, Constants.QuotaName, quotaReq);

            var expectedUri = string.Format(
                CreateOrUpdateOrDeleteOrGetUriTemplate,
                Constants.BaseUri,
                subscriptionId,
                Constants.LocationName,
                Constants.QuotaName);

            Assert.Equal(expectedUri, handler.Uri.AbsoluteUri);

            Assert.Equal(HttpMethod.Put, handler.Method);

            CompareExpectedResult(result.Quota, subscriptionId);
        }
开发者ID:bganapa,项目名称:azure-sdk-for-net,代码行数:41,代码来源:QuotaTests.cs


示例19: Main

        static void Main(string[] args)
        {
            // Read region values from parameters.txt file.
            // We will create on retraining pipeline and one scoring pipeline for each region values.
            // Note: You will typically replace this with code to read this from your data store.
            string[] parameters =  System.IO.File.ReadAllLines(@"parameters.txt");

            // create data factory management client. This will pop up a UI for
            // Azure login for your subscription.
            TokenCloudCredentials aadTokenCredentials =
                new TokenCloudCredentials(
                    ConfigurationManager.AppSettings["SubscriptionId"],
                    Utilities.GetAuthorizationHeader());

            Uri resourceManagerUri = new Uri(ConfigurationManager.AppSettings["ResourceManagerEndpoint"]);

            DataFactoryManagementClient client = new DataFactoryManagementClient(aadTokenCredentials, resourceManagerUri);

            Utilities.CreateDataFactory(DataFactoryConfig.ResourceGroupName, DataFactoryConfig.DataFactoryName, client);

            // We use the same storage account to put results of both retraining and scoring. Hence create the shared
            // linked servive for the storage account before creating the 2 pipelines.
            Utilities.CreateStorageLinkedService(DataFactoryConfig.ResourceGroupName, DataFactoryConfig.DataFactoryName, client);

            // Note: The CreateMLEndpoints creates as many endpoint entries in the endpoints collection as there are regions.
            // In this sample we are using the same hardwired value of the endpoint for each entry in the collection. You will need
            // to replace this code with code that programatically creates multiple endpoints.
            IList<UpdateResourceEndpoint> mlEndpoints;
            Utilities.CreateMLEndpoints(out mlEndpoints, parameters.Length);

            // Note: retraining pipeline generation code creates the scoring linked services that are referenced by
            // scoring pipeline. Hence retraining pipeline code MUST run before the scoring pipeline code.
            RetrainingPipeline.CreateObjects(parameters, client, mlEndpoints);
            ScoringPipeline.CreateObjects(parameters, client);

            // We don't have a copy step. This is commented out bonus code for copying data if you needed to have data movement as well.
            //CopyPipeline.CreateObjects(parameters, client);

            Console.WriteLine("Press Enter to exit");
            Console.ReadLine();
        }
开发者ID:Coderrs,项目名称:Azure-DataFactory,代码行数:41,代码来源:Program.cs


示例20: ListStorageAccounts

        public void ListStorageAccounts()
        {
            var response = new HttpResponseMessage(HttpStatusCode.OK)
            {
                Content = new StringContent(ExpectedResults.StorageAccountListResponse)
            };

            var handler = new RecordedDelegatingHandler(response)
            {
                StatusCodeToReturn = HttpStatusCode.OK
            };

            var subscriptionId = Guid.NewGuid().ToString();

            var token = new TokenCloudCredentials(subscriptionId, Constants.TokenString);
            var client = GetClient(handler, token);

            var result = client.StorageAccounts.List(Constants.ResourceGroupName, Constants.FarmId, null, true);

            // validate requestor
            Assert.Equal(handler.Method, HttpMethod.Get);

            var expectedUri = string.Format(
                ListUriTemplate,
                Constants.BaseUri,
                subscriptionId,
                Constants.ResourceGroupName,
                Constants.FarmId,
                "true");

            Assert.Equal(handler.Uri.AbsoluteUri, expectedUri);

            // Validate headers 
            Assert.Equal(HttpMethod.Get, handler.Method);

            Assert.True(result.StorageAccounts.Count == 3);

            CompareExpectedListResultCommon(result);

            CompareExpectedListResultWacProperties(result, true);
        }
开发者ID:Karamell,项目名称:azure-sdk-for-net,代码行数:41,代码来源:StorageAccountTests.cs



注:本文中的Microsoft.Azure.TokenCloudCredentials类示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C# Transport.TransportAsyncCallbackArgs类代码示例发布时间:2022-05-26
下一篇:
C# TagHelpers.TagHelperOutput类代码示例发布时间:2022-05-26
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap