public async Task DatasetSample()
        {
            #region Snippet:CreateDatasetClient
            // Replace the string below with your actual endpoint url.
            string endpoint = "<my-endpoint-url>";
            /*@@*/ endpoint = TestEnvironment.EndpointUrl;
            DatasetClient client = new DatasetClient(endpoint: new Uri(endpoint), credential: new DefaultAzureCredential());
            #endregion

            #region Snippet:CreateDataset
            DatasetCreateOrUpdateDatasetOperation operation      = client.StartCreateOrUpdateDataset("MyDataset", new DatasetResource(new Dataset(new LinkedServiceReference(LinkedServiceReferenceType.LinkedServiceReference, TestEnvironment.WorkspaceName + "-WorkspaceDefaultStorage"))));
            Response <DatasetResource>            createdDataset = await operation.WaitForCompletionAsync();

            #endregion

            #region Snippet:RetrieveDataset
            DatasetResource retrievedDataset = client.GetDataset("MyDataset");
            #endregion

            #region Snippet:ListDatasets
            Pageable <DatasetResource> datasets = client.GetDatasetsByWorkspace();
            foreach (DatasetResource dataset in datasets)
            {
                System.Console.WriteLine(dataset.Name);
            }
            #endregion

            #region Snippet:DeleteDataset
            client.StartDeleteDataset("MyDataset");
            #endregion
        }
Beispiel #2
0
 public void CreateDataset()
 {
     #region Snippet:CreateDataset
     DatasetCreateOrUpdateDatasetOperation operation = DatasetClient.StartCreateOrUpdateDataset("MyDataset", new DatasetResource(new Dataset(new LinkedServiceReference(LinkedServiceReferenceType.LinkedServiceReference, TestEnvironment.WorkspaceName + "-WorkspaceDefaultStorage"))));
     DatasetResource dataset = operation.WaitForCompletionAsync().ConfigureAwait(true).GetAwaiter().GetResult();
     #endregion
 }
        public DatasetResource CreateOrUpdateDataset(string datasetName, string rawJsonContent)
        {
            DatasetResource dataset   = JsonConvert.DeserializeObject <DatasetResource>(rawJsonContent);
            var             operation = _datasetClient.StartCreateOrUpdateDataset(datasetName, dataset);

            return(operation.Poll().Value);
        }
        public DatasetResource CreateOrUpdateDataset(string datasetName, string rawJsonContent)
        {
            PSDatasetResource pSDatasetResource = JsonConvert.DeserializeObject <PSDatasetResource>(rawJsonContent, Settings);
            DatasetResource   dataset           = pSDatasetResource.ToSdkObject();
            var operation = _datasetClient.StartCreateOrUpdateDataset(datasetName, dataset);

            return(operation.Poll().Value);
        }