Skip to content

Commit 25ebe5a

Browse files
authored
Update track 1 READMEs with notice (#1841)
* Update track 1 READMEs with notice * Regenerate mgmt, svc crates Also fixes a couple azure_svc_storage examples that somehow didn't cause errors previously. * Import READMEs and remove cargo-readme Fixes style check by removing use of `cargo-readme`. Instead, we'll just import the READMEs as we recommend in our modern guidelines.
1 parent faa662c commit 25ebe5a

File tree

335 files changed

+2246
-376
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

335 files changed

+2246
-376
lines changed

README.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,13 @@
22

33
This repository is for the development of the [unofficial](https://github.com/Azure/azure-sdk-for-rust/blob/main/FAQ.md#why-is-it-unofficial) Azure SDK for Rust.
44

5+
> Microsoft is developing the official Azure SDK for Rust crates and has no plans to update this unofficial crate.
6+
> In the future we may release an official version that may have a different package name.
7+
> If releasing an official version of this crate is important to you [let us know](https://github.com/Azure/azure-sdk-for-rust/issues/new/choose).
8+
>
9+
> Source for this crate can now be found in <https://github.com/Azure/azure-sdk-for-rust/tree/legacy>.
10+
> To monitor for an official, supported version of this crate, see <https://aka.ms/azsdk/releases>.
11+
512
## Crates
613

714
[All Azure SDK for Rust crates](https://crates.io/teams/github:azure:azure-sdk-publish-rust) are published on crates.io.

eng/scripts/cargo_readme.sh

Lines changed: 0 additions & 10 deletions
This file was deleted.

eng/scripts/code_style.sh

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -10,12 +10,7 @@ export RUSTFLAGS="-Dwarnings"
1010

1111
rustup update --no-self-update ${BUILD}
1212
rustup component add rustfmt --toolchain ${BUILD}
13-
cargo +${BUILD} install cargo-readme
1413
cargo +${BUILD} fmt --all -- --check
1514
cargo +${BUILD} clippy --all
1615
cargo +${BUILD} doc --all --no-deps
1716
./eng/scripts/check_json_format.sh
18-
./eng/scripts/cargo_readme.sh
19-
if git status sdk | grep -q '.md$'; then
20-
echo "Run ./eng/scripts/cargo_readme.sh to update readmes" && exit 1
21-
fi

sdk/core/README.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,12 @@
11
# azure_core
22

3+
> Microsoft is developing the official Azure SDK for Rust crates and has no plans to update this unofficial crate.
4+
> In the future we may release an official version that may have a different package name.
5+
> If releasing an official version of this crate is important to you [let us know](https://github.com/Azure/azure-sdk-for-rust/issues/new/choose).
6+
>
7+
> Source for this crate can now be found in <https://github.com/Azure/azure-sdk-for-rust/tree/legacy>.
8+
> To monitor for an official, supported version of this crate, see <https://aka.ms/azsdk/releases>.
9+
310
Core types and traits for the Rust Azure SDK.
411

512
This crate is part of the unofficial Azure SDK effort in Rust. For more

sdk/core/src/lib.rs

Lines changed: 1 addition & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,4 @@
1-
//! Core types and traits for the Rust Azure SDK.
2-
//!
3-
//! This crate is part of the unofficial Azure SDK effort in Rust. For more
4-
//! information on the project and an overview of other crates, please refer to
5-
//! [our GitHub repository](https://github.com/azure/azure-sdk-for-rust).
6-
//!
7-
//! It is a library that provides cross-cutting services to other client
8-
//! libraries. Please see the [general
9-
//! guidelines](https://azure.github.io/azure-sdk/general_azurecore.html).
10-
1+
#![doc = include_str!("../README.md")]
112
#![forbid(unsafe_code)]
123
#![deny(missing_debug_implementations, nonstandard_style)]
134
// #![warn(missing_docs, future_incompatible, unreachable_pub)]

sdk/data_cosmos/README.md

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,12 @@
11
# azure_data_cosmos
22

3+
> Microsoft is developing the official Azure SDK for Rust crates and has no plans to update this unofficial crate.
4+
> In the future we may release an official version that may have a different package name.
5+
> If releasing an official version of this crate is important to you [let us know](https://github.com/Azure/azure-sdk-for-rust/issues/new/choose).
6+
>
7+
> Source for this crate can now be found in <https://github.com/Azure/azure-sdk-for-rust/tree/legacy>.
8+
> To monitor for an official, supported version of this crate, see <https://aka.ms/azsdk/releases>.
9+
310
## The Cosmos DB crate.
411

512
`azure-data-cosmos` offers functionality needed to interact with Cosmos DB from Rust. As an abstraction over the [Cosmos DB
@@ -8,7 +15,7 @@ should also be possible with this crate.
815

916
### Examples
1017

11-
```rust
18+
```rust no_run
1219
// Using the prelude module of the Cosmos crate makes easier to use the Rust Azure SDK for Cosmos DB.
1320
use azure_data_cosmos::prelude::*;
1421
use azure_core::Context;

sdk/data_cosmos/src/lib.rs

Lines changed: 1 addition & 82 deletions
Original file line numberDiff line numberDiff line change
@@ -1,88 +1,7 @@
1+
#![doc = include_str!("../README.md")]
12
#![allow(clippy::enum_variant_names)]
23
#![allow(clippy::new_without_default)]
34
#![allow(clippy::module_inception)]
4-
5-
/*!
6-
# The Cosmos DB crate.
7-
8-
`azure-data-cosmos` offers functionality needed to interact with Cosmos DB from Rust. As an abstraction over the [Cosmos DB
9-
Rest API](https://docs.microsoft.com/rest/api/cosmos-db/), anything that is possible through that Rest API
10-
should also be possible with this crate.
11-
12-
## Examples
13-
14-
```no_run
15-
// Using the prelude module of the Cosmos crate makes easier to use the Rust Azure SDK for Cosmos DB.
16-
use azure_data_cosmos::prelude::*;
17-
use azure_core::Context;
18-
use serde::{Deserialize, Serialize};
19-
20-
// This is the stuct we want to use in our sample.
21-
// Make sure to have a collection with partition key "number" for this example to
22-
// work (you can create with this SDK too, check the examples folder for that task).
23-
#[derive(Serialize, Deserialize, Debug)]
24-
struct MySampleStruct {
25-
id: String,
26-
string: String,
27-
number: u64,
28-
}
29-
30-
impl azure_data_cosmos::CosmosEntity for MySampleStruct {
31-
type Entity = u64;
32-
33-
fn partition_key(&self) -> Self::Entity {
34-
self.number
35-
}
36-
}
37-
38-
#[tokio::main]
39-
async fn main() -> azure_core::Result<()> {
40-
// Let's get Cosmos primary key and account name from env variables.
41-
let primary_key =
42-
std::env::var("COSMOS_PRIMARY_KEY").expect("Set env variable COSMOS_PRIMARY_KEY first!");
43-
let account = std::env::var("COSMOS_ACCOUNT").expect("Set env variable COSMOS_ACCOUNT first!");
44-
45-
let database_name = std::env::args()
46-
.nth(1)
47-
.expect("please specify the database name as the first command line parameter");
48-
let collection_name = std::env::args()
49-
.nth(2)
50-
.expect("please specify the collection name as the second command line parameter");
51-
52-
// First, create an authorization token. There are two types of tokens: primary and resource constrained.
53-
// Please check the Azure documentation or the examples folder on how to create and use token-based permissions.
54-
let authorization_token = AuthorizationToken::primary_key(&primary_key)?;
55-
56-
// Next we will create a Cosmos client.
57-
let client = CosmosClient::new(account, authorization_token);
58-
59-
// We know the database so we can obtain a database client.
60-
let database = client.database_client(database_name);
61-
// We know the collection so we can obtain a collection client.
62-
let collection = database.collection_client(collection_name);
63-
64-
// Insert 10 documents
65-
println!("Inserting 10 documents...");
66-
for i in 0..10 {
67-
// define the document.
68-
let document_to_insert = MySampleStruct {
69-
id: format!("unique_id{}", i),
70-
string: "Something here".to_owned(),
71-
number: i * 100, // this is the partition key
72-
};
73-
74-
// insert it
75-
collection
76-
.create_document(document_to_insert)
77-
.is_upsert(true)
78-
.await?;
79-
}
80-
81-
Ok(())
82-
}
83-
```
84-
*/
85-
865
#![warn(unused_extern_crates)]
876
#![deny(missing_docs)]
887
#![recursion_limit = "256"]

sdk/data_tables/README.md

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,15 @@
11
# azure_data_tables
22

3+
> Microsoft is developing the official Azure SDK for Rust crates and has no plans to update this unofficial crate.
4+
> In the future we may release an official version that may have a different package name.
5+
> If releasing an official version of this crate is important to you [let us know](https://github.com/Azure/azure-sdk-for-rust/issues/new/choose).
6+
>
7+
> Source for this crate can now be found in <https://github.com/Azure/azure-sdk-for-rust/tree/legacy>.
8+
> To monitor for an official, supported version of this crate, see <https://aka.ms/azsdk/releases>.
9+
310
This crate is from the [Azure SDK for Rust](https://github.com/azure/azure-sdk-for-rust). It supports [Azure Table storage](https://docs.microsoft.com/azure/storage/tables/table-storage-overview).
411

5-
```rust
12+
```rust no_run
613
use azure_core::StatusCode;
714
use azure_data_tables::{operations::InsertEntityResponse, prelude::*};
815
use azure_storage::prelude::*;

sdk/data_tables/src/lib.rs

Lines changed: 1 addition & 64 deletions
Original file line numberDiff line numberDiff line change
@@ -1,67 +1,4 @@
1-
/*!
2-
This crate is from the [Azure SDK for Rust](https://github.com/azure/azure-sdk-for-rust). It supports [Azure Table storage](https://docs.microsoft.com/azure/storage/tables/table-storage-overview).
3-
4-
```no_run
5-
use azure_core::StatusCode;
6-
use azure_data_tables::{operations::InsertEntityResponse, prelude::*};
7-
use azure_storage::prelude::*;
8-
use futures::stream::StreamExt;
9-
use serde::{Deserialize, Serialize};
10-
11-
#[derive(Debug, Clone, Serialize, Deserialize)]
12-
struct MyEntity {
13-
#[serde(rename = "PartitionKey")]
14-
pub city: String,
15-
pub name: String,
16-
#[serde(rename = "RowKey")]
17-
pub surname: String,
18-
}
19-
20-
#[tokio::main]
21-
async fn main() -> azure_core::Result<()> {
22-
tracing_subscriber::fmt().init();
23-
24-
// First we retrieve the account name and access key from environment variables.
25-
let account =
26-
std::env::var("STORAGE_ACCOUNT").expect("Set env variable STORAGE_ACCOUNT first!");
27-
let access_key =
28-
std::env::var("STORAGE_ACCESS_KEY").expect("Set env variable STORAGE_ACCESS_KEY first!");
29-
let table_name = std::env::var("STORAGE_TABLE_NAME").expect("Set env variable STORAGE_TABLE_NAME first!");
30-
31-
let storage_credentials = StorageCredentials::access_key(account.clone(), access_key);
32-
let table_service = TableServiceClient::new(account, storage_credentials);
33-
34-
let table_client = table_service.table_client(table_name);
35-
table_client.create().await?;
36-
37-
let entity = MyEntity {
38-
city: "Milan".to_owned(),
39-
name: "Francesco".to_owned(),
40-
surname: "A".to_owned(),
41-
};
42-
43-
let _: InsertEntityResponse<MyEntity> = table_client.insert(&entity)?.await?;
44-
45-
// Get a client that refers to the above entity
46-
let entity_client = table_client.partition_key_client(&entity.city).entity_client(&entity.surname);
47-
48-
// Get an entity from the table
49-
let response = entity_client.get().await?;
50-
let mut entity: MyEntity = response.entity;
51-
52-
// update the entity in the table
53-
entity.name = "Ryan".to_owned();
54-
entity_client.update(&entity, response.etag.into())?.await?;
55-
entity_client.delete().await?;
56-
57-
/// delete the client now that we're done
58-
table_client.delete().await?;
59-
Ok(())
60-
}
61-
62-
```
63-
64-
*/
1+
#![doc = include_str!("../README.md")]
652

663
#[macro_use]
674
extern crate azure_core;

sdk/identity/README.md

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,18 @@
11
# azure_identity
22

3+
> Microsoft is developing the official Azure SDK for Rust crates and has no plans to update this unofficial crate.
4+
> In the future we may release an official version that may have a different package name.
5+
> If releasing an official version of this crate is important to you [let us know](https://github.com/Azure/azure-sdk-for-rust/issues/new/choose).
6+
>
7+
> Source for this crate can now be found in <https://github.com/Azure/azure-sdk-for-rust/tree/legacy>.
8+
> To monitor for an official, supported version of this crate, see <https://aka.ms/azsdk/releases>.
9+
310
Azure Identity crate for the unofficial Microsoft Azure SDK for Rust. This crate is part of a collection of crates: for more information please refer to [https://github.com/azure/azure-sdk-for-rust](https://github.com/azure/azure-sdk-for-rust).
411

512
This crate provides several implementations of the [azure_core::auth::TokenCredential](https://docs.rs/azure_core/latest/azure_core/auth/trait.TokenCredential.html) trait.
613
It is recommended to start with `azure_identity::create_credential()?`, which will create an instance of `DefaultAzureCredential` by default. If you want to use a specific credential type, the `AZURE_CREDENTIAL_KIND` environment variable may be set to a value from `azure_credential_kinds`, such as `azurecli` or `virtualmachine`.
714

8-
```rust
15+
```rust no_run
916
#[tokio::main]
1017
async fn main() -> Result<(), Box<dyn std::error::Error>> {
1118
let subscription_id =

0 commit comments

Comments
 (0)